Skip to main content
GET
/
session
/
ticket
/
exchange
Exchange session ticket
curl --request GET \
  --url https://api.wacht.dev/session/ticket/exchange \
  --cookie session_id=
{
  "success": true,
  "message": "Impersonation successful",
  "session_id": "123456789012345678",
  "context_group": "support-agents",
  "agents": [
    {
      "id": "12345",
      "name": "Support Agent",
      "description": "Handles customer support queries",
      "integrations": [
        {
          "id": "333333333333333333",
          "provider": "openai"
        }
      ]
    }
  ],
  "session": {
    "id": "123456789012345678",
    "created_at": "2024-01-15T10:30:00Z",
    "updated_at": "2024-01-15T10:30:00Z",
    "signin_attempts": [
      {
        "id": "555555555555555555",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z",
        "method": "email_otp",
        "completed": true,
        "current_step": "verify_otp"
      }
    ],
    "signins": [
      {
        "id": "987654321098765432",
        "user_id": "123456789012345678",
        "session_id": "123456789012345678",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z",
        "expires_at": "2024-01-15T11:30:00Z",
        "active_organization_membership_id": "111111111111111111",
        "active_workspace_membership_id": "222222222222222222",
        "active_organization_membership": {
          "id": "111111111111111111",
          "organization_id": "777777777777777777",
          "roles": [
            {
              "id": "888888888888888888",
              "name": "Admin",
              "permissions": [
                "organization:admin",
                "organization:manage"
              ]
            }
          ]
        },
        "active_workspace_membership": {
          "id": "222222222222222222",
          "workspace_id": "999999999999999999",
          "organization_membership_id": "111111111111111111",
          "roles": [
            {
              "id": "101010101010101010",
              "name": "Editor",
              "permissions": [
                "workspace:read",
                "workspace:write"
              ]
            }
          ]
        }
      }
    ],
    "signup_attempts": [
      {
        "id": "666666666666666666",
        "created_at": "2024-01-15T10:30:00Z",
        "updated_at": "2024-01-15T10:30:00Z"
      }
    ],
    "active_signin_id": "987654321098765432",
    "active_signin": {
      "id": "987654321098765432",
      "user_id": "123456789012345678",
      "session_id": "123456789012345678",
      "created_at": "2024-01-15T10:30:00Z",
      "updated_at": "2024-01-15T10:30:00Z",
      "expires_at": "2024-01-15T11:30:00Z",
      "active_organization_membership_id": "111111111111111111",
      "active_workspace_membership_id": "222222222222222222",
      "active_organization_membership": {
        "id": "111111111111111111",
        "organization_id": "777777777777777777",
        "roles": [
          {
            "id": "888888888888888888",
            "name": "Admin",
            "permissions": [
              "organization:admin",
              "organization:manage"
            ]
          }
        ]
      },
      "active_workspace_membership": {
        "id": "222222222222222222",
        "workspace_id": "999999999999999999",
        "organization_membership_id": "111111111111111111",
        "roles": [
          {
            "id": "101010101010101010",
            "name": "Editor",
            "permissions": [
              "workspace:read",
              "workspace:write"
            ]
          }
        ]
      }
    }
  }
}

Authorizations

session_id
string
cookie
required

Session-based authentication using cookies

Query Parameters

ticket
string
required

Session ticket to exchange

Response

Ticket exchanged successfully

success
boolean

Whether the ticket exchange was successful

Example:

true

message
string

Success or error message

Example:

"Impersonation successful"

session_id
string | null

Session ID (for agent access tickets)

Example:

"123456789012345678"

context_group
string | null

Context group for agent access

Example:

"support-agents"

agents
object[]

Available agents (for agent access tickets)

session
object

Updated session (for impersonation tickets)