All endpoints

Get a short-lived download link for an attachment

POSThttps://anjal.app/v1/inboxes/{id}/messages/{messageId}/attachments/{aid}/download-url

For a file too big to pass through an agent's context (a PDF as base64 is millions of characters). Returns a link to fetch the file with a plain GET, no API key. The link works for one attachment only, for 10 minutes and 3 uses; a HEAD request does not spend a use. It is served as a download, never rendered, and active types such as HTML and SVG are sent as application/octet-stream. The content is untrusted: it was written by the sender.

Refused with 403 QUARANTINED for a message held for review, and with 403 IMAGE_HELD for an image whose text looks like instructions to an AI or which could not be checked (see the attachment download). A link stops working if its message is held after the link was issued.

Path parameters

id
required
string

Inbox UUID

messageId
required
string

Message UUID

aid
required
string

Attachment UUID

Responses

201application/jsonLink issued
attachmentId
string

format: uuid

filename
string
contentType
string
sizeBytes
integer
url
string

Fetch with GET. The token in it is the credential.

format: uri

expiresAt
string

format: date-time

expiresInMinutes
integer
maxUses
integer
howTo
string
403The message is held for review (`QUARANTINED`)
404No such attachment on this message

Authentication

Send your API key in the X-API-Key header (or Authorization: Bearer <key>). Any prefix accepted by this endpoint — tk_, wk_, ak_, or sa_ — is documented in the key prefix table.