Skip to main content
POST
Upload an attachment
Stages a file for a message. Use it to hand the agent a document, image, or data file, then reference the attachment in the message you send next. Related guide: Agent access: grant credentials to agents. Stages one file for a message. Raw bytes in the body with the file’s own Content-Type; name it with ?name=. Capped at 10 MB. The attachment stays pending until a message references it in attachmentIds; unbound attachments are swept after 24 hours.
Availability: Cloud · Community (self-hosted) · Enterprise (self-hosted)

Authorizations

Authorization
string
header
required

A workspace API key (oc_…) or organization API key (oc_org_…). Workspace-scoped endpoints called with an organization key also need X-Workspace-Id.

Path Parameters

conversationId
string
required

Query Parameters

name
string
required

The file name.

Body

application/octet-stream

The body is of type file.

Response

The staged attachment

id
string
name
string
mimeType
string
sizeBytes
integer
status
string

pending until a message binds the attachment; bound attachments carry the message's lifecycle.

direction
enum<string>

inbound = the person's message; outbound = the agent's reply.

Available options:
inbound,
outbound
caption
string | null
createdAt
string<date-time>