# Create

> Media API · Live Outputs

```http
PUT https://app.mk.io/api/v1/projects/{project_name}/media/liveEvents/{event_name}/liveOutputs/{output_name}
```

Creates a Live Output

RBAC Capability Required: `ams.liveeventoutput.create`

## Authentication

- `Authorization` header — Bearer authentication of the form `Bearer <token>`.

## Path parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `project_name` | string | Yes | — |
| `event_name` | string | Yes | — |
| `output_name` | string | Yes | — |

## Request body

Content type: `application/json`

- `properties` · object · **Required** — The properties of the live output.
  - `archiveWindowLength` · string · **Required** — ISO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content.
  - `assetName` · string · **Required** · _1-260 characters_ — The name of the asset that the live output will write to.
  - `description` · string · Optional · _0-4096 characters_ — The description of the live output.
  - `hls` · object · Optional — The HLS configuration.
    - `fragmentsPerTsSegment` · integer · Optional · _1 to 100000000_ · _Defaults to 1_ — The number of fragments per HLS segment.
  - `manifestName` · string · Optional · _1-64 characters_ · _pattern: ^[a-zA-Z0-9\-]+[a-zA-Z0-9]$_ — The name of the manifest file. If not provided, the service will generate one automatically. This is the filename that will appear in playback URLs.
  - `outputSnapTime` · integer · Optional · _Defaults to 0_ — Not supported. The output snapshot time. This is the wall clock time, in unix epoch seconds, that the live output will begin recording from.
  - `rewindWindowLength` · string · Optional — Not supported. ISO 8601 timespan duration of the rewind window length during live playback. This is the amount of time that the live output will be able to rewind.

## Example request

```bash
curl -X PUT "https://app.mk.io/api/v1/projects/{project_name}/media/liveEvents/{event_name}/liveOutputs/{output_name}" \
  -H "Authorization: Bearer <token>" \
  -H "Content-Type: application/json" \
  -d '{
  "properties": {
    "archiveWindowLength": "string",
    "assetName": "string",
    "description": "string",
    "hls": {
      "fragmentsPerTsSegment": 1
    },
    "manifestName": "name",
    "outputSnapTime": 0,
    "rewindWindowLength": "string"
  }
}'
```

## Responses

### 201 — Live Output created

- `name` · string · Optional · _1-256 characters_ · _pattern: ^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$_ — The name of the resource
- `properties` · object · **Required** — The properties of the live output.
  - `archiveWindowLength` · string · **Required** — ISO 8601 timespan duration of the archive window length. This is duration that customer want to retain the recorded content.
  - `assetName` · string · **Required** · _1-260 characters_ — The name of the asset that the live output will write to.
  - `created` · string · Optional — The exact time the live output was created.
  - `description` · string · Optional · _0-4096 characters_ — The description of the live output.
  - `hls` · object · Optional — The HLS configuration.
    - `fragmentsPerTsSegment` · integer · Optional · _1 to 100000000_ · _Defaults to 1_ — The number of fragments per HLS segment.
  - `lastModified` · string · Optional — The exact time the live output was last modified.
  - `manifestName` · string · Optional · _1-64 characters_ · _pattern: ^[a-zA-Z0-9\-]+[a-zA-Z0-9]$_ — The name of the manifest file. If not provided, the service will generate one automatically. This is the filename that will appear in playback URLs.
  - `outputSnapTime` · integer · Optional · _Defaults to 0_ — Not supported. The output snapshot time. This is the wall clock time, in unix epoch seconds, that the live output will begin recording from.
  - `provisioningState` · string · Optional — The provisioning state of the live output.
  - `resourceState` · enum · Optional — The resource state of the live output.
    - Allowed values: `Creating`, `Deleting`, `Running`
  - `rewindWindowLength` · string · Optional — Not supported. ISO 8601 timespan duration of the rewind window length during live playback. This is the amount of time that the live output will be able to rewind.

Example:

```json
{
  "name": "name",
  "properties": {
    "archiveWindowLength": "string",
    "assetName": "string",
    "created": "string",
    "description": "string",
    "hls": {
      "fragmentsPerTsSegment": 1
    },
    "lastModified": "string",
    "manifestName": "name",
    "outputSnapTime": 0,
    "provisioningState": "string",
    "resourceState": "Creating",
    "rewindWindowLength": "string"
  }
}
```

### 400 — Bad Request

- `error` · object · **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.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 401 — Unauthorized

- `error` · object · **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.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 403 — Forbidden

- `error` · object · **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.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 404 — Not Found

- `error` · object · **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.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 409 — Conflict

- `error` · object · **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.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 429 — Too Many Requests

- `error` · object · **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.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

### 500 — Internal Server Error

- `error` · object · **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.
    - `[any key]` · any — map of additional properties
- `ref` · string · **Required** — A reference to the request that caused the error.
- `status` · integer · **Required** — The HTTP status code

Example:

```json
{
  "error": {
    "code": "string",
    "detail": "string",
    "extraDetail": {
      "key": null
    }
  },
  "ref": "string",
  "status": 0
}
```

---

Source spec: `media-api` · operationId: `[put]_/api/v1/projects/{project_name}/media/liveEvents/{event_name}/liveOutputs/{output_name}`
