# Create Network

put ` https://app.mk.io/api/v1/projects/:project_name/infra/networks/:name`

Create a network. To learn more about networks, read Network Concept.

RBAC Capability Required: `infra.network.create`

## Authentication

Authorization Bearer

Bearer authentication of the form `Bearer <token>`, where token is your
auth token.

## Path parameters

- `project_name` **string** Required
- `name` **string** Required

## Request

This endpoint expects an object.

- `metadata` **object** [DefaultMetadata](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/defaultmetadata) Required
  - `displayName` **string** Required
    - A human-readable name for the resource.
  - `labels` **map from strings to string** Optional
    - A dictionary of labels associated with the resource.
    - Maximum number of labels: 32.
    - Maximum length of a label or value: 256 characters.
    - Label: alphanumeric, hyphens and underscores.
    - Value: alphanumeric, hyphens, underscores, and spaces.

- `spec` **object** [NetworkBodySpec](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/networkbodyspec) Required
  - Network specification.

## Response

201 The created network

- `kind` **string** Required
  - The kind of record.

- `metadata` **object** [MetadataSchema](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/metadataschema) Required
  - Network metadata.
    - `created` **string** Optional format: date-time
      - The time when the resource was created
    - `createdBy` **string** Optional format: uuid
      - ID of the user who created the resource
    - `createdByEmail` **string** Optional
      - Email of the user who created the resource
    - `displayName` **string** Optional
      - The display name of the resource
    - `id` **string** Required format: uuid
      - The ID of the resource
    - `labels` **map from strings to string** Optional
      - A dictionary of labels associated with the resource
    - `name` **string** Optional
      - The name of the resource
    - `updated` **string** Optional format: date-time
      - The time when the resource was last updated
    - `updatedBy` **string** Optional format: uuid
      - ID of the user who last updated the resource
    - `updatedByEmail` **string** Optional
      - Email of the user who last updated the resource
    - `spec` **object** [NetworkBodySpec](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/networkbodyspec) Required
      - Network specification.

- `status` **object** [NetworkBodyStatus](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/networkbodystatus) Required
  - Network status.
    - `owner` **enum** Required
      - Indicates whether the network was automatically created by the system. System owned networks cannot be deleted, but they can be modified. To learn more, read System owned networks.
      - Allowed values: User, System
    - `scope` **enum** Required
      - Indicates whether the network is a local network within a site. Local networks are always system owned and therefore cannot be deleted; however, they can be modified.
      - Allowed values: Connecting, Local

## Errors

- `400` Bad Request
  - `error` **object** [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) Required
    - Pertinent information about the error
    - `code` **string** Required
    - `detail` **string** Required
    - `extraDetail` **map from strings to any** Optional
      - Extra information regarding this error.
      - `ref` **string** Required
      - A reference to the request that caused the error.
      - `status` **integer** Required
      - The HTTP status code

- `401` Unauthorized
  - `error` **object** [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) Required
    - Pertinent information about the error
    - `code` **string** Required
    - `detail` **string** Required
    - `extraDetail` **map from strings to any** Optional
      - Extra information regarding this error.
      - `ref` **string** Required
      - A reference to the request that caused the error.
      - `status` **integer** Required
      - The HTTP status code

- `403` Forbidden
  - `error` **object** [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) Required
    - Pertinent information about the error
    - `code` **string** Required
    - `detail` **string** Required
    - `extraDetail` **map from strings to any** Optional
      - Extra information regarding this error.
      - `ref` **string** Required
      - A reference to the request that caused the error.
      - `status` **integer** Required
      - The HTTP status code

- `404` Not Found
  - `error` **object** [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) Required
    - Pertinent information about the error
    - `code` **string** Required
    - `detail` **string** Required
    - `extraDetail` **map from strings to any** Optional
      - Extra information regarding this error.
      - `ref` **string** Required
      - A reference to the request that caused the error.
      - `status` **integer** Required
      - The HTTP status code

- `409` Conflict
  - `error` **object** [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) Required
    - Pertinent information about the error
    - `code` **string** Required
    - `detail` **string** Required
    - `extraDetail` **map from strings to any** Optional
      - Extra information regarding this error.
      - `ref` **string** Required
      - A reference to the request that caused the error.
      - `status` **integer** Required
      - The HTTP status code

- `429` Too Many Requests
  - `error` **object** [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) Required
    - Pertinent information about the error
    - `code` **string** Required
    - `detail` **string** Required
    - `extraDetail` **map from strings to any** Optional
      - Extra information regarding this error.
      - `ref` **string** Required
      - A reference to the request that caused the error.
      - `status` **integer** Required
      - The HTTP status code

- `500` Internal Server Error
  - `error` **object** [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) Required
    - Pertinent information about the error
    - `code` **string** Required
    - `detail` **string** Required
    - `extraDetail` **map from strings to any** Optional
      - Extra information regarding this error.
      - `ref` **string** Required
      - A reference to the request that caused the error.
      - `status` **integer** Required
      - The HTTP status code
