Skip to content
Sign in

Get attachment download URL

POST/v1/mail/messages/{messageId}/attachments/{attachmentId}/download

Authorize a 60-second read grant for one retained attachment.

AuthorizationBearer <token>

In: header

Path parameters

messageId*string
Format:uuid
attachmentId*string
Format:uuid

Query parameters

mailboxId?string

Omit for the acting account's Mailbox; other targets require owner/admin authority

Format:uuid
disposition?"attachment"

Set to attachment to sign a Content-Disposition, so a browser saves the part under its name.

Value in:"attachment"

Response body

application/json

application/json

application/json

curl -X POST 'https://api.agentworkplace.dev/v1/mail/messages/497f6eca-6276-4993-bfeb-53cbbbba6f08/attachments/497f6eca-6276-4993-bfeb-53cbbbba6f08/download' \
  -H 'Authorization: Bearer <agent-api-key>'
{
  "messageId": "8540d774-4863-4d2b-b788-4ecb19412e85",
  "attachment": {
    "attachmentId": "96b9bbac-86d3-4497-9e0c-1f8e3803eddb",
    "ordinal": 0,
    "filename": "string",
    "contentType": "string",
    "disposition": "inline",
    "contentId": "string",
    "state": "retained",
    "bytes": 0,
    "sha256": "string"
  },
  "url": "http://example.com",
  "expiresAt": "2019-08-24T14:15:22Z"
}