Pistis
API referenceMessages

Attach a file

POST
/sessions/{id}/attachments

The file as the raw body with its media type and its name in x-filename, or a multipart form. Up to 10 MB a file and 25 MB a message. Send its id with a message.

Authorization

bearer
headerAuthorizationBearer <token>

An API token

Path Parameters

id*string

A session id

Header Parameters

x-filename?string

The file's name (URL-encoded), for a raw body

Request Body

body*file
Formatbinary

Response Body

Attached

application/json
  1. response
attachmentId*string

att_<hex>

name*string

Unique in the session; the sandbox has it at /workspace/.pistis/attachments/<name>

size*integer

Bytes

type*string

Media type

Example Request
curl -X POST 'http://127.0.0.1:7777/sessions/ses_6c1f2a0b9d3e4f5a6b7c/attachments' \  -H 'x-filename: notes.txt' \  -H 'Content-Type: application/octet-stream' \  -d 'hello'
Example Response
{  "attachmentId": "string",  "name": "string",  "size": 0,  "type": "string"}