Skip to content
merran
GitHubInstall

Merran documentation API & integrations

Add a photo or PDF for the assistant

POST
/api/assistant/files
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=@file

A 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.

Media typemultipart/form-data
object
file
string format: binary

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
Allowed values: image/jpeg application/pdf

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.