# List Live Events

> Media API · Live Events

```http
GET https://app.mk.io/api/v1/projects/{project_name}/media/liveEvents
```

## Listing, Sorting and Filtering Live Events

This endpoint returns the list of live events in the specified project.

### Sorting

The results from this endpoint can be ordered using the `$orderby` query parameter. Specify a list of field names, separated by commas
where each one can optionally specify `asc` or `desc`.

Sorting is valid on the following fields: `created`, `createdBy`, `id`, `name`, `properties/created`, `properties/description`, `properties/encoding/encodingType`, `properties/lastModified`, `properties/resourceState`, `updated`, `updatedBy`

### Filtering

There are two ways to filter the set of returned live events from this endpoint - the first is to use the `$filter` query parameter, the second is to use the
`$label_key` and `$label` query parameters.

The `$filter` query parameter allows for live events to be filtered on the basis of fields in the schema using OData query syntax.
See [this document](https://learn.microsoft.com/en-us/odata/concepts/queryoptions-overview#filter) for more details on the syntax used.

Filters are valid on the following fields: `created`, `createdBy`, `createdByEmail`, `createdByName`, `id`, `name`, `properties/created`, `properties/description`, `properties/encoding/encodingType`, `properties/lastModified`, `properties/resourceState`, `updated`, `updatedBy`, `updatedByEmail`, `updatedByName`

`$label_key` and `$label` are specific to querying live events based on their labels. Labels are a set of key-value pairs that can be used to identify live events with
any arbitrary metadata you want, specifically for the purpose of retrieving relevant subsets of live events.

### Examples:

`?$top=10` - Returns only the first 10 live events from the list.

`?$orderby=name desc` - Sorts live events by name in descending order.

`?$filter=name eq 'descriptive name'` - Returns live events that match the provided name.

`?$orderby=created desc` - Sorts live events by creation date in descending order.

`?$filter=created ge 2021-01-01T00:00:00Z` - Returns live events created after January 1, 2021.

`?$filter=properties/resourceState eq 'Running'` - Returns live events in the Running state.

`?$label=studio=paravalley` - Returns live events with the label `studio` set to `paravalley`.

`?$label=release-date~2023` - Returns live events with the label `release-date` set to a value that contains `2023`.

`?$label_key=studio&label_key=release-date` - Returns live events with any value set for the `studio` label and the `release-date` label.

RBAC Capability Required: `ams.liveevent.get`

## Authentication

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

## Path parameters

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

## Query parameters

| Name | Type | Required | Description |
| --- | --- | --- | --- |
| `$label_key` | string | No | Filters the set to the specified label key. If multiple $label_keys are specified, matching items must have all labels. |
| `$label` | string | No | Filters the set to the specified label key/value pair. Supports equality, inequality, and inexact matching. If multiple values are provided for the same key, items matching either value will be returned. |
| `$orderby` | string | No | Specifies the key by which the result collection should be ordered. |
| `$filter` | string | No | Restricts the set of items returned. |
| `$top` | string | No | Specifies a non-negative integer `n` that limits the number of items returned from a collection. The service returns the number of available items up to but not greater than the specified value `n`. |
| `$skiptoken` | string | No | Specifies a start offset to support paginated results. Use `@odata.nextLink` in the result object to enumerate the collection - it will be present only if there's more than one page of entities. |

## Example request

```bash
curl -X GET "https://app.mk.io/api/v1/projects/{project_name}/media/liveEvents" \
  -H "Authorization: Bearer <token>"
```

## Responses

### 200 — A list of live events

- `@odata.nextLink` · string · Optional — @odata.nextLink URL if the page length and number of items match.
- `supplemental` · object · **Required** — Supplemental info
  - `count` · integer · **Required** — Number of items returned
  - `kind` · string · **Required** — Type of items in the list
  - `operation` · string · **Required** — Operation type. Should always say 'list'
  - `pagination` · object · **Required** — Pagination info
    - `end` · integer · **Required** — Position of the last item in the list
    - `records` · integer · **Required** — Total number of items returned in the list
    - `start` · integer · **Required** — Position of the first item in the list
    - `total` · integer · **Required** — Total number of items in the project
  - `subscription` · object · Optional — Project info
    - `id` · string · **Required** — Project ID
    - `name` · string · **Required** — Project name
- `value` · list of objects · **Required** — A list of live events.
  - Array items (object):
    - `location` · string · Optional — Deprecated field. This field cannot be modified, only set during creation.
    - `name` · string · Optional · _2-32 characters_ · _pattern: ^[a-zA-Z0-9]+(-*[a-zA-Z0-9])*$_ — The name of the resource
    - `properties` · object · **Required** — The properties of the live event.
      - `created` · string · Optional — The time when the live event was created.
      - `crossSiteAccessPolicies` · object · Optional — The configuration for cross-site access policies. This includes the XML content of the client access policy and cross-domain policy files. This field cannot be modified, only set during creation.
        - `clientAccessPolicy` · string or null · Optional — The XML content of the client access policy file. Search 'clientaccesspolicy.xml' to learn more.
        - `crossDomainPolicy` · string or null · Optional — The XML content of the cross-domain policy file. Search 'crossdomain.xml' to learn more.
      - `description` · string · Optional · _0-4096 characters_ — An optional description for the live event. This field cannot be modified, only set during creation.
      - `encoding` · object · **Required** — The encoding configuration for the live event. This includes settings like encoding type and preset name. This field cannot be modified, only set during creation.
        - `encodingType` · enum · **Required** — Live event type. When encodingType is set to PassthroughBasic or PassthroughStandard, the service simply passes through the incoming video and audio layer(s) to the output. When encodingType is set to Standard or Premium1080p, a live encoder transcodes the incoming stream into multiple bitrates or layers
          - Allowed values: `None`, `PassthroughBasic`, `PassthroughStandard`, `Premium1080p`, `Standard`
        - `keyFrameInterval` · string · Optional · _Defaults to PT2S_ — Use an ISO 8601 time value between 1 and 10 seconds to specify the output fragment length for the video and audio tracks of an encoding live event. For example, use PT2S to indicate 2 seconds. For the video track it also defines the key frame interval, or the length of a GoP (group of pictures). If this value is not set for an encoding live event, the fragment duration defaults to 2 seconds. The value cannot be set for pass-through live events.
        - `presetName` · string · Optional — Defaults to either Default720p or Default1080p depending on encoding type. May be used to specify alternative encoding templates - contact support for assistance if your needs are complex.
        - `stretchMode` · enum · Optional — Determines how aspect ratio will be preserved when there is a mismatch between the input and output aspect ratios. Autofit to pad the output. Autosize to ignore the output ratio and pick the largest dimension that fits, and None to clip the content.
          - Allowed values: `None`, `AutoSize`, `AutoFit`
      - `hostnamePrefix` · string · Optional — Applied when useStaticHostname=true to specify the first part of the hostname for all input and preview addresses. This field cannot be modified, only set during creation.
      - `input` · object · **Required** — The configuration for the input of the live event. This includes settings like key frame interval duration, streaming protocol, access token, and endpoints. This field cannot be modified, only set during creation.
        - `accessControl` · object · **Required** — Access control for live event input.
          - `ip` · object · **Required** — The IP access control for the live event inputs.
            - `allow` · list of objects · **Required** — The IP ranges that will be allowed to access the preview. If empty, all IPs will be allowed.
              - Array items (object):
                - `address` · string · **Required** — The IP address or DNS with port or protocol
                - `name` · string · **Required** · _1-32 characters_ — The name of the IP range. This is for your reference only. examples: 'everyone', 'dave's house', 'corp vpn'.
                - `subnetPrefixLength` · integer · **Required** · _0 to 32_ — The subnet prefix length (see CIDR notation).
        - `accessToken` · string · **Required** · _10-79 characters_ — For RTMP, a UUID in string form to uniquely identify the stream. For SRT, an arbitrary string of between 10 and 79 characters, used as the passphrase. This can be specified at creation time but cannot be updated. If omitted or null, the service will generate a unique value.
        - `endpoints` · list of objects · Optional — Populated server-side. The input endpoints for the live event.
          - Array items (object):
            - `protocol` · string · Optional — The streaming protocol for the endpoint. Possible values include: 'SRT', 'RTMP'.
            - `url` · string · Optional — The IP address or DNS with port and protocol
        - `keyFrameIntervalDuration` · string · **Required** — ISO 8601 time duration of the key frame interval duration of the input. This value sets the EXT-X-TARGETDURATION property in the HLS output. For example, use PT2S to indicate 2 seconds. Leave the value empty for encoding live events.
        - `streamingProtocol` · enum · Optional · _Defaults to RTMP_ — The input protocol for the live event. This is specified at creation time and cannot be updated.
          - Allowed values: `RTMP`, `RTMPS`, `SRT`
        - `timedMetadataEndpoints` · list of objects · **Required** — The metadata endpoints for the live event.
          - Array items (object):
            - `url` · string · **Required**
      - `lastModified` · string · Optional — The last time the live event was modified.
      - `pipeline` · object · Optional — Not currently supported. AI pipeline settings
        - `arguments` · map from strings to list of objects · Optional — Arguments to each operation in the AI pipeline
          - `[any key]` · list of objects — map of additional properties
            - Array items (object):
              - `name` · string · **Required** · _1-260 characters_ · _pattern: ^[A-Za-z0-9_-]+$_ — The name of the argument
              - `value` · any · **Required** — The value of the argument
        - `name` · string · **Required** · _0-255 characters_ — The name of the AI pipeline the Transform will execute.
      - `preview` · object · Optional — The configuration for the preview of the live event. This includes settings like preview locator, streaming policy name, access control, and endpoints. This field cannot be modified, only set during creation.
        - `accessControl` · object · Optional — Address-based ACLs for access to the preview.
          - `ip` · object · **Required** — The IP access control for the preview endpoint. Determines who will be able to access preview content.
            - `allow` · list of objects · **Required** — The IP ranges that will be allowed to access the preview. If empty, all IPs will be allowed.
              - Array items (object):
                - `address` · string · **Required** — The IP address or DNS with port or protocol
                - `name` · string · **Required** · _1-32 characters_ — The name of the IP range. This is for your reference only. examples: 'everyone', 'dave's house', 'corp vpn'.
                - `subnetPrefixLength` · integer · **Required** · _0 to 32_ — The subnet prefix length (see CIDR notation).
        - `alternativeMediaId` · string · Optional — Not currently supported. Will be used to support DRM license acquisition for preview content.
        - `endpoints` · list of objects · Optional — Populated server-side. The endpoints that are used for previewing the live event.
          - Array items (object):
            - `protocol` · string · Optional — The streaming protocol for the endpoint. Possible values include: 'SRT', 'RTMP'.
            - `url` · string · Optional — The IP address or DNS with port and protocol
        - `previewLocator` · string · Optional · _format: uuid_ — The ID of the locator for the preview. This is automatically generated when the live event is created, and removed when the live Event is deleted. The caller may specify a locator GUID, in which case the caller must ensure that the GUID is unique and not already used by another resource.
        - `streamingPolicyName` · string · Optional · _<=260 characters_ · _Defaults to Predefined_ClearStreamingOnly_ — The name of the DRM streaming policy for the live event preview. Defaults to Predefined_ClearStreamingOnly and no other value is presently supported.
      - `provisioningState` · string · Optional — The current provisioning state of the resource. One of 'InProgress', 'Succeeded', or 'Failed'
      - `resourceState` · enum · Optional — The current state of the resource. One of 'Stopped', 'Starting', 'Running', 'Stopping', or 'Deleting'.
        - Allowed values: `Stopped`, `Starting`, `Running`, `Stopping`, `Deleting`
      - `streamOptions` · list of strings · **Required** — A list of streaming options for the live event. One of 'Default' or 'LowLatency'. Only one value permitted in the list. This field cannot be modified, only set during creation.
        - Array items (string):
      - `transcriptions` · list of items · Optional — Not currently supported. Transcription settings for the live event. This field cannot be modified, only set during creation.
        - Array items (any):
      - `useStaticHostname` · boolean · **Required** — A boolean value that indicates whether a static hostname is assigned to input and preview endpoints. If not set, will default to 'false' and IP addresses will be provided. This field cannot be modified, only set during creation.
    - `tags` · map from strings to string · **Required** — A dictionary of tags associated with the live event. Maximum number of tags: 16. Maximum length of a tag: 64 characters. For the purposes of the `$label_key` and `$label` queries this field will be checked. This field cannot be modified, only set during creation.
      - `[any key]` · string — map of additional properties

Example:

```json
{
  "@odata.nextLink": "string",
  "supplemental": {
    "count": 0,
    "kind": "string",
    "operation": "string",
    "pagination": {
      "end": 0,
      "records": 0,
      "start": 0,
      "total": 0
    },
    "subscription": {
      "id": "string",
      "name": "string"
    }
  },
  "value": [
    {
      "location": "string",
      "name": "name",
      "properties": {
        "created": "string",
        "crossSiteAccessPolicies": {
          "clientAccessPolicy": "string",
          "crossDomainPolicy": "string"
        },
        "description": "string",
        "encoding": {
          "encodingType": "None",
          "keyFrameInterval": "PT2S",
          "presetName": "string",
          "stretchMode": "None"
        },
        "hostnamePrefix": "string",
        "input": {
          "accessControl": {
            "ip": {
              "allow": [
                {
                  "address": "string",
                  "name": "string",
                  "subnetPrefixLength": 0
                }
              ]
            }
          },
          "accessToken": "string",
          "endpoints": [
            {
              "protocol": "string",
              "url": "string"
            }
          ],
          "keyFrameIntervalDuration": "string",
          "streamingProtocol": "RTMP",
          "timedMetadataEndpoints": [
            {
              "url": "string"
            }
          ]
        },
        "lastModified": "string",
        "pipeline": {
          "arguments": {
            "operation1": [
              {
                "name": "language",
                "value": "en-US"
              }
            ],
            "operation2": [
              {
                "name": "length",
                "value": "3.7m"
              }
            ]
          },
          "name": "string"
        },
        "preview": {
          "accessControl": {
            "ip": {
              "allow": [
                {
                  "address": "string",
                  "name": "string",
                  "subnetPrefixLength": 0
                }
              ]
            }
          },
          "alternativeMediaId": "string",
          "endpoints": [
            {
              "protocol": "string",
              "url": "string"
            }
          ],
          "previewLocator": "00000000-0000-0000-0000-000000000000",
          "streamingPolicyName": "Predefined_ClearStreamingOnly"
        },
        "provisioningState": "string",
        "resourceState": "Stopped",
        "streamOptions": [
          "string"
        ],
        "transcriptions": [
          null
        ],
        "useStaticHostname": true
      },
      "tags": {
        "key": "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
}
```

### 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: `[get]_/api/v1/projects/{project_name}/media/liveEvents`
