Skip to main content
POST

Authorizations

Authorization
string
header
required

Identify accepts a workspace API key (sk_…). Loom accepts either a short-lived session token (direct) or a workspace API key (relay).

Headers

Idempotency-Key
string

Makes this POST safe to retry. The first call does the work and its response is stored; a retry with the same key returns that stored response with Idempotency-Replayed: true, without charging again. Same key with a different body is rejected. Keys expire after 24 hours.

Maximum string length: 255
Patchwork-Subject
string

Relay only. Opaque subject id, chosen by you and never resolved by Patchwork. Partitions threads and memory within your workspace. Direct tokens carry sub instead — do not send this header on a session token. Required on every subject-scoped resource: threads, messages, runs, outcomes, confirmations and realtime. Omitting it is subject_required, never a wider result. The value is used exactly as given — never trimmed or normalised — so a stray space creates a second partition and is refused as invalid_subject.

Patchwork-Connection
string

Connection id or name the agent may call. Required in relay when the agent has unpinned customer tools. Direct tokens may carry conn instead.

Body

application/json
agent
string

Agent public id (agent_…). Defaults to the workspace's published agent.

subject_ref
string

Relay only. Acting user id, if you prefer it to the Patchwork-Subject header when opening a thread. Ignored on a direct token. One of the two is required.

Response

Thread created.

status
string
required
Allowed value: "success"
data
object
required