Retrieves a single attachment from an inbound message, referenced by its attachmentId or zero-based index. By default returns JSON metadata with a short-lived pre-signed download URL; pass download=true to stream the raw attachment bytes with the appropriate Content-Type and Content-Disposition headers.
import requestsurl = "https://api.autosend.com/v1/inbound/messages/60d5ec49f1b2c72d9c8b1234/attachments/att_60d5ec49f1b2c72d9c8b9999"headers = { "Authorization": "Bearer as_your-api-key"}response = requests.get(url, headers=headers)data = response.json()# Follow the pre-signed URL to download the file (no auth header needed).file_url = data["data"]["downloadUrl"]file = requests.get(file_url)with open(data["data"]["filename"], "wb") as f: f.write(file.content)
const response = await fetch( 'https://api.autosend.com/v1/inbound/messages/60d5ec49f1b2c72d9c8b1234/attachments/att_60d5ec49f1b2c72d9c8b9999', { method: 'GET', headers: { 'Authorization': 'Bearer as_your-api-key' } });const { data } = await response.json();// Follow the pre-signed URL to download the file (no auth header needed).const file = await fetch(data.downloadUrl);const blob = await file.blob();// Save or process the blob as needed
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.
import requestsurl = "https://api.autosend.com/v1/inbound/messages/60d5ec49f1b2c72d9c8b1234/attachments/att_60d5ec49f1b2c72d9c8b9999"headers = { "Authorization": "Bearer as_your-api-key"}response = requests.get(url, headers=headers)data = response.json()# Follow the pre-signed URL to download the file (no auth header needed).file_url = data["data"]["downloadUrl"]file = requests.get(file_url)with open(data["data"]["filename"], "wb") as f: f.write(file.content)
const response = await fetch( 'https://api.autosend.com/v1/inbound/messages/60d5ec49f1b2c72d9c8b1234/attachments/att_60d5ec49f1b2c72d9c8b9999', { method: 'GET', headers: { 'Authorization': 'Bearer as_your-api-key' } });const { data } = await response.json();// Follow the pre-signed URL to download the file (no auth header needed).const file = await fetch(data.downloadUrl);const blob = await file.blob();// Save or process the blob as needed
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
Show child attributes
string
Stable identifier for this attachment. Use it as the {idx} path parameter for repeatable references.
string
Original file name of the attachment.
string
MIME type of the attachment (e.g. application/pdf).
integer
Size of the attachment in bytes.
string
Pre-signed URL to download the file. It requires no authentication header and downloads with the correct filename. Treat it as short-lived and single-use; request a fresh one once it expires.
integer
Number of seconds the downloadUrl stays valid. Currently 900 (15 minutes).
Error Responses
object
Returned when id is not valid or idx is neither a non-negative integer nor a valid attachmentId.
import requestsurl = "https://api.autosend.com/v1/inbound/messages/60d5ec49f1b2c72d9c8b1234/attachments/att_60d5ec49f1b2c72d9c8b9999"headers = { "Authorization": "Bearer as_your-api-key"}response = requests.get(url, headers=headers)data = response.json()# Follow the pre-signed URL to download the file (no auth header needed).file_url = data["data"]["downloadUrl"]file = requests.get(file_url)with open(data["data"]["filename"], "wb") as f: f.write(file.content)
const response = await fetch( 'https://api.autosend.com/v1/inbound/messages/60d5ec49f1b2c72d9c8b1234/attachments/att_60d5ec49f1b2c72d9c8b9999', { method: 'GET', headers: { 'Authorization': 'Bearer as_your-api-key' } });const { data } = await response.json();// Follow the pre-signed URL to download the file (no auth header needed).const file = await fetch(data.downloadUrl);const blob = await file.blob();// Save or process the blob as needed