End impersonation
POST /auth/impersonation/end
Ends the impersonation you’re in and signs you back in as yourself with a new session cookie.
Send it with the impersonation session’s cookie; no capability is checked. The server first tries to end the impersonation session, then creates a new session for your own account, with whatever capabilities that account has now. If ending the old session fails, that’s only logged and you still get the new one. If creating the new session fails you get a 500 and no new cookie: you’re signed out if the old session was ended, and still impersonating if it wasn’t.
A 400 means the current session isn’t an impersonation. An API token
in Authorization still takes precedence over the cookie on later
requests. Ending is recorded in the audit log as
admin.impersonation.ended on a best-effort basis.
Authorizations
Section titled “Authorizations ”Responses
Section titled “ Responses ”Impersonation ended. The response sets your new session cookie.
object
Your own user ref: the account you’re signed in as now.
Current session is not an impersonation.
object
Human-readable error summary
Example
the request could not be completedAuthentication required, missing, or invalid
object
Human-readable error summary
Example
the request could not be completedExample
{ "error": "authentication required: sign in and retry with a valid session or API token"}