API Stability Long-Term

The revokeSession() GraphQL mutation is used to revoke a specified session. It can revoke a single session, all sessions for a user, or all sessions in an organization.

For information on session management, see the Session management documentation page. You may also want to look at session().

Syntax

Below is the syntax for the revokeSession() mutation field:

graphql
revokeSession(
     input: RevokeSessionInput!
   ): boolean!

Below is an example of how this mutation field might be used:

Show:
graphql
mutation {
  revokeSession( input: {
     id: "ZI14EqR5x8AHSJeBQLm6FfZmjLXOOKOU",
     revocationType: Session
  } )
}
Example Responses
Show:
json
{
  "data": {
    "revokeSession": true
  }
}

The id for the input is the unique identifier for the session.

Given Datatypes

For RevokeSessionInput, there are a couple of parameters. Below is a list of them along with a description of each:

Table: RevokeSessionInput

ParameterTypeRequiredDefaultStabilityDescription
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column.
Table last updated: Sep 19, 2024
idstringyes Long-TermThe unique identifier of the session.
revocationTypeSessionRevocation__Typeyes Long-TermThe type of revocation. This is an enumerated list: Organization, User, or Session. See SessionRevocation__Type.