Skip to main content
POST
Create a new thread for an agent

Authorizations

Authorization
string
header
required

Use JWT token for authentication

Path Parameters

agentId
string<uuid>
required

UUID of the agent for which to create the thread

Body

application/json

Payload to create a new thread

messages
object[]
required

Initial messages for the thread

metadata
object

Custom metadata to associate with the thread

tenantId
string

Tenant (customer/organization) this thread belongs to in multi-tenant setups. Auto-registers the tenant on first use and attributes its cost/usage. See the Tenants endpoints.

subtenantId
string

End user/entity inside the tenant. When omitted it is derived from metadata.subtenantMetadata.id or the legacy metadata.userId. Used for per-subtenant cost attribution and usage limits.

async
boolean
default:false

Whether to execute the thread asynchronously

Response

Thread created successfully

id
string<uuid>
required

Unique identifier for the thread

agentId
string<uuid>
required

Unique identifier for the associated agent

status
enum<string>
required

Current status of the thread

Available options:
RUNNING,
PAUSED,
COMPLETED,
FAILED,
AWAITING_APPROVAL
createdAt
string<date-time>
required

Timestamp when the thread was created

messages
object[]
required

Messages exchanged in the thread

updatedAt
string<date-time>

Timestamp when the thread was last updated

metadata
object

Custom metadata associated with the thread

cost
number<float>

Total cost accumulated by this thread