Upload an image for a later message
Not the Files API: this feeds an image block in a later message, and mounts nothing. To give the agent a file to read, upload it with uploadFile and attach it with addSessionResources. Stores one image privately for the session and returns the uri to place on an image content block in a later sendSessionEvents call, so a message with a picture is two small requests instead of one large JSON body. Send the bytes as the file part of a multipart/form-data body, or as the raw request body with an image Content-Type. The same limits the session’s content policy applies to inline image blocks apply here; a rejected upload is a 400 that names the reason. Uploads that are never referenced from a message are eventually removed.
Authorizations
A Recursion API key, created in the console under API keys.
Path Parameters
Session id (UUID) the upload belongs to. The caller must be allowed to send events to it.
Body
Multipart body carrying one image in the file part.
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.
Stored image size in bytes.
Decoded image height in pixels.
Sniffed media type of the stored bytes.
Lowercase SHA-256 of the stored bytes; also the image's model-facing id prefix.
Private content reference to place on an image content block in a later sendSessionEvents call. Readable only through this session.
Decoded image width in pixels.