Skip to content

Media

GET /v1/accounts/{a}/jobs/{id}

Show the state of a media or send job.

Scope: any valid token

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringJob ID.

POST /v1/accounts/{a}/jobs/{id}/cancel

Ask a media or send job to stop.

Scope: any valid token

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringJob ID.

POST /v1/accounts/{a}/jobs/{id}/retry

Retry a failed job from the start. The body is optional and cannot ask to reuse a finished upload.

Scope: any valid token

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringJob ID.

Request body: NativeMediaJobRetryRequest

POST /v1/accounts/{a}/jobs/{id}/retry-completed-upload

Retry a send job but reuse the upload that already finished. The body must set reuseCompletedUpload to true.

Scope: send

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringJob ID.

Request body: NativeMediaJobRetryRequest

POST /v1/accounts/{a}/media-writeback/repair

Start repairing saved media records from bytes the daemon already holds. It never resends or downloads.

Scope: media

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.

Request body: NativeMediaWritebackRequest

POST /v1/accounts/{a}/media/lookup

List the media of up to 40 messages in one request, without downloading anything.

Scope: media

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.

Request body: NativeMediaBatchRequest

GET /v1/accounts/{a}/media/{id}

Show one media asset and whether its bytes are available.

Scope: media

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringMedia asset ID.

GET /v1/accounts/{a}/media/{id}/content

Get the cached bytes of a media asset. It supports Range and If-None-Match, and never starts a download.

Scope: media

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringMedia asset ID.
representationqueryContentRepresentationThe file itself or its preview. Defaults to the original.

GET /v1/accounts/{a}/messages/{id}/card-avatar

Get the avatar picture for a saved contact-card message, proxying and caching the advertised avatar URL when not stored locally.

Scope: media

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringMessage ID.

GET /v1/accounts/{a}/messages/{id}/image

Get a saved image message at the requested quality.

Scope: media

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringMessage ID.
qualityquerystring, nullablebest (the default), original, standard or thumbnail.

GET /v1/accounts/{a}/messages/{id}/media

List the media attached to a message and whether each file is available.

Scope: media

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringMessage ID.

POST /v1/accounts/{a}/messages/{id}/media-transfers

Start downloading one media file of a message. Poll the returned job.

Scope: media

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringMessage ID.

Request body: MediaTransferRequest

POST /v1/accounts/{a}/uploads

Stage the bytes of one file as a media source that a later send can use.

Scope: send

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.

Request body: multipart/form-data

FieldTypeDescription
file (required)stringThe file to stage. Send exactly one part named file.

DELETE /v1/accounts/{a}/uploads/{id}

Delete an upload you have finished with, such as the source of an added sticker. Returns released: false when it is already gone; an upload a pending send or preparation needs is kept (409 upload_in_use).

Scope: send

ParameterInTypeDescription
a (required)pathstringAccount ID or alias.
id (required)pathstringUpload source ID.

Response: NativeUploadRelease

Types

ContentRepresentation

Which bytes of a media asset to return.

ValueDescription
”original”The file itself.
”preview”The saved preview of the file.

MediaTransferRequest

Request to download an attachment of a message.

FieldTypeDescription
assetIdstring, nullableID of the specific attachment to download. When null, the daemon picks the attachment that matches quality.
messageId (required)stringID of the message to download from. It must match the message ID in the URL.
qualityMediaVariantWhich copy to download. The default is best.

MediaVariant

Which copy of an attachment, or which quality to request. For a request, best picks the best copy available.

ValueDescription
”best”The best copy available. It downloads one when none is cached. Only valid in a request.
”thumbnail”A small preview copy.
”standard”The standard-size copy of an image.
”original”The original copy as offered by the sender, which can be smaller than the sender’s own source.
”normal”The ordinary playback copy of a video, or the playable audio of a voice note.
”encoded”A voice note in its original encoded form.

NativeMediaBatchRequest

Messages whose attachments to list without downloading anything.

FieldTypeDescription
messageIds (required)array of stringIDs of the messages to look up, from 1 to 40 per request.

NativeMediaJobRetryRequest

Options for retrying a media job.

FieldTypeDescription
reuseCompletedUploadboolean, nullableTrue to reuse the upload a send job already finished instead of uploading again. The retry-completed-upload route requires true here.

NativeMediaWritebackRequest

Request to repair saved media records from bytes the daemon already holds. It never downloads or sends anything.

FieldTypeDescription
limit (required)integerHow many saved media records to repair in this request, from 1 to 100.

NativeUploadRelease

Result of deleting an upload.

FieldTypeDescription
released (required)booleanTrue when this request deleted the upload; false when it was already gone.