M2A Live (v4)

Download OpenAPI specification:Download

M2A Media: ta@m2amedia.tv URL: https://www.m2amedia.tv License: MIT

Overview

The M2A Live service provides an API for creating and managing encoding resources that run in AWS, as part of a live streaming video workflow. In this version, the following resources are supported:

  • Encoders An encoder resource represents the encoding of a single logical input stream into one or more output renditions that may be distributed to one or more destinations of the same type. Encoders must be created within an M2A Cloud Target Account which has been set up for your Organisation. Each encoder is associated with a specific AWS region. If multi-region resiliency is required multiple encoders are defined in different AWS regions.
  • Standalone Inputs A standalone input is a long-lived MediaLive input resource that persists independently of any encoder. Standalone inputs are used when static IP addresses are required for push-type inputs (RTP, RTMP). They can be attached to and detached from channels as needed, but must be managed separately from the encoders that reference them.

Encoder types

New in version v4 Every encoder runs on one of two encoder types. The JSON:API type of the resource says which:

type Encoder type
medialive An AWS Elemental MediaLive channel
titan-live An Ateme TITAN Live channel, on an instance M2A runs in your account

Every request that creates an encoder must name its type. The type is fixed when the encoder is created and cannot be changed afterwards. One account may own encoders of both types, so a list of encoders can hold both: read type before reading attributes, because the attributes and settings differ by type. An encoder's id is unique across both types, so /encoders/{encoder-id} finds an encoder without knowing its type. GET /encoders returns encoders of both types in one list, unless filter[type] asks for one. Both types use the same states and the same model of a template, a list of inputs and a list of destinations, described under Configuring Encoders.

What each encoder type supports

Capability medialive titan-live
Input types M2A_CONNECT, MEDIACONNECT, MP4_FILE, AWS_CDI, RTP_PUSH, RTMP_PULL, RTMP_PUSH, SRT_CALLER, STANDALONE M2A_CONNECT, RTP_PUSH, SRT_CALLER, SRT_LISTENER, RTMP_PUSH, RTMP_PULL, HLS_PULL
Input from an M2A Connect source (M2A_CONNECT) Supported; MEDIACONNECT with connect-source-ids does the same Supported
Input from an AWS Elemental MediaConnect flow (MEDIACONNECT with flow-arns) Supported Not supported
Standalone inputs (/inputs) Supported Not supported
Failing over between inputs Supported Supported
Output group types MediaPackageGroupSettings, MsSmoothGroupSettings, HlsGroupSettings, ArchiveGroupSettings, RtmpGroupSettings, UdpGroupSettings, M2aConnectUdpGroupSettings, MultiplexGroupSettings, CmafIngestGroupSettings, SrtCallerGroupSettings, SrtListenerGroupSettings M2aPackagerGroupSettings, CmafIngestGroupSettings, DashGroupSettings, HlsGroupSettings, UdpGroupSettings, M2aConnectUdpGroupSettings, SrtCallerGroupSettings, SrtListenerGroupSettings, RtmpGroupSettings
Publishing to an M2A packager Supported, as MediaPackageGroupSettings with packager-id Supported, as M2aPackagerGroupSettings
Two pipelines (STANDARD channel class) Supported Not supported
One CMAF ingest output group pushing to two endpoints Supported Not supported
Passwords and passphrases named where you hold them Supported Supported
Passwords and passphrases given in plain text for M2A to keep Not supported Supported
Signing in to an HTTP origin (CMAF ingest, DASH, HLS) Supported Not supported
Lifecycle actions All START, STOP and DELETE
Scheduled actions, including schedule-actions at start Supported Not supported
Slate Supported Not supported
Motion graphics Supported Not supported
A/B watermarking Supported Not supported
Thumbnails (include=thumb-urls) Supported Not supported
auto-fix-destinations and state-callback Supported Supported

How the encoder types behave differently

Network placement. A MediaLive encoder takes its network settings from its template and from each input's own settings. A TITAN Live encoder takes one settings.network for the whole channel: the subnet its instance is placed in and the security groups that decide who may reach it. See Network and ports on a TITAN Live encoder. Listening ports. Where a MediaLive input listens, AWS assigns the port. Wherever a TITAN Live encoder listens, you choose the port. Regions. A MediaLive encoder may be created in any region enabled for live workflows. A TITAN Live encoder may be created in any region in which the target account has been set up for TITAN Live encoders. Failing over between inputs. A MediaLive encoder fails over as its template's automatic input failover settings say. A TITAN Live encoder takes up to eight inputs of one kind, in priority order, and moves to the next when the one in use stops; it does not return to the primary. Its inputs list describes how long a switch takes for each kind. When the template is checked. Creating an encoder of either type checks that the account has the template and that it is written for that encoder type. A TITAN Live encoder also renders its template then, so a template that cannot build its channel is rejected at once. A MediaLive encoder renders its template only when it starts. Lifecycle. On both types, START is accepted only from INITIAL, STOP only from RUNNING, and STOP ends the encoder (END), so a stopped encoder cannot be started again. An encoder of either type that was never started is removed with DELETE from INITIAL, which leaves it DELETED at once. A TITAN Live encoder takes only START, STOP and DELETE, and DELETE only from INITIAL. The other lifecycle actions are on MediaLive encoders only. medialive-input-role-arn. Required on a MediaLive encoder, and not accepted on a TITAN Live encoder.

Rejected requests

Every endpoint rejects a request by the same rule, whatever the encoder type:

Status Code Why the request is rejected
400 Bad Request M2A_REQUEST_MALFORMED The request could not be read, for example a body that is not JSON
403 Forbidden M2A_AUTH_INSUFFICIENT_SCOPE The caller may not do this
404 Not Found M2A_RESOURCE_NOT_FOUND The resource does not exist, or the caller's organisation does not own it
409 Conflict M2A_RESOURCE_CONFLICT The resource is not in a state that allows this, for example an action from the wrong encoder state, or a slate action the encoder's slate rules out (starting a slate while one is playing, or switching or stopping one when none is)
422 Unprocessable Entity M2A_REQUEST_VALIDATION_FAILED A field or parameter is missing, not allowed or out of range; an input or output group type the encoder type does not have; a template the account does not have, or one written for the other encoder type; a template that cannot build a TITAN Live encoder's channel; two TITAN Live destinations taking the same template output; or an M2A resource the encoder names that cannot be used
422 Unprocessable Entity M2A_REQUEST_UNSUPPORTED_FOR_ENCODER_TYPE The encoder's type does not have the action asked for
502 Bad Gateway M2A_INTEGRATION_UPSTREAM_FAILED A service the request depends on failed, or the target account is not set up for TITAN Live encoders in the region

Each failure is described by JSON:API error objects in errors, each with its status, code, title and detail, and, for a field or parameter at fault, source.pointer or source.parameter naming it. A failure of M2A or of a service it depends on is described in general terms only. The encoders, templates and thumbnails endpoints also keep their original error and messages members beside errors, for callers written before errors was added.

Configuring Encoders

New in version v4 An encoder is defined by three core components: a template, a list of inputs, and a list of destinations. The template describes the channel's encoding; the inputs and destinations say where its content comes from and goes to, and are written into the rendered template.

Templates

Each encoder references a named Jinja2 channel template stored in the M2A template service. The template defines the encoding profile — output groups, video/audio codec settings, input structure, and timecode configuration. It is rendered to produce the channel's configuration: an AWS MediaLive channel for a medialive encoder, a TITAN Live service for a titan-live encoder. Use template-configuration to supply per-encoder overrides for any Jinja2 variables (macros) declared in the template. For example, audio PIDs, language codes, or stream-specific bitrate values that differ between encoders that share the same template. Keys must match variable names defined in the template; unrecognised keys are ignored. A template is written for one encoder type. A TITAN Live encoder renders its template when it is created, and rejects a template written for MediaLive with 422 Unprocessable Entity. A MediaLive encoder renders its template only when it starts, so a template written for TITAN Live fails that start instead.

Output group types

An output group type names the format the channel produces, or the M2A resource it publishes to. On a TITAN Live encoder an M2A-managed packager takes M2aPackagerGroupSettings, named by its packager-id; a Unified Streaming origin, or any other CMAF ingest origin, takes CmafIngestGroupSettings, named by its url.

Matching destinations to template outputs

Each destination is matched to an output group of the rendered template, and for some types to one output in that group. On a MediaLive encoder, a destination takes the output group of its output-group-type whose name is its name, or the first output group of that type when it has no name. RTMP, UDP and SRT destinations take the output named by output-name. On a TITAN Live encoder, outputs are matched by position unless the template names them. A TITAN Live service has no names of its own for its output groups and outputs, so to match by name you add the keys a MediaLive channel uses: Name on an output group and OutputName on an output, for example "Name": "hls-main". M2A removes both keys before the channel is configured. A destination with a name takes the output group whose Name is that name; a destination with no name takes the next output group, in the template's order, that no other destination takes or names. Within the group, a destination with an output-name takes the output whose OutputName is that name; one with no output-name takes the group's next output that no other destination has taken. A template exported from TITAN Live, with neither key added, is matched entirely by position. On both types, an output group that no destination takes is removed when auto-fix-destinations is true. When it is false, the default, the request is rejected (on a MediaLive encoder, channel creation fails). On a TITAN Live encoder, outputs that no destination takes are always removed.

TITAN Live templates

A titan-live encoder's template (service TITAN_LIVE_CHANNEL) renders a TITAN Live service. The template owns the encoding and packaging; the encoder owns where media comes from and goes to. When the channel is built:

  • The service's input is generated from the encoder's inputs: its type, sources, Redundancy (SMPTE 2022-7 for several inputs, none for one) and ActiveInputIndex (0) replace whatever the template renders. Any other setting the template gives its input is kept. - Each destination's address and credentials replace those the template gives the output it takes. Failover between inputs follows the template's input loss settings. The template authoring guide says how to set them.

    Inputs

    On a MediaLive encoder, the template defines a fixed number of InputAttachments. Each input you provide in the inputs array is mapped positionally into the corresponding attachment slot in the rendered template — the first input maps to the first attachment, the second to the second, and so on. The number of inputs provided must not exceed the number of attachment slots in the template. Most single-pipeline templates expect one input. Templates designed for automatic input failover expect two: the primary input first, followed by the secondary. The secondary input is automatically wired into the failover settings on the primary attachment. On a TITAN Live encoder, the order of the inputs is their failover priority: the first is the primary source, and each one after it a backup.

    Destinations

    Destinations define where encoded media is sent. Each destination in the destinations array is matched independently to an output of the rendered template, as described under Matching destinations to template outputs. Destination properties fall into two logical categories, which may be mixed freely within the same destinations array:

Explicit properties supply the raw target directly:

  • url — the ingest endpoint for HLS, MS Smooth, RTMP, Archive, UDP, CMAF Ingest, and Multiplex output groups.
  • channel-id — a raw AWS MediaPackage channel ID.

M2A resource properties supply an M2A platform identifier that is resolved to the underlying AWS resource or network endpoint at channel creation time:

  • packager-id — an M2A-managed MediaPackage packager. On a MediaLive encoder, on a MediaPackageGroupSettings destination, it is resolved to the packager's MediaPackage channel ID, and is mutually exclusive with channel-id; if both are supplied, packager-id takes precedence and channel-id is ignored. On a TITAN Live encoder, on an M2aPackagerGroupSettings destination, it is resolved to the packager's ingest endpoint, which the destination reports as resolved-url once the encoder has started.
  • connect-source-id — an M2A Connect source, resolved to the endpoint it ingests on.

Network and ports on a TITAN Live encoder

A TITAN Live encoder runs one pipeline, on one instance. Its settings.network gives the one subnet in your VPC that M2A places the instance in, and the security groups for the channel. Inputs and destinations use the instance's private address, so the security groups must let your senders and receivers reach it. Wherever a TITAN Live encoder listens — RTP_PUSH, SRT_LISTENER and RTMP_PUSH inputs, and SrtListenerGroupSettings destinations — you choose the port, as port, from 1 to 65535. Each needs a port of its own: an encoder where two of them listen on one port is rejected with 422 Unprocessable Entity. An RTP_PUSH input with fec on also listens on its port plus 2 and plus 4, so nothing else may use those, and its port may be at most 65531. An M2A_CONNECT input's port is not on the channel: it is the port M2A Connect opens its listener on, on the source's vpc-interface-name. It is from 1024 to 65535, and may not be 2077 or 2088, which Connect keeps. Some addresses are known only once the encoder has started, and are reported read-only while it is RUNNING or STOPPING:

  • address, on each input and destination that listens: the address a sender or receiver connects to, as {ip}:{port}. - listener-url, on an M2A_CONNECT input: the SRT listener M2A opened on the M2A Connect source, which the channel connects to. - resolved-url, on an M2aPackagerGroupSettings destination: the ingest endpoint the packager resolves to. - url, on an M2aConnectUdpGroupSettings destination: the endpoint the M2A Connect source ingests on. - settings.compute: the instance the channel runs on, its Availability Zone, subnet and IP addresses. Creating a TITAN Live encoder checks that its template can build a channel for its inputs and destinations, and that the M2A Connect sources and packagers they name can be used. It keeps each password and passphrase given in plain text, and sets up nothing else. The rest is set up when the encoder starts; a start that fails says why in the error-detail of its START action.

Standard (dual pipeline) channels

This section applies to MediaLive encoders. A TITAN Live encoder runs one pipeline. The MediaLive channel class is set by the template, not by the request. A template with ChannelClass: STANDARD creates a channel with two pipelines that run in different availability zones; any other template creates a SINGLE_PIPELINE channel. A STANDARD channel needs every input and destination to provide an endpoint for each pipeline:

  • Inputs must have two sources, e.g. two connect-source-ids for M2A_CONNECT, two flow-arns for MEDIACONNECT, two sources for MP4_FILE and RTMP_PULL, two input-destinations for RTMP_PUSH, or two srt-caller-settings for SRT_CALLER. MediaLive does not attach a single-source input to a STANDARD channel.
  • URL destinations (HLS, MS Smooth, RTMP, Archive, UDP, CMAF Ingest, Multiplex) must include a pipeline-1 object with the pipeline 1 url and, if needed, its own username and ssm-password. The top-level url is used for pipeline 0. For RTMP the same stream-name is used on both pipelines.
  • SRT Caller destinations must include pipeline-1.url and SRT Listener destinations must include pipeline-1.port. If pipeline-1.passphrase-arn or pipeline-1.stream-id are omitted, pipeline 1 uses the pipeline 0 values.
  • MediaPackage destinations need no pipeline-1; a single packager or channel serves both pipelines.

The channel class is only known once the template is rendered, so these rules are checked at channel creation time, not when the encoder is submitted. An encoder whose STANDARD channel destination lacks the required pipeline-1 details is accepted, but its channel creation fails. The following are not yet supported on STANDARD channels and fail channel creation the same way: M2aConnectUdpGroupSettings destinations, and MS Smooth watermarking-b-variant-url. For SINGLE_PIPELINE templates, pipeline-1 is ignored.

API Structure:

The API is modelled on JSONAPI (https://jsonapi.org/format/). Where possible related resources are modelled as Relationships. ie: - a specific account owner (one to one relationship) - mediainputs (one to many relationship) - enrolments (one to many relationship) Owner can be only of type target-account.

HTTP Headers:

The following headers are required for all requests - json { 'Accept': 'application/vnd.api+json', 'Content-Type': 'application/vnd.api+json' }

encoders

Encoder CRUD API

Submit a new encoder definition

An encoder represents the specification of the source content, the encoding profile and the destination(s) the encoded content is to be delivered to. A 'success' HTTP status code merely means that the definition has been persisted. An encoder must be started and stopped by the client application based on the required schedule. To apply actions automatically when the encoder first starts, set schedule-actions in the encoder settings block. Actions are submitted individually, in list order, on the start that follows creation, once the encoder reaches RUNNING. They are not re-submitted on any later start. Stopping or restarting the encoder ends every action still pending or on air, because MediaLive clears its own schedule on stop, so a subsequent start finds nothing left to submit. To re-apply an action after a stop or restart, submit it again via POST /encoders/{encoder-id}/actions. motion-graphics-activate, motion-graphics-deactivate, static-image-activate and static-image-deactivate are implemented; any other settings.type fails schema validation and returns 422. Set to null to remove. A relationships.owner pointing at the target account is mandatory. The type of the resource selects which encoder backs it — medialive or titan-live — and determines which attributes and settings apply. The Encoder types section of the overview lists what each encoder type supports, and the status a request is rejected with.

Authorizations:
http_security_schema
header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Content-Type
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

The original media type of the resource.

Request Body schema: application/vnd.api+json
required
any (Data Element)

JSONAPI data element.

The type selects which encoder backs the resource — medialive for an AWS Elemental MediaLive channel, titan-live for an Ateme TITAN Live channel — and determines which attributes apply. It is fixed at creation: an existing encoder cannot be moved between encoder types.

Every request that creates an encoder names its type; one that does not, or names another, is rejected with 422 Unprocessable Entity.

Responses

Callbacks

Request samples

Content type
application/vnd.api+json
Example
{
  • "data": {
    }
}

Response samples

Content type
application/vnd.api+json
Example
{
  • "data": {
    }
}

Callback payload samples

Callback
POST: Invoke state transition webhook
Content type
application/vnd.api+json
{
  • "state": "IN_PROGRESS",
  • "id": "03ac6692-84b9-11ea-b791-5ff49275eb0b"
}

List encoders

Returns a cursor-paginated list of encoders owned by the specified target account. Results are returned in an unspecified but stable order; use page[cursor] from the previous response's links.next to retrieve subsequent pages.

include is not accepted when listing encoders and is rejected with 422; related resources are returned only by GET /encoders/{encoder-id}.

filter[type] lists the encoders of one encoder type only.

A page[cursor] that was not returned in a previous response's links.next, or has been altered, is rejected with 422, naming page[cursor] under messages.query.

Authorizations:
http_security_schema
query Parameters
owner
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: owner=03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the Target Account

filter[type]
string
Enum: "medialive" "titan-live"
Example: filter[type]=titan-live

List only the encoders of this type. Each page still holds page[limit] encoders while more of the type remain, and the links.next URL keeps the filter.

page[cursor]
string

Opaque cursor returned in the previous response's links.next. Pass this value to retrieve the next page of results.

page[limit]
integer [ 1 .. 100 ]
Default: 20

Maximum number of resources to return per page, from 1 to 100. A value outside that range is rejected with 422 on GET /encoders and with 400 on the other lists.

header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Responses

Response samples

Content type
application/vnd.api+json
{
  • "data": [
    ],
  • "links": {
    }
}

Get encoder by ID

Gets an encoder by its ID.

Pass include=thumb-urls to have the encoder's thumbnail URLs returned in the top-level included array.

Pass include=current-overlays to have the overlay images currently on air returned in the top-level included array, one per layer, and identified in data.relationships.current-overlays. An overlay is on air once its static-image-activate action has taken effect, until a later activate or deactivate on the same layer takes effect or the encoder stops. An overlay scheduled for a fixed time can take a few seconds to be returned after that time. An overlay given a duration is still returned after that duration has elapsed. Overlays scheduled for later, and attempts that failed, are not returned. An overlay set from the catalogue carries the material's ID and name, including material that has since been withdrawn; one set from a URI carries the URI as supplied. When the catalogue cannot be reached or does not respond in time, or the material no longer exists, the material's ID is still returned, without its name. A titan-live encoder puts no overlays on air, so it has no current-overlays relationship and nothing is added to included.

An overlay set from the catalogue also carries media, a link to the material's full-size file. When no link can be created, the overlay is returned without media. It also carries media-info, the file's size, dimensions and when it last changed, as found when the catalogue read it. Material whose file was never read, or whose media information cannot be read, is returned without media-info. When the catalogue cannot be reached or does not respond in time, or the material no longer exists, neither media nor media-info is returned.

For a titan-live encoder, include is accepted but ignored: no included array is returned.

Authorizations:
http_security_schema
path Parameters
encoder-id
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: 03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the encoder

query Parameters
owner
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: owner=03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the Target Account

include
Array of strings
Items Enum: "thumb-urls" "current-overlays"

Related resources to return in the top-level included array. thumb-urls returns the encoder's thumbnail URLs; current-overlays returns the overlay images currently on air. Repeat the parameter to ask for both, e.g. include=thumb-urls&include=current-overlays. Any other value is rejected with 422.

header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Responses

Response samples

Content type
application/vnd.api+json
Example
{
  • "data": {
    }
}

inputs

Standalone MediaLive Input CRUD API

Create a new standalone input

Creates a long-lived MediaLive input that persists independently of channels. Use standalone inputs when static IP addresses are required for push-type inputs (RTP, RTMP).

Authorizations:
http_security_schema
header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Content-Type
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

The original media type of the resource.

Request Body schema: application/vnd.api+json
required
object (Data Element)

JSONAPI data element

Responses

Request samples

Content type
application/vnd.api+json
Example
{
  • "data": {
    }
}

Response samples

Content type
application/vnd.api+json
Example
{
  • "data": {
    }
}

List standalone inputs

Lists standalone inputs for the specified owner.

Authorizations:
http_security_schema
query Parameters
owner
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: owner=03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the Target Account

page[cursor]
string

Opaque cursor returned in the previous response's links.next. Pass this value to retrieve the next page of results.

page[limit]
integer [ 1 .. 100 ]
Default: 20

Maximum number of resources to return per page, from 1 to 100. A value outside that range is rejected with 422 on GET /encoders and with 400 on the other lists.

header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Responses

Response samples

Content type
application/vnd.api+json
{
  • "data": [
    ],
  • "links": {
    }
}

Get standalone input by ID

Gets a standalone input by its ID

Authorizations:
http_security_schema
path Parameters
input-id
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: 03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the standalone input

query Parameters
owner
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: owner=03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the Target Account

header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Responses

Response samples

Content type
application/vnd.api+json
Example
{
  • "data": {
    }
}

Update a standalone input

Updates a standalone input. All attributes are optional for partial update. When an If-Match header is supplied, the update is rejected with 412 Precondition Failed if the resource has been modified since the ETag was obtained.

Immutable fields: The input type, region, and all network settings are fixed at creation and cannot be changed.

Pipeline mode: The number of items in array fields (sources, flow-arns, connect-source-ids, srt-caller-settings) cannot be changed. MediaLive pipeline mode — single (1 item) or standard/dual (2 items) — is determined at creation and is immutable.

No-op detection: If the request attributes are identical to the current state of the resource, the server returns 304 Not Modified with the current ETag header and performs no update.

State requirements: The input must be in READY provisioning-state. The input must also be in DETACHED attachment-state; requests that violate these constraints are rejected with 409 Conflict.

Authorizations:
http_security_schema
path Parameters
input-id
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: 03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the standalone input

query Parameters
owner
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: owner=03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the Target Account

header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

If-Match
string

ETag value from a previous GET response. Used for optimistic concurrency control.

Content-Type
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

The original media type of the resource.

Request Body schema: application/vnd.api+json
required
object (Data Element)

JSONAPI data element

Responses

Request samples

Content type
application/vnd.api+json
Example
{
  • "data": {
    }
}

Response samples

Content type
application/vnd.api+json
Example
{
  • "data": {
    }
}

Delete a standalone input

Deletes a standalone input. The input must be detached from all channels and be in READY or FAILED provisioning state before deletion. When an If-Match header is supplied, the delete is rejected with 412 Precondition Failed if the resource has been modified since the ETag was obtained.

Authorizations:
http_security_schema
path Parameters
input-id
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: 03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the standalone input

query Parameters
owner
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: owner=03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the Target Account

header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

If-Match
string

ETag value from a previous GET response. Used for optimistic concurrency control.

Responses

Response samples

Content type
application/vnd.api+json
{
  • "errors": [
    ]
}

actions

Submit and manage control actions for encoders. The action-type field determines the behaviour and which schema applies.


Scheduled actions

Scheduled actions (SCHEDULED) allow dynamic, real-time changes to a live encoder without stopping the stream — graphics and static-image overlays.

The encoder must be in IDLE or RUNNING state. The settings.type field identifies the action; settings.timing controls when it fires.

Timing types (settings.timing.type):

  • immediate — as soon as possible after submission.
  • fixed — at a specific wall-clock time. Requires settings.timing.time.

follow timing is defined in the schemas but is not accepted on any endpoint; submitting it returns 422.

Status for scheduled actions uses ScheduleActionStatus: PENDING → ACTIVE → INACTIVE for overlays, PENDING → FIRED for one-shot actions, PENDING → CANCELLED, or PENDING → FAILED. A stop moves PENDING and ACTIVE actions to INACTIVE, except a one-shot action already sent to MediaLive and due, which becomes FIRED. Other statuses are left as they are. end-reason and ended-at say how and when an action stopped being in effect, or why it never took effect.

Retention: a scheduled action is kept for 90 days after it finished: from ended-at once it has one, from effective-at for FIRED and FAILED actions, and, for a PENDING action added while the encoder was running, from its scheduled time, or the time it was added for immediate timing. An ACTIVE action does not expire. Nor does a PENDING action added while the encoder was not running, until it takes effect, is rejected or ends. Deleting the encoder does not change when an action that had already finished expires. An expired action is removed within a few days, and is then no longer returned anywhere.

Implemented: motion-graphics-activate, motion-graphics-deactivate, static-image-activate, static-image-deactivate. All other scheduled action types have schemas defined but are not accepted — submitting one fails schema validation and returns 422.

Startup scheduled actions: Encoders can be configured with schedule-actions (in the encoder settings). These are submitted automatically on the start that follows creation, once the encoder reaches RUNNING, and are not re-submitted on any later start — a stop or restart ends any that are still pending or on air. The resulting action records, except those with status CANCELLED or DELETED, are returned in the encoder response under schedule-actions.

To cancel a scheduled action before it fires, use DELETE /encoders/{encoder-id}/actions/{action-id}. Only PENDING actions that have not yet taken effect can be cancelled. Cancelled actions are kept, with status CANCELLED.


Slate actions

Slate actions replace the encoder's live output with a pre-configured slate (fallback) clip. Use slating to fill airtime during source failures, ad breaks, or planned pauses without stopping the encoder.

All slate actions require the encoder to be RUNNING. The sequence for managing a slate is:

Action Purpose
PREPARE_SLATE Pre-loads the slate input. Requires material-id.
START_SLATE Switches output to the slate. Requires material-id.
SWITCH_SLATE Switches to a different slate while one is active. Requires material-id.
STOP_SLATE Restores live output, ending the active slate.
DELETE_FIXED_SLATE Cancels a fixed-time slate that has not yet fired.

Use slate-action-type: FIXED with slate-datetime on START_SLATE or SWITCH_SLATE to schedule the transition at a specific wall-clock time rather than immediately.


Lifecycle actions

Lifecycle actions transition the encoder between states (START, STOP, RESTART, PAUSE, RESUME, etc.). Each action is processed asynchronously. The response status field (ACTIVE, COMPLETE, FAILED) reflects the outcome.

Submit an action to multiple encoders

Submits an action to multiple encoders simultaneously. All encoders receive the same action. action-type determines which schema applies.

Currently supported action types: SCHEDULED.

Validation: All encoders are validated upfront. If any encoder fails validation the entire request returns 409 and no records are created.

Returns 207 Multi-Status with one action record per encoder. Each record starts as PENDING. If AWS later rejects an action, its status transitions to FAILED with an error-detail explaining why.

Authorizations:
http_security_schema
header Parameters
Content-Type
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

The original media type of the resource.

Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Request Body schema: application/vnd.api+json
required
object

Responses

Request samples

Content type
application/vnd.api+json
{
  • "data": {
    }
}

Response samples

Content type
application/vnd.api+json
{
  • "data": [
    ]
}

List actions for an encoder

Returns the actions for an encoder. Use page[cursor] for pagination.

By default the order is not chronological. To list what has happened on an encoder, most recent first, use filter[history]=true. To list what is scheduled to happen next, soonest first, use filter[upcoming]=true.

Cancelled actions are returned with status CANCELLED. Actions with status DELETED are also returned: they were cancelled, or their encoder was deleted, before CANCELLED was introduced.

Authorizations:
http_security_schema
path Parameters
encoder-id
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: 03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the encoder

query Parameters
owner
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: owner=03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the Target Account

page[cursor]
string

Opaque cursor returned in the previous response's links.next. Pass this value to retrieve the next page of results.

page[limit]
integer [ 1 .. 100 ]
Default: 20

Maximum number of resources to return per page, from 1 to 100. A value outside that range is rejected with 422 on GET /encoders and with 400 on the other lists.

filter[action-type]
string (Encoder Action Type)
Enum: "START" "STOP" "RESTART" "START_PAUSED" "PAUSE" "RESUME" "CONFIGURE" "DELETE" "END" "PREPARE_SLATE" "START_SLATE" "SWITCH_SLATE" "STOP_SLATE" "DELETE_FIXED_SLATE" "SCHEDULED"

Filter results by action type. A single value only — comma-separated lists are not supported and are rejected with 422.

filter[status]
string
Enum: "PENDING" "ACTIVE" "INACTIVE" "FIRED" "CANCELLED" "FAILED" "DELETED" "COMPLETE"

Filter results by action status. A single value only — comma-separated lists are not supported and are rejected with 422. Valid values cover both lifecycle/slate statuses (ACTIVE, COMPLETE, FAILED) and scheduled action statuses (PENDING, ACTIVE, INACTIVE, FIRED, CANCELLED, FAILED, DELETED).

filter[history]
boolean
Value: true

When true, returns the encoder's SCHEDULED actions whose outcome is settled, ordered by effective-at, most recent first. This includes actions that took effect, and actions that were rejected or cancelled, or discarded when the encoder stopped, including those of an encoder that has since been deleted. Actions with status DELETED are included. Paging through the history neither skips nor repeats an action that was already listed when you started. An action that settles while you page can be recorded a few seconds in the past, so it may only appear when you start again from the first page.

end-reason and ended-at say how and when an action stopped being in effect. Whether an action took effect follows from its submitted-at, status and end-reason. The description of effective-at gives the full rule, including for actions recorded before end-reason was introduced, which need submitted-at and effective-at instead.

Excluded: lifecycle and slate actions, fixed actions whose scheduled time has not yet arrived, and actions waiting for the encoder to start.

A fixed action whose scheduled time has just passed can be listed with status: PENDING for about 10 seconds, until its status is updated. Its effective-at is already correct.

Only true is supported; false is rejected with 422. Cannot be combined with filter[status], filter[action-type] or filter[upcoming]; doing so is rejected with 422.

filter[upcoming]
boolean
Value: true

When true, returns the encoder's fixed SCHEDULED actions due after the time of the request and before filter[due-before], ordered by effective-at, soonest first. Each action's effective-at is the time it is due.

The time of the request is when the API starts handling it, before the list is read. An action that falls due in between is still returned, with an effective-at that has passed.

Paging through the list neither skips nor repeats an action that was upcoming when you started and is still upcoming. An action scheduled while you page may only appear when you start again from the first page. links.next keeps the window end of the first page, so the window does not move while you page. An action whose time passes while you page is no longer upcoming and is not returned on later pages. Once the window has closed, a later page is an empty list.

An action scheduled on an encoder that is not running is included. It is sent to MediaLive when the encoder starts, and takes effect only if the encoder is running by its scheduled time. An action without submitted-at has not been sent yet: it is waiting for the encoder to start, and will not take effect if the encoder is not running by its scheduled time.

Excluded: lifecycle and slate actions, cancelled actions, immediate actions (including ones waiting for the encoder to start), and actions that have already taken effect or were rejected or discarded when the channel stopped. If the channel stops other than through this API, its actions can remain listed.

No total is returned. When more actions are due in the window than fit on one page, links.next is set.

Only true is supported; false is rejected with 422. Cannot be combined with filter[status], filter[action-type] or filter[history]; doing so is rejected with 422.

filter[due-before]
string <date-time>
Example: filter[due-before]=2026-03-20T22:00:00Z

The end of the filter[upcoming] window: actions due at or after this time are not returned. A date-time with a time zone, such as 2026-03-20T22:00:00Z. On the first page, defaults to 12 hours after the time of the request. Required with page[cursor]: links.next always carries the window end of the first page.

Rejected with 422 if it has no time zone, if filter[upcoming]=true is not also set, if it is missing with page[cursor], or if it is more than 24 hours after the time of the request. Without page[cursor], also rejected with 422 if it is not after the time of the request. With page[cursor], a time that has already passed is accepted: the page continues the window of the first page, which may have closed.

header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Responses

Response samples

Content type
application/vnd.api+json
Example
{
  • "data": [
    ],
  • "links": {
    }
}

Submit an encoder action

Submits a lifecycle, slate, or scheduled action for an encoder. The action-type field in the request body determines which schema applies and how the action is processed.


Lifecycle actions — transition the encoder between states. Processed asynchronously. status starts as ACTIVE and transitions to COMPLETE or FAILED.

Action Valid from state
START INITIAL
STOP RUNNING
RESTART RUNNING
START_PAUSED INITIAL
PAUSE RUNNING
RESUME PAUSED
CONFIGURE PAUSED
DELETE INITIAL, IDLE, FAILED, PAUSED
END STARTING, STARTING_PAUSE, CREATING, CREATING_PAUSE, IDLE, PAUSED, RESTARTING

DELETE from INITIAL leaves the encoder DELETED at once. From the other states the encoder goes to STOPPING first.

STOP ends the encoder (END), so a stopped encoder cannot be started again. To stop a MediaLive encoder's output and start it again later, use PAUSE and RESUME.


Slate actions — control slate output on a running encoder (V4 only). Require material-id except for STOP_SLATE and DELETE_FIXED_SLATE. Use slate-action-type: FIXED with slate-datetime to fire at a specific time. status starts as ACTIVE and transitions to COMPLETE or FAILED.


Scheduled actions (SCHEDULED) — submit a runtime-controlled action directly to the encoder's MediaLive schedule (graphics and static-image overlays).

  • The encoder must be in IDLE or RUNNING state. Submitting a SCHEDULED action when the encoder is in any other state returns 409 Conflict.
  • settings.type identifies the action — one of motion-graphics-activate, motion-graphics-deactivate, static-image-activate, static-image-deactivate. Any other value is rejected with 422.
  • settings.timing controls when it fires — immediate or fixed only. follow timing is not supported here and is rejected with 422.
  • Returns 201 Created immediately. status starts as PENDING and transitions based on the action type — see ScheduleActionStatus.
  • The 201 body omits password and submitted-at. Fetch the action by ID to retrieve the password. For fixed timing it includes effective-at, the scheduled time.

To cancel a SCHEDULED action before it fires, use DELETE /encoders/{encoder-id}/actions/{action-id}. Only actions in PENDING status that have not yet taken effect can be cancelled.


Encoder type support. Everything above applies to medialive encoders. A titan-live encoder takes only START, from INITIAL; STOP, from RUNNING; and DELETE, from INITIAL. As on a medialive encoder, STOP ends the encoder (END), so it cannot be started again, and DELETE from INITIAL leaves the encoder DELETED and the action COMPLETE at once. One of these actions from any other state is rejected with 409 Conflict. Any other action on a titan-live encoder is rejected with 422 Unprocessable Entity and the code M2A_REQUEST_UNSUPPORTED_FOR_ENCODER_TYPE.

Authorizations:
http_security_schema
path Parameters
encoder-id
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: 03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the encoder

query Parameters
owner
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: owner=03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the Target Account

header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Content-Type
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

The original media type of the resource.

Request Body schema: application/vnd.api+json
required
object

Responses

Request samples

Content type
application/vnd.api+json
Example
{
  • "data": {
    }
}

Response samples

Content type
application/vnd.api+json
Example
{
  • "data": {
    }
}

Get an action

Returns a single action record by its ID.

This is the only endpoint that echoes back a SCHEDULED action's password; it is resolved from m2a-secret on each request. The ETag returned here is the value to send as If-Match on a subsequent DELETE.

Actions are returned whatever their status, including CANCELLED and DELETED. A CANCELLED or DELETED action is returned without its password, and so is an action whose encoder has been deleted once its password is no longer stored.

Authorizations:
http_security_schema
path Parameters
encoder-id
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: 03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the encoder

action-id
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: 03ac6692-84b9-11ea-b791-5ff49275eb0b

The unique ID of a scheduled action. Returned in the 207 Multi-Status response body when the action was submitted.

query Parameters
owner
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: owner=03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the Target Account

header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

Responses

Response samples

Content type
application/vnd.api+json
Example
{
  • "data": {
    }
}

Cancel a pending scheduled action

Cancels a SCHEDULED action that has not yet fired. Only actions with status: PENDING can be cancelled — attempting to cancel an action in any other status (ACTIVE, FIRED, INACTIVE, FAILED, DELETED) returns 409 Conflict. Cancelling an action that is already CANCELLED changes nothing and returns 204, whatever its If-Match header, so a cancel can be retried safely.

A fixed action already sent to MediaLive (submitted-at is present) whose scheduled time has passed cannot be cancelled either, and returns 409 Conflict: it has taken effect, although its status can still show PENDING for about 10 seconds. To take an overlay off air, submit the matching deactivate action. When an If-Match header is supplied, the cancel of an action not yet cancelled is rejected with 412 Precondition Failed if the resource has been modified since the ETag was obtained.

The action is kept with status CANCELLED, end-reason: CANCELLED and ended-at set to the time of the cancel, and any password secret held for it is released. It is still returned by GET, in the list and in the history, but no longer in the owning encoder's settings.schedule-actions. It expires 90 days after the cancel (see Retention under Scheduled actions).

Once an action has fired it cannot be undone via this endpoint.

Caveat: an action sent to MediaLive, or being sent when it is cancelled, can still air after it is cancelled.

Note: Only SCHEDULED action types are supported. Attempting to cancel a lifecycle or slate action returns 409 Conflict.

Authorizations:
http_security_schema
path Parameters
encoder-id
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: 03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the encoder

action-id
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: 03ac6692-84b9-11ea-b791-5ff49275eb0b

The unique ID of a scheduled action. Returned in the 207 Multi-Status response body when the action was submitted.

query Parameters
owner
required
string (Resource Identifier) ^[a-zA-Z0-9_-]{8,36}$
Example: owner=03ac6692-84b9-11ea-b791-5ff49275eb0b

The ID of the Target Account

header Parameters
Accept
required
string (JsonAPIMediaType)
Value: "application/vnd.api+json"

Content type (expressed as MIME types) the client is able to understand.

If-Match
string

ETag value from a previous GET response. Used for optimistic concurrency control.

Responses

Response samples

Content type
application/vnd.api+json
{
  • "errors": [
    ]
}