Create media processor

POST /v1/MediaProcessors

A MediaProcessor resource provides the ability to capture content from a web application with a Twilio Media Extension to create a livestream.

Body

  • The maximum time, in seconds, that the MediaProcessor can run before automatically ends. The default value is 300 seconds, and the maximum value is 90000 seconds. Once this maximum duration is reached, Twilio will end the MediaProcessor, regardless of whether media is still streaming.

  • StatusCallback string(uri)

    The URL to which Twilio will send asynchronous webhook requests for every MediaProcessor event. See Status Callbacks for details.

  • Extension string Required

    The Media Extension name or URL. Ex: video-composer-v1

  • ExtensionContext string Required

    The context of the Media Extension, represented as a JSON dictionary. See the documentation for the specific Media Extension you are using for more information about the context to send.

  • User-defined environment variables for the Media Extension, represented as a JSON dictionary of key/value strings. See the documentation for the specific Media Extension you are using for more information about whether you need to provide this.

  • StatusCallbackMethod string(http-method)

    The HTTP method Twilio should use to call the status_callback URL. Can be POST or GET and the default is POST.

    Values are HEAD, GET, POST, PATCH, PUT, or DELETE.

Responses

  • Created

    Hide response attributes Show response attributes object
    • account_sid string | null

      The SID of the Account that created the resource

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^AC[0-9a-fA-F]{32}$.

    • date_created string(date-time) | null

      The ISO 8601 date and time in GMT when the resource was created

    • date_updated string(date-time) | null

      The ISO 8601 date and time in GMT when the resource was last updated

    • ended_reason string | null

      The reason why a MediaProcessor ended

    • extension string | null

      The Media Extension name or URL

    • extension_context string | null

      The Media Extension context

    • max_duration integer | null

      Maximum MediaProcessor duration in seconds

    • sid string | null

      The unique string that identifies the resource

      Minimum length is 34, maximum length is 34. Format should match the following pattern: ^ZX[0-9a-fA-F]{32}$.

    • status string | null

      The status of the MediaProcessor

      Values are failed, started, or ended.

    • status_callback string(uri) | null

      The URL to which Twilio will send MediaProcessor event updates

    • status_callback_method string(http-method) | null

      The HTTP method Twilio should use to call the status_callback URL

      Values are HEAD, GET, POST, PATCH, PUT, or DELETE.

    • url string(uri) | null

      The absolute URL of the resource

POST /v1/MediaProcessors
curl \
 -X POST https://media.twilio.com/v1/MediaProcessors \
 --user "username:password" \
 -H "Content-Type: application/x-www-form-urlencoded" \
 -d 'Extension=string&ExtensionContext=string&MaxDuration=42&StatusCallback=https%3A%2F%2Fexample.com&StatusCallbackMethod=HEAD'
Request example
{
  "Extension": "string",
  "ExtensionContext": "string",
  "MaxDuration": 42,
  "StatusCallback": "https://example.com",
  "StatusCallbackMethod": "HEAD"
}
Request examples
{
  "MaxDuration": 42,
  "StatusCallback": "https://example.com",
  "Extension": "string",
  "ExtensionContext": "string",
  "StatusCallbackMethod": "HEAD"
}
Response examples (201)
{
  "account_sid": "string",
  "date_created": "2023-05-04T09:42:00+00:00",
  "date_updated": "2023-05-04T09:42:00+00:00",
  "ended_reason": "string",
  "extension": "string",
  "extension_context": "string",
  "max_duration": 42,
  "sid": "string",
  "status": "failed",
  "status_callback": "https://example.com",
  "status_callback_method": "HEAD",
  "url": "https://example.com"
}
Response examples (201)
{
  "account_sid": "string",
  "date_created": "2024-05-04T09:42:00+00:00",
  "date_updated": "2024-05-04T09:42:00+00:00",
  "ended_reason": "string",
  "extension": "string",
  "extension_context": "string",
  "max_duration": 42,
  "sid": "string",
  "status": "failed",
  "status_callback": "https://example.com",
  "status_callback_method": "HEAD",
  "url": "https://example.com"
}