Session Tickets Guide
Session tickets provide a secure way to grant temporary access for impersonation, AI agent access, webhook app access, and API auth app access.Prerequisites
Before using any API methods, you must initialize the SDK:Ticket Types
The SDK supports four ticket types:| Type | Use Case |
|---|---|
Impersonation | Allow admins to impersonate other users |
AgentAccess | Grant access to specific AI agents |
WebhookAppAccess | Grant access to a webhook app |
ApiAuthAccess | Grant access to an API auth app |
Creating Tickets
Impersonation Ticket
Allow an admin to impersonate another user:Agent Access Ticket
Grant access to specific AI agents with a concrete actor ID:Webhook App Access Ticket
Grant access to a webhook app:API Auth App Access Ticket
Grant access to an API auth app:With Custom Expiration
Set a custom expiration timestamp (Unix timestamp):Exchanging Tickets
Tickets are exchanged on the frontend using the session API:- Validates the ticket
- Creates the appropriate session (impersonation, agent, webhook, or API auth)
- Returns session details
- Deletes the ticket (single-use)
Exchange Response
The response varies by ticket type:Impersonation Response
Agent Access Response
Webhook App Access Response
API Auth App Access Response
Security Considerations
- Single-use: Tickets are deleted after exchange
- Expiration: Always set reasonable expiration times
- HTTPS: Only exchange tickets over secure connections
- Validation: The frontend validates deployment ID matches
Error Handling
Related
- API Keys Guide - Managing API auth apps
- Agents Guide - AI agent management
- Webhooks Guide - Webhook configuration
- API Reference - Session Tickets - Full API docs
