Skip to main content
GET
This endpoint uses a standard project API key (AS_ prefix). It returns a single attachment from an inbound message, identified either by its attachmentId (recommended, stable) or by its zero-based index from the message’s attachments array.By default it returns JSON metadata with a short-lived, pre-signed download URL. Pass ?download=true to stream the raw bytes instead, with Content-Type and Content-Disposition: attachment; filename="…" headers.

Authorizations

string | header
required
Project API key header of the form Bearer as_<key>. You can also pass the key via the x-api-key header.

Path Parameters

string
required
The unique identifier of the inbound message. The message must belong to the authenticated project.Example: "60d5ec49f1b2c72d9c8b1234"
string
required
Identifies the attachment. Accepts either the attachment’s attachmentId (recommended, stable across requests, e.g. att_60d5ec49f1b2c72d9c8b9999) or a zero-based index into the message’s attachments array (back-compat, e.g. 0).Example: att_60d5ec49f1b2c72d9c8b9999

Query Parameters

boolean
default:false
Controls the response format.
  • false (default): returns JSON metadata with a short-lived, pre-signed downloadUrl.
  • true: streams the raw attachment bytes with Content-Type and Content-Disposition headers.

Response

Attachment metadata retrieved successfully. With ?download=true, the body is instead the raw binary content and the Content-Type and Content-Disposition response headers describe the file.
boolean
Indicates if the request was successfulExample: true
object
Attachment metadata and download URL

Error Responses

object
Returned when id is not valid or idx is neither a non-negative integer nor a valid attachmentId.
object
Returned when the message does not exist or does not belong to the authenticated project.
object
Returned when no attachment matches the given attachmentId or index.
object
Returned when the message’s raw MIME source is not yet stored (the message may still be processing), so the attachment cannot be produced.
object
Returned when an unexpected error occurs while producing the download URL or streaming the attachment.