Skip to content

Create impersonation session request

POST/tenants/{tenant_id}/impersonations

Creates a new admin impersonation session request for a tenant, targeting a specific user account. Requires admin password re-confirmation (current_password), a support ticket reference, and a stated reason. Scope determines the access level granted. Depending on platform configuration, the session may require a second admin to approve before a start_url is issued.

Request

Path parameters

NameTypeRequiredDescription
tenant_idstringYes

The tenant identifier.

Request body

Content type application/json (required).

FieldTypeRequiredDescription
target_user_idintegerYes

ID of the tenant user account to impersonate (must be a valid user in the tenant's user table).

Minimum: 1

scopestringYes

Access scope to request — always use the minimum scope necessary.

One of: "readonly", "limited_write", "full_user"

reasonstringYes

Business justification for the impersonation (displayed in the audit log and approval queue).

Max length: 2000

ticket_refstringYes

Support or incident ticket reference that authorises this access.

Max length: 120

notesstring, nullableNo

Additional context for the approver.

Max length: 2000

current_passwordstringYes

The requesting admin's current password for re-authentication confirmation.

Min length: 6

Example

{
  "target_user_id": 12,
  "scope": "readonly",
  "reason": "Customer reported incorrect invoice total — investigating billing module state.",
  "ticket_ref": "SUP-2026-0042",
  "notes": "Customer confirmed they have not made any changes since the issue appeared.",
  "current_password": "AdminPassword2026!"
}

Responses

201 Impersonation session created. If auto-approval is configured, the response includes an impersonation_start_url. Otherwise, a second admin must approve via the /approve endpoint

Content type application/json, object · ImpersonationSessionResponseV1.

FieldTypeRequiredDescription
session_idstringNo

Unique identifier for the created or approved session.

statusstringNo

Current status of the session.

One of: "pending", "approved"

impersonation_start_urlstring, nullableNo

Time-limited URL the requesting admin uses to enter the tenant workspace. Null while the session is still pending approval. The URL contains a single-use signed token that expires after 15 minutes.

messagestringNo

Human-readable outcome message.

Example

{
  "session_id": "imp_01HXN8K2V3PABC",
  "status": "pending",
  "impersonation_start_url": null,
  "message": "Impersonation request created and awaiting approval."
}

401 current_password is incorrect

404 Tenant or target_user_id not found

422 Validation failed — check scope enum, ticket_ref, or reason length

Example request

Paths are relative to the control-plane API base URL ($BASE_URL below).

curl -X POST "$BASE_URL/tenants/{tenant_id}/impersonations" \
  -H "Accept: application/json" \
  -H "Content-Type: application/json" \
  -d '{"target_user_id": 12, "scope": "readonly", "reason": "Customer reported incorrect invoice total — investigating billing module state.", "ticket_ref": "SUP-2026-0042", "notes": "Customer confirmed they have not made any changes since the issue appeared.", "current_password": "AdminPassword2026!"}'
Loading