Skip to content

Stores one image with a session, to be sent with its next message.

POST
/v1/m/sessions/runs/{ref}/attachments
curl --request POST \
--url https://example.com/v1/m/sessions/runs/example/attachments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "data": "example", "media_type": "image/png" }'

Stores one image with a session, to be sent with its next message.

ref
required
string

Path parameter ref.

X-Olivares-Tenant
string format: uuid

Target tenant id; required when the principal can act in more than one tenant.

Media type application/json
object
data
required

The image, base64 encoded. At most 3.75 MiB decoded.

string
media_type
required
string
Allowed values: image/png image/jpeg image/webp image/gif

The image is stored with the session; send its id with the next message

Media type application/json
object
id
required
string
media_type
required
string
Allowed values: image/png image/jpeg image/webp image/gif
size_bytes
required
integer
Example
{
"media_type": "image/png"
}

Bad request

Media type application/json
object
Example generated
{}

Unauthenticated

Media type application/json
object
Example generated
{}

Forbidden

Media type application/json
object
Example generated
{}

Not found

Media type application/json
object
Example generated
{}

Conflict / setup required

Media type application/json
object
Example generated
{}

The image is over the size the tools take

Media type application/json
object
Example generated
{}

The file is not a PNG, JPEG, WebP or GIF image

Media type application/json
object
Example generated
{}

The session’s tool does not take images

Media type application/json
object
Example generated
{}

Other images are being stored on this node; retry

Media type application/json
object
Example generated
{}

Attaching images is not available on this node

Media type application/json
object
Example generated
{}

The session already holds as many images as it keeps

Media type application/json
object
Example generated
{}