Skip to documentation
Dashboard
Attachments

Complete an attachment

Validate uploaded bytes and mark the attachment ready for transactional email.

POST/api/v1/attachments/{attachmentId}/complete
On this page

Authentication

Send a RouteKite API key as a Bearer token. This endpoint requires the email:send scope.

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

Path parameters

Path parameters
NameTypeRequirementDescription
attachmentIduuidRequiredThe ID returned during preparation.Example: c6ea638c-28a4-4b0c-a39d-74f1d29e1e9f

Response

Response fields
NameTypeRequirementDescription
iduuidAlwaysThe attachment identifier.
objectstringAlwaysAlways attachment.
filenamestringReady responseThe validated filename.
content_typestringReady responseThe validated MIME type.
size_bytesintegerReady responseThe validated byte size.
statusenumAlwayspending, ready, rejected, expired, or deleted.
retentionenumAlwaysauto_delete or keep.
expires_atdate-time | nullAlwaysAutomatic deletion date when applicable.

Validation

  • The object must exist.
  • Size and content type must match.
  • The digest must match the exact bytes.
  • The extension and signature must be supported.
  • Repeated completion is safe after ready.

Errors

StatusCodeWhat it meansWhat to do
400INVALID_REQUESTAttachment metadata is invalid.Confirm filename, type, size, and digest.
401UNAUTHORIZEDThe API key is invalid.Check the Bearer header.
403FORBIDDENThe key cannot manage attachments.Use email:send access.
404ATTACHMENT_NOT_FOUNDThe attachment is unavailable in this workspace.Check the ID and workspace.
410ATTACHMENT_EXPIREDThe upload instruction or file expired.Prepare a new upload.
413STORAGE_LIMIT_EXCEEDEDThe account cannot reserve this file.Remove unused files and retry.
422ATTACHMENT_TYPE_UNSUPPORTEDThe format is not accepted.Use a supported format.
422ATTACHMENT_INVALIDThe bytes do not match the prepared metadata.Recalculate and upload the exact file.
500 / 503ATTACHMENT_UNAVAILABLEThe operation could not complete.Retry after a short delay.