v1
latestOpenAPI 3.0.02026-08-04891301.4 MBCreate a thread for an agent
Creates a new thread owned by the specified agent. The thread is scoped to the agent's identity and is immediately available for messaging.
The authenticated caller must have access to the agent's parent app. If your API key is scoped to a specific app, pass that app's ID via the app parameter. Attempting to create a thread for an agent you cannot access returns 404.
By default the platform may send an automatic welcome message into the new thread. Pass skip_welcome_message: true to suppress this behavior.
post/api/v1/agents/{agent}/threads
Path parameters
agentstring required
Agent ID (agt_...). The thread will be owned by this agent.
Request body
Example request
{
"skip_welcome_message": true,
"thread": {
"description": "An example description.",
"is_unlisted": true,
"key": "string",
"metadata": {
"key": "value"
},
"muted": true,
"org": "string",
"settings": {},
"title": "Example Title"
}
}Response
Successful response
Example response
{
"agent_user": "agi_0aBcDeFgHiJkLmNoPqRsTu",
"created_at": "2024-01-01T00:00:00Z",
"creator": {
"alias": "jdoe",
"app": "dap_0aBcDeFgHiJkLmNoPqRsTu",
"app_name": "Example Name",
"email": "user@example.com",
"id": "usr_0aBcDeFgHiJkLmNoPqRsTu",
"is_system_user": true,
"metadata": {
"key": "value"
},
"name": "Example Name",
"org": "org_0aBcDeFgHiJkLmNoPqRsTu",
"org_name": "Example Name",
"org_role": "member",
"sandbox": "dsb_0aBcDeFgHiJkLmNoPqRsTu",
"sandbox_name": "Example Name"
},
"description": "An example description.",
"id": "string",
"is_channel": true,
"is_default": true,
"is_transient": true,
"is_unlisted": true,
"key": "string",
"last_activity": "2024-01-01T00:00:00Z",
"metadata": {
"key": "value"
},
"muted": true,
"org": "org_0aBcDeFgHiJkLmNoPqRsTu",
"parent_message": {
"actors": [
{
"alias": "alice",
"id": "user-usr_01j3k5m7n9p2r4s6t8v0w1x2",
"name": "Example Name",
"profile_picture": {
"file": "fil_0aBcDeFgHiJkLmNoPqRsTu",
"height": 600,
"media": "med_0aBcDeFgHiJkLmNoPqRsTu",
"mime_type": "application/json",
"refresh_url": "https://example.com",
"url": "https://example.com",
"width": 800
}
}
],
"agent": "agi_0aBcDeFgHiJkLmNoPqRsTu",
"attachments": [
{
"content_type": "application/json",
"description": "An example description.",
"filename": "string",
"height": 1,
"id": "string",
"image_height": 1,
"image_source": {
"file": "fil_0aBcDeFgHiJkLmNoPqRsTu",
"height": 600,
"media": "med_0aBcDeFgHiJkLmNoPqRsTu",
"mime_type": "application/json",
"refresh_url": "https://example.com",
"url": "https://example.com",
"width": 800
},
"image_url": "https://example.com",
"image_width": 1,
"media_type": "application/json",
"name": "Example Name",
"object": {},
"title": "Example Title",
"type": "file",
"url": "https://example.com",
"variants": [
{
"content_type": "application/json",
"created_at": "2024-01-01T00:00:00Z",
"file": "fil_0aBcDeFgHiJkLmNoPqRsTu",
"filename": "string",
"height": 600,
"id": "mvr_0aBcDeFgHiJkLmNoPqRsTu",
"image_source": {
"file": "fil_0aBcDeFgHiJkLmNoPqRsTu",
"height": 600,
"media": "med_0aBcDeFgHiJkLmNoPqRsTu",
"mime_type": "application/json",
"refresh_url": "https://example.com",
"url": "https://example.com",
"width": 800
},
"updated_at": "2024-01-01T00:00:00Z",
"url": "https://example.com",
"variant_key": "original",
"width": 800
}
],
"version": 1,
"width": 1
}
],
"branched_thread": "string",
"content": "Hello, how can I help you today?",
"created_at": "2024-01-01T00:00:00Z",
"has_replies": true,
"id": "msg_0aBcDeFgHiJkLmNoPqRsTu",
"idempotency_key": "01234567-89ab-cdef-0123-456789abcdef",
"legacy_agent": "string",
"metadata": {
"key": "value"
},
"org": "org_0aBcDeFgHiJkLmNoPqRsTu",
"reactions": [
{
"payload": {
"key": "value"
},
"type": "emoji_reaction",
"user": "string"
}
],
"rendering_mode": "reply",
"replies": [
{}
],
"replies_after_cursor": "string",
"replies_before_cursor": "string",
"reply_count": 1,
"reply_to": {},
"sandbox": "string",
"team": "tem_0aBcDeFgHiJkLmNoPqRsTu",
"thread": "string",
"user": "string"
},
"participant": [
"string"
],
"participants": [
{
"alias": "jdoe",
"app": "dap_0aBcDeFgHiJkLmNoPqRsTu",
"app_name": "Example Name",
"email": "user@example.com",
"id": "usr_0aBcDeFgHiJkLmNoPqRsTu",
"is_system_user": true,
"metadata": {
"key": "value"
},
"name": "Example Name",
"org": "org_0aBcDeFgHiJkLmNoPqRsTu",
"org_name": "Example Name",
"org_role": "member",
"sandbox": "dsb_0aBcDeFgHiJkLmNoPqRsTu",
"sandbox_name": "Example Name"
}
],
"participating_actor": [
"string"
],
"participating_agents": [
{
"acl": {
"add": [
{
"actions": [
"read",
"write"
],
"principal": "string",
"principal_type": "user"
}
],
"grants": [
{
"actions": [
"read",
"write"
],
"principal": "string",
"principal_type": "user"
}
],
"remove": [
{
"principal": "string",
"principal_type": "user"
}
]
},
"app": "dap_0aBcDeFgHiJkLmNoPqRsTu",
"created_at": "2024-01-01T00:00:00Z",
"default_model": "claude-3-7-sonnet-latest",
"email": "user@example.com",
"id": "agi_0aBcDeFgHiJkLmNoPqRsTu",
"identity": "You are a helpful assistant that answers questions about ArchAstro products.",
"last_applied_template_config": "cfg_0aBcDeFgHiJkLmNoPqRsTu",
"lookup_key": "string",
"metadata": {
"key": "value"
},
"name": "Example Name",
"org": "org_0aBcDeFgHiJkLmNoPqRsTu",
"org_name": "Example Name",
"originator": "deploy-pipeline",
"phone_number": "+15555550123",
"sandbox": "dsb_0aBcDeFgHiJkLmNoPqRsTu",
"source_solution": {
"solution": {
"category_keys": [
"string"
],
"created_at": "2024-01-01T00:00:00Z",
"description": "An example description.",
"id": "id_0aBcDeFgHiJkLmNoPqRsTu",
"kind": "Solution",
"latest_solution": "id_0aBcDeFgHiJkLmNoPqRsTu",
"latest_version": "1.0.0",
"lookup_key": "string",
"metadata": {
"key": "value"
},
"name": "Example Name",
"org": "org_0aBcDeFgHiJkLmNoPqRsTu",
"org_logo": {
"file": "fil_0aBcDeFgHiJkLmNoPqRsTu",
"height": 600,
"media": "med_0aBcDeFgHiJkLmNoPqRsTu",
"mime_type": "application/json",
"refresh_url": "https://example.com",
"url": "https://example.com",
"width": 800
},
"org_name": "Example Name",
"org_slug": "example-slug",
"owners": [
"string"
],
"readme_url": "https://example.com",
"solution_id": "01234567-89ab-cdef-0123-456789abcdef",
"solution_version": "1.2.0",
"tag_keys": [
"string"
],
"template_kind": "AgentTemplate",
"templates": [
{
"description": "An example description.",
"display_name": "Example Name",
"id": "id_0aBcDeFgHiJkLmNoPqRsTu",
"kind": "AgentTemplate",
"lookup_key": "string",
"name": "Example Name",
"readme_url": "https://example.com",
"virtual_path": "string"
}
],
"updated_at": "2024-01-01T00:00:00Z",
"upgrade_available": true,
"virtual_path": "string"
},
"template": {
"created_at": "2024-01-01T00:00:00Z",
"description": "An example description.",
"display_name": "Example Name",
"id": "id_0aBcDeFgHiJkLmNoPqRsTu",
"kind": "agent_tool_template",
"lookup_key": "string",
"name": "Example Name",
"updated_at": "2024-01-01T00:00:00Z",
"virtual_path": "string"
}
},
"team": "tem_0aBcDeFgHiJkLmNoPqRsTu",
"updated_at": "2024-01-01T00:00:00Z",
"user": "usr_0aBcDeFgHiJkLmNoPqRsTu"
}
],
"role": "member",
"sandbox": "string",
"settings": {
"agent_enabled": true
},
"slug": "example-slug",
"sub_threads": [
{}
],
"team": "tem_0aBcDeFgHiJkLmNoPqRsTu",
"title": "Example Title",
"ttl": 3600,
"unread_count": 5,
"updated_at": "2024-01-01T00:00:00Z",
"user": "usr_0aBcDeFgHiJkLmNoPqRsTu"
}