End a staff member’s read-only view
const url = 'https://api.sloose.com/auth/impersonation/end';const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.sloose.com/auth/impersonation/end \ --header 'Authorization: Bearer <token>'Ends the session a staff member opened to see this org as one of its members (POST /staff/orgs/{orgId}/impersonate), and writes the end down. The widget’s banner calls this; a view that is not ended runs out on its own after an hour. A session that is not such a view is refused with 409 NOT_IMPERSONATING.
Session only.
Authorizations
Section titled “Authorizations”Responses
Section titled “Responses”Ended.
object
Example
{ "ok": true}The session is unknown or expired (code: AUTH_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}An API token was used (code: SESSION_REQUIRED).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}This session is nobody’s view of anything (code: NOT_IMPERSONATING).
The error envelope every non-2xx answer uses.
object
Human-readable explanation.
Machine-readable reason. Absent on a few legacy 400s.
Examplegenerated
{ "error": "example", "code": "example"}