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

# Logout User

> Logout a user by invalidating all their authentication tokens. This forces the user to log in again on their next request.



## OpenAPI

````yaml /openapi.yaml post /users/{external_id}/logout
openapi: 3.0.0
info:
  title: Answering Agent API
  description: API for Answering Agent platform
  version: 1.0.0
servers:
  - url: https://answeringagent.com/api/v1
    description: Production API
  - url: https://playground.answeringagent.com/api/v1
    description: Playground API
security: []
paths:
  /users/{external_id}/logout:
    post:
      tags:
        - Users
      summary: Logout User
      description: >-
        Logout a user by invalidating all their authentication tokens. This
        forces the user to log in again on their next request.
      operationId: logoutUser
      parameters:
        - in: path
          name: external_id
          required: true
          schema:
            type: string
          description: The external ID of the user to logout
      responses:
        '200':
          description: User logged out successfully.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: User logged out successfully
                  user_id:
                    type: string
                    description: The external ID of the user
                    example: customer_123
        '401':
          $ref: '#/components/responses/Unauthorized'
        '404':
          description: User not found.
          content:
            application/json:
              schema:
                type: object
                properties:
                  message:
                    type: string
                    example: User not found
      security:
        - ApiKeyAuth: []
components:
  responses:
    Unauthorized:
      description: Missing or invalid API key
      content:
        application/json:
          schema:
            type: object
            properties:
              error:
                type: string
                example: API key is required
                enum:
                  - API key is required
                  - Invalid credentials
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-KEY

````