Upload media
POST/media
Upload media file to Telnyx so it can be used with other Telnyx services
Request
- application/json
- multipart/form-data
Body
required
Upload media request
The URL where the media to be stored in Telnyx network is currently hosted. The maximum allowed size is 20 MB.
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.
The unique identifier of a file.
Body
required
Upload media request
The file you want to upload. The maximum allowed size is 20 MB.
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.
The unique identifier of a file.
Responses
201: A response describing a media resource
- application/json
default: Unexpected error
- application/json
Request samples
curl -L 'https://api.telnyx.com/v2/media' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-H 'Authorization: Bearer <TOKEN>' \
-d '{
"media_url": "http://www.example.com/audio.mp3",
"ttl_secs": 86400,
"media_name": "my-file"
}'
Response samples
{
"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"
}
}
{
"errors": [
{
"code": "string",
"title": "string",
"detail": "string",
"source": {
"pointer": "string",
"parameter": "string"
},
"meta": {}
}
]
}