Skip to content

Upload Attachment

POST /attachments

Store a file and answer with the attachment_id a turn references it by.

multipart/form-data with a file part and an optional filename field, at most 16 MiB. The type is read from the bytes: jpeg, png, webp and gif images (re-encoded within 2048 px, without EXIF or any other metadata), application/pdf, and audio. Anything else is 422 attachment_media_type_unsupported, and bytes that are not what the declared type says are 422 attachment_media_type_mismatch. The answer describes the stored file.

An upload that no run uses is deleted after 24 hours (expires_at).

StatusDescriptionBody
201Successful ResponseAttachmentView
Terminal window
curl -X POST https://your-deployment.example.com/attachments \
-H "Authorization: Bearer $COBRE_TOKEN"
FieldTypeNotes
attachment_idstring (uuid)required—
media_typestringrequired—
size_bytesintegerrequired—
widthinteger | nulloptional—
heightinteger | nulloptional—
filenamestring | nulloptional—
expires_atstring (date-time) | nulloptional—