Leave Account

POST /v1/account/leave

Remove your own membership from the active account — the account your API key belongs to (or, with a session, the one you switched to). Your user and your other accounts are untouched; only this membership ends, and you lose access to the account and its resources. To remove someone else, use Remove Member.

The owner cannot leave: transfer ownership first, then leave. Any other member may leave — no role permission is needed beyond being a member.

Leaving also cleans up your credentials:

  • your API keys for this account are deleted — including the key that makes this call, so the request below is its last;
  • your agent auth tokens for this account are deleted;
  • every signed-in session of your user ends (session tokens are revoked), so the dashboard asks you to sign in again.

A suspended account can still be left by a non-owner member; its owner gets the suspension refusal.

Request body

None. Send the Content-Type: application/json header anyway — every POST without it is refused with 415.

Response (200 OK)

success boolean
true once your membership is removed.

Errors

401 Unauthorized
Missing or invalid auth.
403 Forbidden
No active account selected, Not a member of this account, or — for the owner of a suspended account — code account_suspended.
404 Not Found
You are not a member of this account — there is no active membership of yours to remove.
409 Conflict
The account owner cannot leave; transfer ownership first.
415 Unsupported Media Type
The Content-Type: application/json header is missing.
Request
curl -X POST "https://api.ngris.com/v1/account/leave" \ -H "X-API-KEY: <your_api_key>" \ -H "Content-Type: application/json"
Response — 200 OK
{ "success": true }
Response — 409 Conflict
{ "error": "The account owner cannot leave; transfer ownership first" }
On this page
Leave Account