Download an attachment's raw bytes
Returns the attachment's raw bytes on your API key, with Content-Type set to the stored MIME type (defaulting to application/octet-stream) and a Content-Disposition: attachment header carrying the original filename — the response body is the file itself, not a JSON envelope.
Returns the attachment's raw bytes on your API key, with Content-Type set to the stored MIME type (defaulting to application/octet-stream) and a Content-Disposition: attachment header carrying the original filename — the response body is the file itself, not a JSON envelope. 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 fetch your own inbound mail whether or not its attachment has finished its security scan, but a file the scan has flagged as unsafe is withheld with 403 — see handling untrusted attachments. To hand a file to a browser or a third party instead of proxying the bytes, mint a signed URL with the /url or /link variant.
Scope: messages:read. Send the API key as a bearer token; Scopes lists what each one reaches.
Request
Path parameters
| Name | Type | Required | Description |
|---|---|---|---|
attachmentId | string (uuid) | yes | The attachment's ID. |
Response
200 Success. Body: application/octet-stream, string (binary).
Errors
Every error has the same body, {"error": {"type", "code", "message", "param"}}; branch on code. Errors lists every code.
| Status | Meaning |
|---|---|
400 | The request is malformed or a value is invalid (invalid_request, invalid_domain, idempotency_key_mismatch). |
401 | The API key is missing or invalid. |
403 | The key lacks the scope this endpoint needs (scope_missing) or may not do this (not_permitted). |
404 | No such resource in this account (resource_not_found). |
429 | Rate limit, plan limit, budget or spend cap reached (rate_limited, plan_limit_reached, budget_exceeded, spend_cap_reached). |
500 | An unexpected error; retry with backoff, then contact support (internal_error). |
Clear the bot's reaction on a Telegram message
Clears the bot's own reaction on a Telegram message you sent or received, by messageId.
Mint a signed download URL for an attachment
Returns JSON with a short-lived downloadUrl for the file, a branded shareUrl (a human-viewable Dairo share page, or null until the file passes its malware scan), the attachment metadata (filename, contentType, sizeBytes, disposition, messageId, createdAt), and expiresInSeconds.