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

# Logout

> Revoke the caller's current access token.

``get_current_user`` authenticates the request (verifying the JWT and
checking revocation status).  We then look up the token's expiry from the
principal cache — it is always present after ``get_current_user`` runs —
and write the token hash to the revocation table.

The UI should also redirect the user through the WorkOS logout flow so
the session is terminated at the IdP level.



## OpenAPI

````yaml https://cp.xenovia.io/openapi.json post /api/v1/auth/logout
openapi: 3.1.0
info:
  title: controlplane
  version: 1.0.0
servers: []
security: []
paths:
  /api/v1/auth/logout:
    post:
      tags:
        - auth
      summary: Logout
      description: >-
        Revoke the caller's current access token.


        ``get_current_user`` authenticates the request (verifying the JWT and

        checking revocation status).  We then look up the token's expiry from
        the

        principal cache — it is always present after ``get_current_user`` runs —

        and write the token hash to the revocation table.


        The UI should also redirect the user through the WorkOS logout flow so

        the session is terminated at the IdP level.
      operationId: logout_api_v1_auth_logout_post
      parameters:
        - name: Authorization
          in: header
          required: false
          schema:
            anyOf:
              - type: string
              - type: 'null'
            title: Authorization
      responses:
        '204':
          description: Successful Response
        '422':
          description: Validation Error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/HTTPValidationError'
components:
  schemas:
    HTTPValidationError:
      properties:
        detail:
          items:
            $ref: '#/components/schemas/ValidationError'
          type: array
          title: Detail
      type: object
      title: HTTPValidationError
    ValidationError:
      properties:
        loc:
          items:
            anyOf:
              - type: string
              - type: integer
          type: array
          title: Location
        msg:
          type: string
          title: Message
        type:
          type: string
          title: Error Type
        input:
          title: Input
        ctx:
          type: object
          title: Context
      type: object
      required:
        - loc
        - msg
        - type
      title: ValidationError

````