Merran documentation API & integrations
Add a photo or PDF for the assistant
POST
/api/assistant/files
const url = 'http://localhost:3000/api/assistant/files';const form = new FormData();form.append('file', 'file');
const options = { method: 'POST', headers: {cookie: 'merran.session_token=<merran.session_token>'}};
options.body = form;
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url http://localhost:3000/api/assistant/files \ --header 'Content-Type: multipart/form-data' \ --cookie merran.session_token=<merran.session_token> \ --form file=@fileA file to send with a message, by its id in the message’s files: a photo of what’s in the pan, or a recipe to draft, as a photo or PDF. A photo is JPEG, PNG or WebP up to 15 MB, kept smaller and the right way up; a PDF is up to 10 MB. They’re kept with the person’s chats. With an API key, it needs the assistant: write permission.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typemultipart/form-data
object
file
string format: binary
Responses
Section titled “Responses”Kept.
Media typeapplication/json
object
id
required
string
url
required
Where it’s shown from.
string
mediaType
required
A photo is kept as JPEG; a PDF as it is.
string
Example
{ "id": "4f1c2a9e7b3d5f6a8c0e1b2d", "url": "/api/assistant/files/4f1c2a9e7b3d5f6a8c0e1b2d", "mediaType": "image/jpeg"}No file, or not a photo or PDF Merran can read.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}Not signed in.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}Not allowed.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}The file is too big.
Media typeapplication/json
object
error
required
object
code
required
string
message
required
string
fields
object
key
additional properties
string
Example
{ "error": { "code": "not_found", "message": "There's nothing here.", "fields": { "name": "Give it a name." } }}© 2026 Kyle Johnson. Documentation: CC BY 4.0. Merran: AGPL-3.0-or-later.