Skip to Content
AutenticaçãoEmitir token de acesso

Emitir token de acesso

POST/v1/oauth/token

Troca client_id + client_secret por um JWT de 10 min (sem refresh). Endpoint público. O campo grant_type é obrigatório e deve ser client_credentials (senão: 400 ERRO_VALIDACAO).

Corpo da requisição
grant_typestringobrigatório
client_idstringobrigatório
mín. 1 car.
client_secretstringobrigatório
mín. 1 car.
Respostas
200Token emitido.
400Dados inválidos (`ERRO_VALIDACAO`).
401Token ausente ou inválido (`CREDENCIAL_INVALIDA`).
Request
curl -X POST 'http://localhost:3101/v1/oauth/token' \
  -H 'Content-Type: application/json' \
  -d '{
  "grant_type": "string",
  "client_id": "string",
  "client_secret": "string"
}'
Response
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.<payload>.<assinatura>",
  "token_type": "Bearer",
  "expires_in": 600
}