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"
}
Threads
Create Thread
Create a new thread for a deployment
POST
/
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
string
required
Deployment ID to scope this thread to
object
User-defined metadata (e.g., user ID, session info)
object
Initial thread state values
Response
string
Thread ID (e.g.,
thr_abc123xyz)string
Deployment ID
string
Thread status:
idleobject
User-defined metadata
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"
}