Upload Attachment
const url = 'https://agents.lumalabs.ai/v1/attachments?session_id=example';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url 'https://agents.lumalabs.ai/v1/attachments?session_id=example' \ --header 'Authorization: Bearer <token>'Upload a file and begin the artifact ingest pipeline.
Returns immediately after the S3 write. Pipeline (moderation,
thumbnails, embeddings) runs asynchronously. An attachment_ready
SSE event fires on the session when the pipeline reaches a terminal
state.
Authorizations
Section titled “Authorizations”Parameters
Section titled “ Parameters ”Query Parameters
Section titled “Query Parameters”Session this attachment belongs to
Session this attachment belongs to
Responses
Section titled “ Responses ”Successful Response
object
Attachment id to pass in a user.message's attachment_ids.
MIME type of the uploaded file.
Why an attachment came back rejected — a coarse bucket, not a code.
Stable vocabulary a partner can branch on: a policy refusal is theirs to explain to their user, a corrupt file is theirs to re-encode, and an internal error or a timeout is ours. The human copy behind each of these is operator-tunable and deliberately NOT part of the contract.
This is a BUCKET over AttachmentResponse.failure_code, standing to it as
failure_category stands to JobView.failure_code — several taxonomy
codes collapse onto one member here (six onto internal_error alone), so
it deliberately cannot be spelled as a dotted code and is not a second
spelling of one. The dotted code travels beside it for a partner who wants
the precise cause, which is what keeps /v1/sessions/* on one failure
vocabulary.
Pipeline_running = ingest in progress; ready = passed the pipeline; rejected = refused — see rejection_reason for which refusal it was.
Presigned GET URL for immediate preview. Expires in 1 hour. Do not persist — use attachment_id to generate fresh URLs.
Example
{ "rejection_reason": "content_moderated", "state": "pipeline_running"}Validation Error
object
object
object
Examplegenerated
{ "detail": [ { "ctx": {}, "input": "example", "loc": [ "example" ], "msg": "example", "type": "example" } ]}