Skip to main content
POST
/
api
/
agent
/
contexts
Create agent context
curl --request POST \
  --url https://api.wacht.dev/api/agent/contexts \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --cookie session_id= \
  --data 'title=Customer Support Conversation' \
  --data 'system_instructions=You are a helpful customer support assistant.'
{
  "id": "123456789012345678",
  "deployment_id": "111111111111111111",
  "context_group": "support-agents",
  "title": "Customer Support Conversation",
  "system_instructions": "You are a helpful customer support assistant.",
  "status": "active",
  "message_count": 15,
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T11:30:00Z"
}

Authorizations

session_id
string
cookie
required

Session-based authentication using cookies

Body

application/x-www-form-urlencoded
title
string
required

Context title

Example:

"Customer Support Conversation"

system_instructions
string

Optional system instructions for the agent

Example:

"You are a helpful customer support assistant."

Response

Context created successfully

id
string<uint64>

Context ID

Example:

"123456789012345678"

deployment_id
string<uint64>

Deployment ID

Example:

"111111111111111111"

context_group
string

Context group identifier

Example:

"support-agents"

title
string

Context title

Example:

"Customer Support Conversation"

system_instructions
string | null

System instructions for the agent

Example:

"You are a helpful customer support assistant."

status
enum<string>

Context status

Available options:
active,
archived
Example:

"active"

message_count
integer

Number of messages in context

Example:

15

created_at
string<date-time>
Example:

"2024-01-15T10:30:00Z"

updated_at
string<date-time>
Example:

"2024-01-15T11:30:00Z"