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

# Log out

> Log out, invalidating the API session token.



## OpenAPI

````yaml /openapi/cluster-api-v2.json post /logout/
openapi: 3.0.0
info:
  description: >-
    REST API for querying information about CockroachDB cluster health, nodes,
    ranges,

    sessions, and other meta information. For additional details, see
    cockroachlabs.com/docs/stable/cluster-api.
  title: CockroachDB v2 API
  license:
    name: Business Source License
  version: '2.0'
  x-logo:
    url: https://www.cockroachlabs.com/docs/images/cockroachlabs-logo-170.png
    backgroundColor: '#FFFFFF'
    altText: Cockroach Labs logo
servers:
  - url: https://localhost/api/v2
  - url: http://localhost/api/v2
security: []
paths:
  /logout/:
    post:
      summary: Log out
      description: Log out, invalidating the API session token.
      operationId: logout
      responses:
        '200':
          description: Logout response.
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/logoutResponse'
        '400':
          description: >-
            Bad request, returned if API session token is not present or
            invalid.
      security:
        - api_session: []
      x-codeSamples:
        - lang: curl
          source: |-
            curl --request POST \
              --url https://localhost/api/v2/logout/ \
              --header 'X-Cockroach-API-Session: REPLACE_KEY_VALUE'
components:
  schemas:
    logoutResponse:
      type: object
      properties:
        logged_out:
          description: Indicates whether logout was succeessful.
          type: boolean
          x-go-name: LoggedOut
      x-go-package: github.com/cockroachdb/cockroach/pkg/server
  securitySchemes:
    api_session:
      description: >-
        Token for logged-in REST session. Use `/login/` to log in and get a
        session token. For additional information, see
        cockroachlabs.com/docs/stable/cluster-api.
      type: apiKey
      name: X-Cockroach-API-Session
      in: header

````