Skip to main content
PUT
/
media
/
{media_name}
JavaScript
import Telnyx from 'telnyx';

const client = new Telnyx({
  apiKey: 'My API Key',
});

const media = await client.media.update('media_name');

console.log(media.data);
{
  "data": {
    "media_name": "f5586561-8ff0-4291-a0ac-84fe544797bd",
    "expires_at": "2020-01-23T18:10:02.574Z",
    "created_at": "2019-01-23T18:10:02.574Z",
    "updated_at": "2019-01-23T18:10:02.574Z",
    "content_type": "application/xml"
  }
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

media_name
string
required

Uniquely identifies a media resource.

Body

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.

Example:

"http://www.example.com/audio.mp3"

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.

Example:

86400

Response

A response describing a media resource

data
object
Example:
{
"media_name": "f5586561-8ff0-4291-a0ac-84fe544797bd",
"expires_at": "2020-01-23T18:10:02.574Z",
"created_at": "2019-01-23T18:10:02.574Z",
"updated_at": "2019-01-23T18:10:02.574Z",
"content_type": "application/xml"
}