Skip to documentation
Dashboard
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.

Required headers
NameTypeRequirementDescription
AuthorizationstringRequiredBearer API key with the required workspace scope.Example: Bearer rk_your_key

Path parameters

Path parameters
NameTypeRequirementDescription
messageIduuidRequiredThe RouteKite message identifier.Example: 7dd5da7f-40b0-4c29-bb78-7e0d95ef9eb7
attachmentIduuidRequiredThe RouteKite attachment identifier.Example: c6ea638c-28a4-4b0c-a39d-74f1d29e1e9f

Response

Response fields
NameTypeRequirementDescription
iduuidAlwaysThe attachment identifier.
objectstringAlwaysAlways attachment.
positionintegerAlwaysThe one-based attachment delivery order on this email.
filenamestringAlwaysThe original filename.
content_typestringAlwaysThe validated MIME type.
size_bytesintegerAlwaysThe validated byte size.
sha256stringAlwaysThe lowercase SHA-256 digest.
download_availablebooleanAlwaysWhether RouteKite can currently issue a private download URL.
created_atdate-timeAlwaysWhen the attachment was linked to the email.
download_urlurl | nullRetrieve onlyA private, short-lived download URL, or null when unavailable.
download_url_expires_atdate-time | nullRetrieve onlyThe 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

StatusCodeWhat it meansWhat to do
400INVALID_REQUEST / INVALID_CURSORA filter or pagination cursor is invalid.Correct the reported query value.
401UNAUTHORIZEDThe API key is missing, invalid, revoked, or expired.Check the Bearer header and active key.
403FORBIDDENThe key lacks email:read and email:send access.Use a key with one of the required scopes.
404NOT_FOUNDThe email is unavailable in this workspace.Check the message ID and workspace.
429RATE_LIMITEDToo many read requests were sent.Honor Retry-After before retrying.
500 / 503INTERNAL_ERROR / EMAIL_LIST_UNAVAILABLERouteKite could not load the requested email data.Retry after a short delay.
404ATTACHMENT_NOT_FOUNDThe attachment is not linked to this email.Use an ID returned by the email attachment list.
503ATTACHMENT_UNAVAILABLEAttachment metadata or the private download could not be loaded.Retry after a short delay.