Skip to content

End the current admin-impersonation session

POST
/auth/impersonation/end

Revokes the current impersonation session + issues a fresh session for the original admin so the response leaves the caller signed in as themselves. No-op (400) when the current session is not an impersonation.

Audit emits admin.impersonation.ended with subject = target, actor = admin.

Impersonation ended + admin session restored.

object
admin_user_ref
required

The original admin’s ref — confirms who the caller is now signed in as after the rotation.

integer format: int64
admin_username
required
string

Current session is not an impersonation.

object
error
required

Human-readable error summary

string
Example
the request could not be completed

Authentication required, missing, or invalid

object
error
required

Human-readable error summary

string
Example
the request could not be completed
Example
{
"error": "authentication required: sign in and retry with a valid session or API token"
}