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

# Logout

> Este endpoint revoga os tokens de acesso e de atualização atuais do usuário.

## POST /auth/logout

Este endpoint invalida a sessão revogando todos os refresh tokens do usuário. Exige um access token válido no cabeçalho Authorization.

<Warning>
  Os access tokens permanecem válidos até expirarem (15 minutos). Para encerrar a sessão de imediato no cliente, limpe também o access token localmente.
</Warning>

### Cabeçalhos da requisição

<ParamField header="Authorization" type="string" required>
  Token Bearer. Formato: `Bearer YOUR_ACCESS_TOKEN`
</ParamField>

### Resposta

<ResponseField name="success" type="boolean">
  Indica se o logout foi bem-sucedido.
</ResponseField>

<ResponseField name="message" type="string">
  Mensagem de confirmação.
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.llmgenerator.com/api/v1/auth/logout \
    -H "Authorization: Bearer YOUR_ACCESS_TOKEN"
  ```

  ```javascript Node.js theme={null}
  const response = await fetch('https://api.llmgenerator.com/api/v1/auth/logout', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_ACCESS_TOKEN'
    }
  });

  const data = await response.json();
  ```
</RequestExample>

<ResponseExample>
  ```json Sucesso (200) theme={null}
  {
    "success": true,
    "message": "Logout successful. All refresh tokens have been revoked."
  }
  ```

  ```json Não autorizado (401) theme={null}
  {
    "message": "Authorization header required"
  }
  ```
</ResponseExample>
