Start a thread with the default agent

View as Markdown
Starts a new conversation thread: resolves the container, mints a `threadId`, and creates the thread’s first agent run there from the founding `prompt` (1–4000 chars) and optional `fileIds` (1–200). Omit `spaceId` for the caller’s private desk (the default); pass a `spaceId` to start the thread in a space, where every holder of `space:contribute` can read and continue it. Authorization: any real organization member (embed tokens and API keys have no desk → 404); a named space requires `space:contribute` (404 otherwise) and may never be a desk id (400 `cannot_target_desk`). Gated by `AGENTS_ENABLED`; disabled → 404. Returns 201 `{ threadId, runId, steered: false, status, spaceId }`.

Authentication

AuthorizationBearer

Bearer authentication of the form Bearer <token>, where token is your auth token.

Request

This endpoint expects an object.
promptstringRequired1-4000 characters

The request that founds the thread (frozen into the first run’s snapshot).

playbookIdstringOptional1-128 characters

The agent the thread talks to. Omit for the default agent. Every run in the thread (including rollover successors) executes this agent.

fileIdslist of stringsOptional

Files to attach to the first run. Omit for a prompt-only start.

spaceIdstringOptional>=1 character

Start the thread in this space instead of the caller’s private desk — everyone who holds space:contribute on it can then read and continue the thread. Requires space:contribute (404 otherwise). A desk id (me:…) is never a valid target (400 cannot_target_desk).

Response

The thread’s first run.

threadIdstring
runIdstring
steeredboolean
statusstring
spaceIdstring

Errors

400
Bad Request Error
404
Not Found Error