Skip to main content
List the attachment metadata for a message. The bytes are never inlined — download each file with an authenticated GET on its url. GET /v1/emails/{id}/attachments Works for both directions: for an inbound message the attachments are parsed from the received MIME; for an outbound message they’re the files you sent. Each entry includes a url you fetch with your bearer token to stream the bytes.

Path parameters

id
string
required
The message id.

Request

# List metadata
curl https://api.drin.run/v1/emails/msg_01HZX9K3T2QF7P0M4N8B6C5D/attachments \
  -H "Authorization: Bearer $DRIN_API_KEY"

# Download the bytes — authenticate the GET on each url
curl -L -o invoice.pdf \
  "https://api.drin.run/v1/emails/msg_01HZX9K3T2QF7P0M4N8B6C5D/attachments/att_01HZX7" \
  -H "Authorization: Bearer $DRIN_API_KEY"

Response

200 OK — a data array of attachment metadata. The array is empty when the message has no attachments.
200 OK
{
  "data": [
    {
      "id": "att_01HZX7M9P2",
      "filename": "invoice.pdf",
      "contentType": "application/pdf",
      "size": 48213,
      "url": "https://api.drin.run/v1/emails/msg_01HZX9K3T2QF7P0M4N8B6C5D/attachments/att_01HZX7M9P2"
    }
  ]
}

Fields

id
string
The attachment identifier.
filename
string
The file name.
contentType
string
The MIME type, e.g. application/pdf.
size
integer
The size in bytes.
url
string
The authenticated download URL. GET it with your Authorization: Bearer header to stream the bytes.
The url needs your key. The download url isn’t a public link — it requires the same Authorization: Bearer header as every other request. Don’t hand it to a browser or embed it where the key would leak.