Skip to main content
POST
Upload an image for a later message

Authorizations

Authorization
string
header
required

A Recursion API key, created in the console under API keys.

Path Parameters

session_id
string<uuid>
required

Session id (UUID) the upload belongs to. The caller must be allowed to send events to it.

Body

multipart/form-data

Multipart body carrying one image in the file part.

file
file

The image bytes. PNG, JPEG and WebP are accepted; the media type is sniffed from the bytes.

Response

The stored image an upload produced. Reference it from a message by putting uri on an image content block.

The stored image an upload produced. Reference it from a message by putting uri on an image content block.

byte_size
integer<int64>
required

Stored image size in bytes.

height
integer
required

Decoded image height in pixels.

media_type
string
required

Sniffed media type of the stored bytes.

sha256
string
required

Lowercase SHA-256 of the stored bytes; also the image's model-facing id prefix.

uri
string
required

Private content reference to place on an image content block in a later sendSessionEvents call. Readable only through this session.

width
integer
required

Decoded image width in pixels.