Skip to main content
POST
https://api.crewship.dev
/
v1
/
threads
curl -X POST https://api.crewship.dev/v1/threads \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "deployment_id": "dep_abc123",
    "metadata": {"user_id": "user_1"}
  }'
{
  "thread_id": "thr_xyz789abc",
  "deployment_id": "dep_abc123",
  "status": "idle",
  "metadata": {"user_id": "user_1"},
  "values": null,
  "created_at": "2024-01-15T10:35:00Z",
  "updated_at": "2024-01-15T10:35:00Z"
}

Request

deployment_id
string
required
Deployment ID to scope this thread to
metadata
object
User-defined metadata (e.g., user ID, session info)
values
object
Initial thread state values

Response

thread_id
string
Thread ID (e.g., thr_abc123xyz)
deployment_id
string
Deployment ID
status
string
Thread status: idle
metadata
object
User-defined metadata
created_at
string
ISO 8601 timestamp
curl -X POST https://api.crewship.dev/v1/threads \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "deployment_id": "dep_abc123",
    "metadata": {"user_id": "user_1"}
  }'
{
  "thread_id": "thr_xyz789abc",
  "deployment_id": "dep_abc123",
  "status": "idle",
  "metadata": {"user_id": "user_1"},
  "values": null,
  "created_at": "2024-01-15T10:35:00Z",
  "updated_at": "2024-01-15T10:35:00Z"
}