Stores one image with a session, to be sent with its next message.
POST
/v1/m/sessions/runs/{ref}/attachments
const url = 'https://example.com/v1/m/sessions/runs/example/attachments';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"data":"example","media_type":"image/png"}'};
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://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.
Authorizations
Section titled “ Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “ Path Parameters ” ref
required
string
Path parameter ref.
Header Parameters
Section titled “ Header Parameters ” X-Olivares-Tenant
string format: uuid
Target tenant id; required when the principal can act in more than one tenant.
Request Body required
Section titled “ Request Body required ” Media type application/json
object
data
required
The image, base64 encoded. At most 3.75 MiB decoded.
string
media_type
required
string
Responses
Section titled “ Responses ”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
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
{}