Skip to main content
POST
/
api
/
v0
/
sessions
/
{sessionId}
/
messages
Add a message to a session
curl --request POST \
  --url https://api.factory.ai/api/v0/sessions/{sessionId}/messages \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "text": "<string>",
  "images": [
    {
      "type": "base64",
      "data": "<string>",
      "mediaType": "image/jpeg"
    }
  ],
  "files": [
    {
      "type": "base64",
      "mediaType": "application/pdf",
      "data": "<string>",
      "parsedData": "<string>",
      "name": "<string>",
      "path": "<string>"
    }
  ],
  "computerId": "<string>"
}
'
{
  "messageId": "<string>",
  "status": "idle"
}

Documentation Index

Fetch the complete documentation index at: https://factory-docs-auto-sync-jp-docs.mintlify.app/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Factory API key or JWT token for authentication

Path Parameters

sessionId
string
required

Body

application/json
text
string
required

Message text content

images
object[]

Optional base64-encoded images

files
object[]

Optional file attachments (PDFs, text files)

computerId
string

Computer ID to route the message to; falls back to the session.computerId if omitted

Response

Response for status 200

messageId
string
required

ID of the created user message

status
enum<string>
required

Agent status after message submission

Available options:
idle,
pending,
running