API referenceMessages

Get attachment metadata

Returns metadata for one email attachment by attachmentId — its filename, contentType, sizeBytes, contentId, disposition, and createdAt, plus the messageId it belongs to.

Endpoint
GET https://api.dairo.app/v1/attachments/{attachmentId}

Returns metadata for one email attachment by attachmentId — its filename, contentType, sizeBytes, contentId, disposition, and createdAt, plus the messageId it belongs to. This endpoint returns metadata only, never the bytes or a URL: fetch a short-lived download link from the /url or /link sub-resource, or stream the raw bytes from /download. attachmentId is the UUID exposed as a message's attachments[].id; a malformed id returns 400 and an attachment your key can't reach returns 404. As the owner you can read metadata whether or not the file has finished its security scan, but a file the scan has flagged as unsafe is withheld with 403. Requires the messages:read scope; see handling untrusted attachments.

Scope: messages:read. Send the API key as a bearer token; Scopes lists what each one reaches.

Request

cURL
curl "https://api.dairo.app/v1/attachments/3fa85f64-5717-4562-b3fc-2c963f66afa6" \
  -H "Authorization: Bearer $DAIRO_API_KEY"

Path parameters

NameTypeRequiredDescription
attachmentIdstringyesThe attachment's ID.

Response

200 Success. Body: application/json, MessageAttachment.

FieldTypeRequiredDescription
idstring (uuid)yes
filenamestring or nullno
contentTypestring or nullno
sizeBytesinteger or nullno(minimum 0)
contentIdstring or nullno
createdAtstring (date-time) or nullno
messageIdstring (uuid)no
disposition"attachment", "inline", nullno
200
{
  "id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "filename": null,
  "contentType": null,
  "sizeBytes": null,
  "contentId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "createdAt": "2026-10-19T09:30:00Z",
  "messageId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
  "disposition": "attachment"
}

Errors

Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.

StatusMeaning
400The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch).
401The API key is missing or invalid.
403The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted).
404No such resource in this account (resource_not_found).
429Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached).
500An unexpected error; retry with backoff, then contact support (internal_error).

On this page