---
title: "Add a message to a session"
method: POST
path: "/api/v0/sessions/{sessionId}/messages"
tags: ["Sessions"]
---

# Add a message to a session

`POST /api/v0/sessions/{sessionId}/messages`

Adds a user message and optionally waits for agent completion. Supports text, images, and file attachments. This feature is enabled for selected organizations only.

## Path parameters

- `sessionId` string, required

## Request body

- PostMessageRequestBody
  - `text` string, required — Message text content
  - `images` object[] — Optional base64-encoded images
    - `type` 'base64', required
    - `data` string, required
    - `mediaType` 'image/jpeg' | 'image/png' | 'image/gif' | 'image/webp', required
  - `files` union[] — Optional file attachments (PDFs, text files)
    - union
      - object
        - `type` 'base64', required
        - `mediaType` 'application/pdf', required
        - `data` string, required
        - `parsedData` string
        - `name` string
        - `path` string
      - object
        - `type` 'text', required
        - `mediaType` 'text/plain', required
        - `data` string, required
        - `name` string
        - `mime` string
  - `computerId` string — Computer ID to route the message to; falls back to the session.computerId if omitted

## Response `200`

Response for status 200

- PostMessage200ResponseBody
  - `messageId` string, required — ID of the created user message
  - `status` 'idle' | 'pending' | 'running', required — Agent status after message submission

## Other responses

- `400` — Response for status 400
- `401` — Response for status 401
- `403` — Response for status 403
- `404` — Response for status 404
- `500` — Response for status 500
- `503` — Response for status 503

---

[API](https://skmtc.net/factory/apis/factory-public-api.md) · [All operations](https://skmtc.net/factory/apis/factory-public-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/factory/factory-public-api/versions/684f94d47ca9/schema)
