Media Storage API

Media Storage operations

List uploaded media

Returns a list of stored media files.

SecuritybearerAuth
Request
query Parameters
filter[content_type][]
string

Filters files by given content types

Example: filter[content_type][]=application_xml
Responses
200

A response with a list of media resources

Response Schema: application/json
Array of objects (Media Resource)
object (PaginationMeta)
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/media
Request samples
Response samples
application/json
{
  • "data": [
    • {
      • "content_type": "application/xml",
      • "created_at": "2019-01-23T18:10:02.574Z",
      • "expires_at": "2020-01-23T18:10:02.574Z",
      • "media_name": "f5586561-8ff0-4291-a0ac-84fe544797bd",
      • "updated_at": "2019-01-23T18:10:02.574Z"
      }
    ],
  • "meta": {
    • "page_number": 2,
    • "page_size": 25,
    • "total_pages": 3,
    • "total_results": 55
    }
}

Upload media

Upload media file to Telnyx so it can be used with other Telnyx services

SecuritybearerAuth
Request
Request Body schema:
required

Upload media request

media_name
string

The unique identifier of a file.

media_url
required
string

The URL where the media to be stored in Telnyx network is currently hosted. The maximum allowed size is 20 MB.

ttl_secs
integer

The number of seconds after which the media resource will be deleted, defaults to 2 days. The maximum allowed vale is 630720000, which translates to 20 years.

Responses
201

A response describing a media resource

Response Schema: application/json
object (MediaResource)
content_type
string

Content type of the file

created_at
string

ISO 8601 formatted date of when the media resource was created

expires_at
string

ISO 8601 formatted date of when the media resource will expire and be deleted.

media_name
string

Uniquely identifies a media resource.

updated_at
string

ISO 8601 formatted date of when the media resource was last updated

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
post/media
Request samples
{}
Response samples
application/json
{
  • "data": {
    • "content_type": "application/xml",
    • "created_at": "2019-01-23T18:10:02.574Z",
    • "expires_at": "2020-01-23T18:10:02.574Z",
    • "media_name": "f5586561-8ff0-4291-a0ac-84fe544797bd",
    • "updated_at": "2019-01-23T18:10:02.574Z"
    }
}

Deletes stored media

Deletes a stored media file.

SecuritybearerAuth
Request
path Parameters
media_name
required
string

Uniquely identifies a media resource.

Responses
204

The media was deleted successfully.

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
delete/media/{media_name}
Request samples
Response samples
application/json
{
  • "errors": [
    • {
      • "code": "string",
      • "detail": "string",
      • "meta": { },
      • "source": {
        • "parameter": "string",
        • "pointer": "/json/pointer"
        },
      • "title": "string"
      }
    ]
}

Retrieve stored media

Returns the information about a stored media file.

SecuritybearerAuth
Request
path Parameters
media_name
required
string

Uniquely identifies a media resource.

Responses
200

A response describing a media resource

Response Schema: application/json
object (MediaResource)
content_type
string

Content type of the file

created_at
string

ISO 8601 formatted date of when the media resource was created

expires_at
string

ISO 8601 formatted date of when the media resource will expire and be deleted.

media_name
string

Uniquely identifies a media resource.

updated_at
string

ISO 8601 formatted date of when the media resource was last updated

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/media/{media_name}
Request samples
Response samples
application/json
{
  • "data": {
    • "content_type": "application/xml",
    • "created_at": "2019-01-23T18:10:02.574Z",
    • "expires_at": "2020-01-23T18:10:02.574Z",
    • "media_name": "f5586561-8ff0-4291-a0ac-84fe544797bd",
    • "updated_at": "2019-01-23T18:10:02.574Z"
    }
}

Update stored media

Updates a stored media file.

SecuritybearerAuth
Request
path Parameters
media_name
required
string

Uniquely identifies a media resource.

Request Body schema:
required

Update media request

media_url
string

The URL where the media to be stored in Telnyx network is currently hosted. The maximum allowed size is 20 MB.

ttl_secs
integer

The number of seconds after which the media resource will be deleted, defaults to 2 days. The maximum allowed vale is 630720000, which translates to 20 years.

Responses
200

A response describing a media resource

Response Schema: application/json
object (MediaResource)
content_type
string

Content type of the file

created_at
string

ISO 8601 formatted date of when the media resource was created

expires_at
string

ISO 8601 formatted date of when the media resource will expire and be deleted.

media_name
string

Uniquely identifies a media resource.

updated_at
string

ISO 8601 formatted date of when the media resource was last updated

default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
put/media/{media_name}
Request samples
{}
Response samples
application/json
{
  • "data": {
    • "content_type": "application/xml",
    • "created_at": "2019-01-23T18:10:02.574Z",
    • "expires_at": "2020-01-23T18:10:02.574Z",
    • "media_name": "f5586561-8ff0-4291-a0ac-84fe544797bd",
    • "updated_at": "2019-01-23T18:10:02.574Z"
    }
}

Download stored media

Downloads a stored media file.

SecuritybearerAuth
Request
path Parameters
media_name
required
string

Uniquely identifies a media resource.

Responses
200

A response describing a media resource

Response Schema: */*
string <binary>
default

Unexpected error

Response Schema: application/json
Array of objects (Error)
Array
code
required
string <int>
detail
string
meta
object
object
title
required
string
get/media/{media_name}/download
Request samples
Response samples
application/json
{
  • "errors": [
    • {
      • "code": "string",
      • "detail": "string",
      • "meta": { },
      • "source": {
        • "parameter": "string",
        • "pointer": "/json/pointer"
        },
      • "title": "string"
      }
    ]
}