Skip to main content
GET
/
inbound
/
messages
/
{id}
/
attachments
/
{idx}
curl --request GET \
  --url https://api.autosend.com/v1/inbound/messages/60d5ec49f1b2c72d9c8b1234/attachments/0 \
  --header 'Authorization: Bearer as_your-api-key' \
  --output receipt.pdf
<binary attachment content>

Content-Type: application/pdf
Content-Disposition: attachment; filename="receipt.pdf"
This endpoint uses a standard project API key (AS_ prefix). It streams the raw binary content of a single attachment, identified either by its zero-based index from the message’s attachments array or by its attachmentId. Response headers carry Content-Type and Content-Disposition: attachment; filename="…".
curl --request GET \
  --url https://api.autosend.com/v1/inbound/messages/60d5ec49f1b2c72d9c8b1234/attachments/0 \
  --header 'Authorization: Bearer as_your-api-key' \
  --output receipt.pdf
<binary attachment content>

Content-Type: application/pdf
Content-Disposition: attachment; filename="receipt.pdf"

Authorizations

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

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

Response

Attachment streamed successfully. The body is the raw binary content; the Content-Type and Content-Disposition response headers describe the file.

Error Responses

400 - Invalid parameters
object
Returned when id is not valid or idx is neither a non-negative integer nor a valid attachmentId.
{
  "success": false,
  "error": {
      "message": "Invalid value",
    }
  
}
404 - Message not found
object
Returned when the message does not exist or does not belong to the authenticated project.
{
  "success": false,
  "error": {
    "message": "Inbound email not found"
  }
}
404 - Attachment not found
object
Returned when no attachment exists at the given index.
{
  "success": false,
  "error": {
    "message": "Attachment not found"
  }
}