Skip to content
Shortcut: /, ⌘K or Ctrl+K

Media

View as Markdown

The media object

Attributes

  • idstringrequired

    Identifier for this resource.

  • sessionstringrequired

    Identifier of the connected Polymorfa session.

  • messageIdstringrequired

    Polymorfa message ID. Use the Polymorfa message's id for actions and replies.

  • mimeTypestringrequired

    IANA media type that matches the media payload.

    • Media type: IANA type/subtype value matching the payload, such as image/jpeg, video/mp4, audio/ogg, or application/pdf

  • fileLengthintegerrequiredmin0

    Size of the media file in bytes.

  • persistedbooleanrequired

    Whether the media or record was stored durably.

  • s3Urlstring

    URL for the s3.

The media object
{
  "id": "string",
  "session": "string",
  "messageId": "string",
  "mimeType": "string",
  "fileLength": 0,
  "persisted": true,
  "s3Url": "string"
}

Create media upload url

POST/platform/media/uploadsPlatform API
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
    • dataanyrequired

      Operation result.

    Show 3 headers
  • 401Missing/invalid credential for this audience.
  • 403Authenticated but lacks the required scope/role/audience.
POST /platform/media/uploadscURL
Not available with the Test key. Use a team key or project token.
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 '{}'
Response
{
  "data": null
}

Get media info

GET/messaging/media/{id}/infoMessaging APILinked Device API
Base URL
https://api.polymorfa.com
Required permission
media:read

Path parameters

  • idstringrequired

    Identifier for this resource.

Responses

  • 200Media info
    • successbooleanrequired

      Whether the request succeeded.

      Allowed valuestrue
    • dataobjectrequired

      Structured 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
GET /messaging/media/{id}/infocURL
Not available with the Test key. Use a team key or project token.
curl "https://api.polymorfa.com/messaging/media/<id>/info" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Polymorfa-Version: 2026-09-22"
Response
{
  "success": true,
  "data": {
    "id": "string",
    "session": "string",
    "messageId": "string",
    "mimeType": "string",
    "fileLength": 0,
    "persisted": true
  }
}

Get media url

GET/platform/media/{mediaId}Platform API
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

  • mediaIdstringrequired

    Identifier for the media.

Responses

  • 200Success
    • dataanyrequired

      Operation result.

    Show 3 headers
  • 401Missing/invalid credential for this audience.
  • 403Authenticated but lacks the required scope/role/audience.
GET /platform/media/{mediaId}cURL
Not available with the Test key. Use a team key or project token.
curl "https://api.polymorfa.com/platform/media/<mediaId>" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Polymorfa-Version: 2026-09-22"
Response
{
  "data": null
}

Download linked media

GET/messaging/media/{id}Messaging APILinked Device API
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

  • idstringrequired

    Identifier for this resource.

Responses

GET /messaging/media/{id}cURL
Not available with the Test key. Use a team key or project token.
curl "https://api.polymorfa.com/messaging/media/<id>" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Polymorfa-Version: 2026-09-22"
Response

No response body

Download and save media

POST/messaging/media/{id}/download-and-saveMessaging APILinked Device API
Base URL
https://api.polymorfa.com
Required permission
media:manage

Path parameters

  • idstringrequired

    Identifier for this resource.

Responses

  • 200Persistence queued or already persisted
    • successbooleanrequired

      Whether the request succeeded.

    • messagestring

      Human-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
POST /messaging/media/{id}/download-and-savecURL
Not available with the Test key. Use a team key or project token.
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"
Response
{
  "success": true
}

Delete stored media

DELETE/platform/media/{mediaId}Platform API
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

  • mediaIdstringrequired

    Identifier for the media.

Responses

  • 200Success
    • dataanyrequired

      Operation result.

    Show 3 headers
  • 401Missing/invalid credential for this audience.
  • 403Authenticated but lacks the required scope/role/audience.
DELETE /platform/media/{mediaId}cURL
Not available with the Test key. Use a team key or project token.
curl -X DELETE "https://api.polymorfa.com/platform/media/<mediaId>" \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Polymorfa-Version: 2026-09-22"
Response
{
  "data": null
}