Upload a file in one request: send the bytes with a purpose, and get a file ID back.
curl -X POST "https://api.onlucra.com/v1/files?purpose=product_image&name=hero.jpg" \
-H "Authorization: Bearer $LUCRA_API_KEY" \
-H "Lucra-Version: 2026-10-01" \
--data-binary @hero.jpg
Purposes
purpose | What |
|---|---|
submission | A creator's video |
product_image | A product image |
profile_picture | A logo or profile photo |
program_brief | A PDF brief |
program_reference_video | An example video for creators |
agreement | A PDF agreement |
Processing
Images are ready at once. Videos are processing until Lucra finishes with them; poll GET /v1/files/:id. Using a file before it's ready returns 409 file_processing.
Endpoints
/v1/filesUpload a file
lucra.files.create({ query, body })Query parameters
purposeenumrequiredsubmissionproduct_imageprofile_pictureprogram_briefprogram_reference_videoagreementchat_attachmentad_creativeprofile_referenceprofile_reference_thumbnailnamestringsizeintegerReserve instead of streaming: the file's size in bytes. The body stays empty.
contentTypestringWith `size`: the file's MIME type.
ownerstringWith purpose=profile_picture: the signed-in person's own photo, for PATCH /v1/me.
me
Body
The file's raw bytes.
Response20115 fieldsShow
idfile_…purposeenumsubmissionproduct_imageprofile_pictureprogram_briefprogram_reference_videoagreementchat_attachmentad_creativeprofile_referenceprofile_reference_thumbnailstatusenumawaiting_upload: reserved, waiting for the bytes at `upload.url`; processing: being verified or prepared; failed carries why.
awaiting_uploadprocessingreadyfaileddeletedfileNamestringnullablecontentTypestringnullablesizenumbernullableurlstringnullableA signed link to the file, valid for about 10 minutes; null until it's ready.
widthnumbernullableheightnumbernullableblurHashstringnullableAn image's blur-hash placeholder, once computed.
errorobjectnullableWhy it failed; `upload_incomplete` when the upload was cut off.
Show 2 child fieldsHide child fields
codestringmessagestring
uploadobjectWhere to PUT the bytes, with these headers, before `expiresAt`; only on a reservation.
Show 3 child fieldsHide child fields
urlstringheadersobjectexpiresAtstring
versionintegerSend it back on PATCH to reject edits based on a stale read.
createdAtstringupdatedAtstring
/v1/filesList files
lucra.files.list({ query })Query parameters
limitintegercursorstringcreatedAfterstringOnly items created at or after this time.
createdBeforestringOnly items created before this time.
purposestringOne or more, comma-separated: submission, product_image, profile_picture, program_brief, program_reference_video, agreement, chat_attachment, ad_creative, profile_reference, profile_reference_thumbnail.
statusstringOne or more, comma-separated: awaiting_upload, processing, ready, failed, deleted.
Response200A page of items, 15 fields each, and nextCursorShow
idfile_…purposeenumsubmissionproduct_imageprofile_pictureprogram_briefprogram_reference_videoagreementchat_attachmentad_creativeprofile_referenceprofile_reference_thumbnailstatusenumawaiting_upload: reserved, waiting for the bytes at `upload.url`; processing: being verified or prepared; failed carries why.
awaiting_uploadprocessingreadyfaileddeletedfileNamestringnullablecontentTypestringnullablesizenumbernullableurlstringnullableA signed link to the file, valid for about 10 minutes; null until it's ready.
widthnumbernullableheightnumbernullableblurHashstringnullableAn image's blur-hash placeholder, once computed.
errorobjectnullableWhy it failed; `upload_incomplete` when the upload was cut off.
Show 2 child fieldsHide child fields
codestringmessagestring
uploadobjectWhere to PUT the bytes, with these headers, before `expiresAt`; only on a reservation.
Show 3 child fieldsHide child fields
urlstringheadersobjectexpiresAtstring
versionintegerSend it back on PATCH to reject edits based on a stale read.
createdAtstringupdatedAtstring
/v1/files/:idGet a file
lucra.files.retrieve({ path: { id } })Path parameters
idstringrequired
Response20015 fieldsShow
idfile_…purposeenumsubmissionproduct_imageprofile_pictureprogram_briefprogram_reference_videoagreementchat_attachmentad_creativeprofile_referenceprofile_reference_thumbnailstatusenumawaiting_upload: reserved, waiting for the bytes at `upload.url`; processing: being verified or prepared; failed carries why.
awaiting_uploadprocessingreadyfaileddeletedfileNamestringnullablecontentTypestringnullablesizenumbernullableurlstringnullableA signed link to the file, valid for about 10 minutes; null until it's ready.
widthnumbernullableheightnumbernullableblurHashstringnullableAn image's blur-hash placeholder, once computed.
errorobjectnullableWhy it failed; `upload_incomplete` when the upload was cut off.
Show 2 child fieldsHide child fields
codestringmessagestring
uploadobjectWhere to PUT the bytes, with these headers, before `expiresAt`; only on a reservation.
Show 3 child fieldsHide child fields
urlstringheadersobjectexpiresAtstring
versionintegerSend it back on PATCH to reject edits based on a stale read.
createdAtstringupdatedAtstring
/v1/files/:idFinish or delete an upload
lucra.files.update({ path: { id }, body })Path parameters
idstringrequired
Body
statusenumrequiredprocessing: the bytes are at `upload.url`, so verify and store them (images are then ready at once); deleted: cancel the upload, or delete a file nothing uses.
processingdeleted
Response20015 fieldsShow
idfile_…purposeenumsubmissionproduct_imageprofile_pictureprogram_briefprogram_reference_videoagreementchat_attachmentad_creativeprofile_referenceprofile_reference_thumbnailstatusenumawaiting_upload: reserved, waiting for the bytes at `upload.url`; processing: being verified or prepared; failed carries why.
awaiting_uploadprocessingreadyfaileddeletedfileNamestringnullablecontentTypestringnullablesizenumbernullableurlstringnullableA signed link to the file, valid for about 10 minutes; null until it's ready.
widthnumbernullableheightnumbernullableblurHashstringnullableAn image's blur-hash placeholder, once computed.
errorobjectnullableWhy it failed; `upload_incomplete` when the upload was cut off.
Show 2 child fieldsHide child fields
codestringmessagestring
uploadobjectWhere to PUT the bytes, with these headers, before `expiresAt`; only on a reservation.
Show 3 child fieldsHide child fields
urlstringheadersobjectexpiresAtstring
versionintegerSend it back on PATCH to reject edits based on a stale read.
createdAtstringupdatedAtstring