Emails
Retrieve an email attachment
Retrieve attachment metadata and a one-minute private download URL when available.
GET
/api/v1/emails/{messageId}/attachments/{attachmentId}On this page
Authentication
Send a RouteKite API key as a Bearer token. This endpoint requires the email:read or email:send scope.
| Name | Type | Requirement | Description |
|---|---|---|---|
Authorization | string | Required | Bearer API key with the required workspace scope.Example: Bearer rk_your_key |
Path parameters
| Name | Type | Requirement | Description |
|---|---|---|---|
messageId | uuid | Required | The RouteKite message identifier.Example: 7dd5da7f-40b0-4c29-bb78-7e0d95ef9eb7 |
attachmentId | uuid | Required | The RouteKite attachment identifier.Example: c6ea638c-28a4-4b0c-a39d-74f1d29e1e9f |
Response
| Name | Type | Requirement | Description |
|---|---|---|---|
id | uuid | Always | The attachment identifier. |
object | string | Always | Always attachment. |
position | integer | Always | The one-based attachment delivery order on this email. |
filename | string | Always | The original filename. |
content_type | string | Always | The validated MIME type. |
size_bytes | integer | Always | The validated byte size. |
sha256 | string | Always | The lowercase SHA-256 digest. |
download_available | boolean | Always | Whether RouteKite can currently issue a private download URL. |
created_at | date-time | Always | When the attachment was linked to the email. |
download_url | url | null | Retrieve only | A private, short-lived download URL, or null when unavailable. |
download_url_expires_at | date-time | null | Retrieve only | The one-minute download URL expiry, or null. |
Short-lived download
When download_available is true, RouteKite returns a private URL that expires after one minute. If retained bytes are unavailable, both download fields are null.
Errors
| Status | Code | What it means | What to do |
|---|---|---|---|
| 400 | INVALID_REQUEST / INVALID_CURSOR | A filter or pagination cursor is invalid. | Correct the reported query value. |
| 401 | UNAUTHORIZED | The API key is missing, invalid, revoked, or expired. | Check the Bearer header and active key. |
| 403 | FORBIDDEN | The key lacks email:read and email:send access. | Use a key with one of the required scopes. |
| 404 | NOT_FOUND | The email is unavailable in this workspace. | Check the message ID and workspace. |
| 429 | RATE_LIMITED | Too many read requests were sent. | Honor Retry-After before retrying. |
| 500 / 503 | INTERNAL_ERROR / EMAIL_LIST_UNAVAILABLE | RouteKite could not load the requested email data. | Retry after a short delay. |
| 404 | ATTACHMENT_NOT_FOUND | The attachment is not linked to this email. | Use an ID returned by the email attachment list. |
| 503 | ATTACHMENT_UNAVAILABLE | Attachment metadata or the private download could not be loaded. | Retry after a short delay. |