Skip to main content
POST
/
threads
/
{threadId}
/
events
Send user messages, permission decisions, or interrupts to a Thread
curl --request POST \
  --url https://mosoo.ai/api/v1/threads/{threadId}/events \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "events": [
    {
      "text": "Say hello from the API.",
      "type": "user_message"
    }
  ]
}
'
{
  "acceptedAt": "2023-11-07T05:31:56Z",
  "events": [
    {
      "clientRequestId": "<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"
  },
  "warnings": [
    {
      "code": "<string>",
      "message": "<string>"
    }
  ]
}

Authorizations

Authorization
string
header
required

Use Authorization: Bearer grt_pat_... . PATs identify an account and do not carry scopes.

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

threadId
string
required

Thread ID returned by create thread.

Pattern: ^[0-9A-HJKMNP-TV-Z]{26}$

Body

application/json
events
object[]
required
Minimum array length: 1

Response

Accepted event batch.

acceptedAt
string<date-time>
required
events
object[]
required
thread
object
required
warnings
object[]
required