Skip to main content
POST
/
ai
/
execution-contexts
Create execution context
curl --request POST \
  --url https://api.wacht.dev/ai/execution-contexts \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "title": "Customer Support Session",
  "system_instructions": "You are a helpful customer support agent...",
  "context_group": "support-tier-1"
}
'
{
  "id": "1234567890123456789",
  "created_at": "2024-01-15T10:30:00Z",
  "updated_at": "2024-01-15T10:30:00Z",
  "deployment_id": "9876543210987654321",
  "title": "Customer Support Session",
  "system_instructions": "You are a helpful customer support agent...",
  "context_group": "support-tier-1",
  "last_activity_at": "2024-01-15T11:30:00Z",
  "completed_at": "2024-01-15T12:00:00Z",
  "execution_state": {},
  "status": "idle",
  "source": "web",
  "external_context_id": "ext-123",
  "external_resource_metadata": {}
}

Authorizations

Authorization
string
header
required

API key authentication (format: Bearer {api_key})

Body

application/json
title
string

Context title

Example:

"Customer Support Session"

system_instructions
string

System instructions for the agent

Example:

"You are a helpful customer support agent..."

context_group
string

Optional group identifier for organizing contexts

Example:

"support-tier-1"

Response

200 - application/json

Execution context created

id
string
Example:

"1234567890123456789"

created_at
string<date-time>
Example:

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

updated_at
string<date-time>
Example:

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

deployment_id
string
Example:

"9876543210987654321"

title
string

Context title

Example:

"Customer Support Session"

system_instructions
string | null

System instructions for the agent

Example:

"You are a helpful customer support agent..."

context_group
string | null

Optional group identifier

Example:

"support-tier-1"

last_activity_at
string<date-time>

Timestamp of last activity

Example:

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

completed_at
string<date-time> | null

Timestamp when context was completed

Example:

"2024-01-15T12:00:00Z"

execution_state
object

Current execution state

status
enum<string>

Execution context status

Available options:
idle,
running,
waiting_for_input,
interrupted,
completed,
failed
source
string | null

Source of the context

Example:

"web"

external_context_id
string | null

External context ID

Example:

"ext-123"

external_resource_metadata
object

External resource metadata