Skip to Content
ZITADEL Docs
APIsCore ResourcesV2Session

DeleteSession

Terminate an existing session. This invalidates the session and its token. The session can no longer be used for the authentication of other resources or to authenticate against the Zitadel APIs.

You can only terminate your own session, unless you are granted the session.delete permission.

Required permissions:

  • session.delete
  • no permission required for own sessions or when providing the current session token

Possible error slugs include (non-exhaustive):

  • "request.invalid" when required fields such as the session ID are missing or invalid
  • "auth.missing_permission" when the caller does not have the required permissions to delete the session
  • "session.token_invalid" when the provided session token is invalid
DELETE
/v2/sessions/{session_id}

Path Parameters

session_id*session_id

The unique identifier of the session to be terminated.

Request Body

application/json
  1. body
sessionToken?|

The current token of the session, previously returned on the create / update request. The token is required unless either of the following conditions is met:

  • the caller created the session
  • the authenticated user requests their own session (checked user)
  • the security token provided in the authorization header has the same user agent as the session
  • the caller is granted the permission session.delete permission on either the instance or on the checked user's organization

Response Body

Success

application/json
  1. response
details?
Example Request
curl -X DELETE 'https://example.com/v2/sessions/string' \  -H 'Content-Type: application/json' \  -d '{}'
Example Response200
{  "details": {    "sequence": 0,    "changeDate": "2023-01-15T01:30:15.01Z",    "resourceOwner": "string",    "creationDate": "2023-01-15T01:30:15.01Z"  }}

Was this page helpful?