Skip to main content
POST
/
session
/
tickets
Generate session ticket
curl --request POST \
  --url https://api.wacht.dev/session/tickets \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "ticket_type": "impersonation",
  "user_id": "1234567890",
  "agent_ids": [
    "1111111111",
    "2222222222"
  ],
  "context_group": "support-session",
  "expires_in": 300
}
'
{
  "ticket": "wacht_st_ticket_abc123xyz789...",
  "expires_at": 1705339500
}

Authorizations

Authorization
string
header
required

API key authentication (Bearer token)

Body

application/json
ticket_type
enum<string>
required

Type of session ticket to generate

Available options:
impersonation,
agent_access
user_id
string

User ID (required for impersonation tickets)

Example:

"1234567890"

agent_ids
string[]

List of agent IDs (required for agent_access tickets)

Example:
["1111111111", "2222222222"]
context_group
string

Optional context group for the ticket

Example:

"support-session"

expires_in
integer

Expiration time in seconds - default is 300

Example:

300

Response

Session ticket generated successfully

ticket
string
required

The session ticket token

Example:

"wacht_st_ticket_abc123xyz789..."

expires_at
integer<int64>
required

Unix timestamp when the ticket expires

Example:

1705339200