Skip to content

End a user's session

DELETE
/admin/users/{ref}/sessions/{id}

Signs a user out of one session. Use an id from GET /admin/users/{ref}/sessions; a 404 means it isn’t that user’s or was already revoked, not just expired. You need users.write, which users.read doesn’t include.

Their next request with that session’s cookie fails, but a request already in progress finishes, and their other sessions and API tokens keep working. Any session can be ended, including an administrator’s or your own. It’s recorded in the audit log as session.revoked, naming you and the user, on a best-effort basis.

ref
required
integer format: int64
id
required
string format: uuid

The session’s id, from GET /admin/users/{ref}/sessions.

The session has ended.

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"
}

Authenticated but missing required capabilities

object
error
required

Human-readable error summary

string
Example
the request could not be completed

Resource not found

object
error
required

Human-readable error summary

string
Example
the request could not be completed