# Create Site

Put ` https://app.mk.io/api/v1/projects/:project_name/infra/sites/:name`

Create a site. To learn more about sites, read Site Concept.

RBAC Capability Required: `infra.site.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**  
Resource metadata.

- **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` [SiteBodySpec](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/sitebodyspec) **Optional**  
Site specification.

- **geolocation** `object` [GeolocationFragment](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/geolocationfragment) **Optional**  
Optional geolocation data for the site.
  - **coordinates** `list of doubles` **Required**  
  Co-ordinates that describe the geolocation (ISO 6709), an array of two floating point numbers \[latitude(North - South), longitude(East - West)\]. Set an empty array to clear the geolocation.

- **routes** `list of objects` [RouteJsonFragment](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/routejsonfragment) **Optional**  
The routes that connect the network to <glossary:site>s.

**defaultTransport** `object` [DefaultTransport](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/defaulttransport) **Optional**  
Settings used to influence the <glossary:transport> that the system will automatically select when it needs to send <glossary:content> from one <glossary:flow> to another flow. The default transport settings from the route on which the content enters the network are used to select and configure the transport for the content.

- **cidr** `string` **Optional**  
Defaults to the IP address range to choose from when the system automatically creates transport settings for sending content from one flow to another.
- **type** `enum` **Required**  
The type of <glossary:transport> to use for sending content from one flow to another flow.
  - Allowed values: Auto, SRTListener, SRTCaller, UDPRISTListener.
- **networkName** `string` **Required**  
Pattern: ^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$  
The name of the <glossary:network> connected to the site by this route.

## Response

- **201** The created site
  - **kind** `string` **Required**  
  The kind of record.
  - **metadata** `object` [MetadataSchema](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/metadataschema) **Required**  
  Site 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` [SiteBodySpec](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/sitebodyspec) **Required**  
  Site specification.

## 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**  
  The error code.
  - **detail** `string` **Required**  
  The error message.
  - **extraDetail** `map from strings to any` **Optional**  
  Extra information regarding this error.
  
- **401** Unauthorized
  - **error** `object` [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) **Required**  
  Pertinent information about the error.

- **403** Forbidden
  - **error** `object` [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) **Required**  
  Pertinent information about the error.

- **404** Not Found
  - **error** `object` [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) **Required**  
  Pertinent information about the error.

- **409** Conflict
  - **error** `object` [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) **Required**  
  Pertinent information about the error.

- **429** Too Many Requests
  - **error** `object` [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) **Required**  
  Pertinent information about the error.

- **500** Internal Server Error
  - **error** `object` [ErrorDetail](https://docs.mediakind.com/api-reference/infrastructure-api/schemas/errordetail) **Required**  
  Pertinent information about the error.
