Media
The media object
Attributes
idstringrequiredIdentifier for this resource.
sessionstringrequiredIdentifier of the connected Polymorfa session.
messageIdstringrequiredPolymorfa message ID. Use the Polymorfa message's
idfor actions and replies.mimeTypestringrequiredIANA media type that matches the media payload.
Media type: IANA
type/subtypevalue matching the payload, such asimage/jpeg,video/mp4,audio/ogg, orapplication/pdf
fileLengthintegerrequiredmin0Size of the media file in bytes.
persistedbooleanrequiredWhether the media or record was stored durably.
s3UrlstringURL for the s3.
{
"id": "string",
"session": "string",
"messageId": "string",
"mimeType": "string",
"fileLength": 0,
"persisted": true,
"s3Url": "string"
}Create media upload url
- Base URL
https://api.polymorfa.com- Required permission
media:manage
Public Management API. Team keys require media:manage. Project tokens are not accepted.
Body
Responses
200Success
dataanyrequiredOperation result.
Show 3 headers
401Missing/invalid credential for this audience.
403Authenticated but lacks the required scope/role/audience.
curl -X POST "https://api.polymorfa.com/platform/media/uploads" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Polymorfa-Version: 2026-09-22" \
-H "Content-Type: application/json" \
-d '{}'{
"data": null
}Get media info
- Base URL
https://api.polymorfa.com- Required permission
media:read
Path parameters
idstringrequiredIdentifier for this resource.
Responses
200Media info
successbooleanrequiredWhether the request succeeded.
Allowed valuestruedataobjectrequiredStructured data carried by this object.
Show 7 child fields
Show 3 headers
400Bad request — request body or params failed validation
401Missing or invalid authentication token
403Authenticated but not permitted (missing scope or rule violation)
404Resource not found
500Internal server error
curl "https://api.polymorfa.com/messaging/media/<id>/info" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Polymorfa-Version: 2026-09-22"{
"success": true,
"data": {
"id": "string",
"session": "string",
"messageId": "string",
"mimeType": "string",
"fileLength": 0,
"persisted": true
}
}Get media url
- Base URL
https://api.polymorfa.com- Required permission
media:read
Public Management API. Team keys require media:read. Project tokens are not accepted.
Path parameters
mediaIdstringrequiredIdentifier for the media.
Responses
200Success
dataanyrequiredOperation result.
Show 3 headers
401Missing/invalid credential for this audience.
403Authenticated but lacks the required scope/role/audience.
curl "https://api.polymorfa.com/platform/media/<mediaId>" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Polymorfa-Version: 2026-09-22"{
"data": null
}Download linked media
- Base URL
https://api.polymorfa.com- Required permission
media:read
A successful request returns the file as a binary stream or a 302 redirect. For a redirect, download the file from the HTTPS URL in the Location header. Do not send your Polymorfa API key or authorization header to that URL.
If a download link expires, request this endpoint again to get a fresh link. Access still requires the media's owning team and, for project credentials, its owning project. A missing or invalid storage configuration returns an error instead of an unusable download location.
Path parameters
idstringrequiredIdentifier for this resource.
Responses
200Media binary stream
Show 3 headers
302Redirect to S3
400Bad request — request body or params failed validation
401Missing or invalid authentication token
403Authenticated but not permitted (missing scope or rule violation)
404Resource not found
500Internal server error
curl "https://api.polymorfa.com/messaging/media/<id>" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Polymorfa-Version: 2026-09-22"No response body
Download and save media
- Base URL
https://api.polymorfa.com- Required permission
media:manage
Path parameters
idstringrequiredIdentifier for this resource.
Responses
200Persistence queued or already persisted
successbooleanrequiredWhether the request succeeded.
messagestringHuman-readable message associated with this result.
Show 3 headers
400Bad request — request body or params failed validation
401Missing or invalid authentication token
403Authenticated but not permitted (missing scope or rule violation)
404Resource not found
500Internal server error
curl -X POST "https://api.polymorfa.com/messaging/media/<id>/download-and-save" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Polymorfa-Version: 2026-09-22"{
"success": true
}Delete stored media
- Base URL
https://api.polymorfa.com- Required permission
media:manage
Public Management API. Team keys require media:manage. Project tokens are not accepted.
Path parameters
mediaIdstringrequiredIdentifier for the media.
Responses
200Success
dataanyrequiredOperation result.
Show 3 headers
401Missing/invalid credential for this audience.
403Authenticated but lacks the required scope/role/audience.
curl -X DELETE "https://api.polymorfa.com/platform/media/<mediaId>" \
-H "Authorization: Bearer YOUR_API_KEY" \
-H "Polymorfa-Version: 2026-09-22"{
"data": null
}