/impersonate/sessions/{session_id} - Get details for specific session

GET /impersonate/sessions/{session_id}

Retrieves details for a specific impersonation session. Users can only view sessions where they were impersonated. The session must belong to the requesting user.

Path parameters

  • session_id string Required

    Impersonation session ID

Responses

  • 200 application/json

    Session details retrieved successfully

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object
      Hide data attribute Show data attribute object
      • session object
        Hide session attributes Show session attributes object
        • session_id string

          Unique session identifier

        • impersonator_user_id string

          User ID of the person doing the impersonation

        • impersonated_user_id string

          User ID of the person being impersonated

        • impersonator_username string

          Username of the impersonator

        • impersonated_username string

          Username of the impersonated user

        • impersonator_name string

          Full name of the impersonator

        • impersonated_name string

          Full name of the impersonated user

        • start_time string(date-time)

          Session start timestamp

        • end_time string(date-time) | null

          Session end timestamp (null if still active)

        • duration_minutes integer | null

          Session duration in minutes (null if still active)

        • action_count integer

          Number of actions performed in this session

        • status string

          Session status

          Values are active or completed.

  • 400 application/json

    Missing or invalid session_id parameter

    Hide response attributes Show response attributes object
    • code integer

      HTTP error code

    • message string

      Error message

    • data object
      Hide data attributes Show data attributes object
      • type string

        Type of error

        Values are validation_error or external_api_error.

      • errors array[object]
        Hide errors attributes Show errors attributes object
        • key string

          Field name that failed validation

        • message string

          Error code or message

        • value string

          Value that failed validation

      • details

        Additional error details

  • 401 application/json

    Unauthorized - invalid or missing token

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
  • 404 application/json

    Session not found

    Hide response attributes Show response attributes object
    • code integer

      HTTP error code

    • message string

      Error message

    • data object
      Hide data attributes Show data attributes object
      • type string

        Type of error

        Values are validation_error or external_api_error.

      • errors array[object]
        Hide errors attributes Show errors attributes object
        • key string

          Field name that failed validation

        • message string

          Error code or message

        • value string

          Value that failed validation

      • details

        Additional error details

  • 500 application/json

    Internal server error

    Hide response attributes Show response attributes object
    • code integer
    • message string
    • data object | null
GET /impersonate/sessions/{session_id}
curl \
 --request GET 'https://api.your-domain.com/api/impersonate/sessions/sess_abc123def456' \
 --header "Authorization: Bearer $ACCESS_TOKEN"
Response examples (200)
{
  "code": 200,
  "message": "session details retrieved successfully",
  "data": {
    "session": {
      "session_id": "sess_abc123def456",
      "impersonator_user_id": "usr_owner_123",
      "impersonated_user_id": "usr_target_456",
      "impersonator_username": "owner@company.com",
      "impersonated_username": "customer@example.com",
      "impersonator_name": "John Doe",
      "impersonated_name": "Jane Smith",
      "start_time": "2025-09-02T14:30:00Z",
      "end_time": "2025-09-02T15:45:00Z",
      "duration_minutes": 75,
      "action_count": 24,
      "status": "completed"
    }
  }
}
Response examples (400)
{
  "code": 400,
  "message": "session_id parameter is required"
}
Response examples (401)
{
  "code": 401,
  "message": "invalid token",
  "data": {}
}
Response examples (404)
{
  "code": 404,
  "message": "session not found"
}
Response examples (500)
{
  "code": 500,
  "message": "internal server error",
  "data": {}
}