Skip to main content
POST
/
agents
/
{agentId}
/
threads
curl --request POST \ --url https://mosoo.ai/api/v1/agents/{agentId}/threads \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data ' { "client_external_ref": "linear-ENG-123", "files": [ { "file_id": "file_01KQX0V62MEXAMPLE7W6X3B2A" } ], "input": { "content": [ { "text": "Summarize the attached launch plan and list follow-ups.", "type": "text" } ], "type": "user.message" } } '
{
  "links": {
    "thread": "<string>"
  },
  "run": {
    "completedAt": "2023-11-07T05:31:56Z",
    "createdAt": "2023-11-07T05:31:56Z",
    "id": "<string>",
    "startedAt": "2023-11-07T05:31:56Z",
    "updatedAt": "2023-11-07T05:31:56Z"
  },
  "thread": {
    "agent_id": "<string>",
    "attributed_user": {
      "id": "<string>"
    },
    "client_external_ref": "<string>",
    "created_at": "2023-11-07T05:31:56Z",
    "created_by": {
      "id": "<string>"
    },
    "id": "<string>",
    "last_run_id": "<string>",
    "source": "<unknown>",
    "title": "<string>",
    "updated_at": "2023-11-07T05:31:56Z"
  }
}

Authorizations

Authorization
string
header
required

Use Authorization: Bearer grt_pat_... for Human PAT calls or an Organization Service token for machine calls.

Headers

Idempotency-Key
string

Optional key for retry-safe create-thread and send-events calls. Reusing the same key with the same request returns the original response. Reusing the key while the original request is still processing returns 409.

Maximum string length: 128

Path Parameters

agentId
string
required

Published Agent ID from the Agent's API Access panel.

Body

application/json
input
object
required
attributed_user_id
string
client_external_ref
string
Maximum string length: 255
files
object[]

File handles uploaded by the same Human PAT caller. Organization Service tokens cannot attach files until service-token file uploads are available.

Response

Created Thread.

run
object
required
thread
object
required