> ## Documentation Index
> Fetch the complete documentation index at: https://openloop.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Revoke a session

> End a patient session by revoking its refresh token, so the tokens issued with it stop working.

Ends a session started via the [User Registration](https://openloop.mintlify.site/api-reference/user-registration-guide.md) flow. See that guide's "Keeping the session alive" section.


## OpenAPI

````yaml post /auth/revoke
openapi: 3.1.0
info:
  title: OpenLoop API
  version: 0.1.0
  description: >-
    Unified reference for the OpenLoop Patient (clinical) and Payments & Revenue
    APIs.
servers:
  - url: https://api.openloophealth.com/v0.1
    description: Production partner edge
  - url: https://api-staging.openloophealth.com/v0.1
    description: Staging partner edge (sandbox credentials)
security: []
paths:
  /auth/revoke:
    post:
      tags:
        - Auth
      summary: Revoke a refresh token (logout)
      description: >-
        Revokes a refresh token's entire grant family, invalidating the session
        it belongs to.
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/AuthRevokeRequest'
      responses:
        '200':
          description: >-
            Revoked. An unknown token gets the same answer, so the response does
            not say whether anything was revoked.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/AuthRevokeResponse'
        '400':
          description: >-
            Validation error. Revoke also returns `400 VALIDATION_ERROR`, in the
            normal JSON envelope, when the `client_id` is unregistered or the
            client, its organization, or its customer is inactive. `POST
            /auth/token` returns `401` (unregistered) or `403` (inactive) for
            these causes, so do not reuse its status handling for revoke.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
        '401':
          description: >-
            Invalid client credentials, for example a wrong `client_secret` for
            a registered, active client.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/ErrorResponse'
components:
  schemas:
    AuthRevokeRequest:
      type: object
      required:
        - client_id
        - client_secret
        - token
      properties:
        client_id:
          type: string
        client_secret:
          type: string
        token:
          type: string
          description: Refresh token to revoke. Revokes the entire grant family (logout).
    AuthRevokeResponse:
      type: object
      required:
        - data
        - request_id
      properties:
        data:
          type: object
          description: Always an empty object.
        request_id:
          type: string
          format: uuid
          description: Correlation id echoed on every response.
    ErrorResponse:
      type: object
      properties:
        error:
          type: object
          properties:
            message:
              type: string
            error_code:
              type: string
          required:
            - message
            - error_code
        request_id:
          type: string
      required:
        - error
        - request_id

````

This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.