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

# Autenticar e obter token

> Autentica um usuário via OAuth2 Password Grant e retorna o access_token e refresh_token.

## Request Body

<ParamField body="client_id" type="string" required>
  ID do cliente OAuth. **Exemplo**: `1`
</ParamField>

<ParamField body="client_secret" type="string" required>
  Segredo do cliente OAuth. **Exemplo**: `sua-client-secret`
</ParamField>

<ParamField body="username" type="string" required>
  Nome de usuário. **Exemplo**: `vsigner_adm@valid.com`
</ParamField>

<ParamField body="password" type="string" required>
  Senha do usuário. **Exemplo**: `homolog`
</ParamField>

## Response

<ResponseField name="token_type" type="string">
  Tipo do token. **Exemplo**: `Bearer`
</ResponseField>

<ResponseField name="expires_in" type="integer">
  Tempo de expiração em segundos. **Exemplo**: `3600`
</ResponseField>

<ResponseField name="access_token" type="string">
  Token de acesso JWT. **Exemplo**: `eyJ0eXAiOiJKV1Qi...`
</ResponseField>

<ResponseField name="refresh_token" type="string">
  Token para atualização. **Exemplo**: `def50200...`
</ResponseField>

<ResponseExample>
  ```json 200 OK theme={"theme":"catppuccin-latte"}
  {
    "token_type": "Bearer",
    "expires_in": 3600,
    "access_token": "eyJ0eXAiOiJKV1Qi...",
    "refresh_token": "def50200..."
  }
  ```

  ```json 400 Requisição inválida theme={"theme":"catppuccin-latte"}
  ```

  ```json 401 Credenciais inválidas theme={"theme":"catppuccin-latte"}
  ```
</ResponseExample>
