Skip to content

Auth Token

Generates a JWT token for authentication in all other API requests.

Endpoint

POST /api/v2/external/auth-token

Headers

HeaderValueRequired
Content-Typeapplication/jsonYes

Request Body

FieldTypeRequiredDescription
client_idstringYesAPI Key identifier
client_secretstringYesAPI Key secret
json
{
  "client_id": "your-api-key-id",
  "client_secret": "your-api-key-secret"
}

Example

bash
curl -X POST https://api.owem.com.br/api/v2/external/auth-token \
  -H "Content-Type: application/json" \
  -d '{
    "client_id": "your-api-key-id",
    "client_secret": "your-api-key-secret"
  }'

Response 200

json
{
  "worked": true,
  "access_token": "eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 3600
}
FieldTypeDescription
workedbooleanIndicates operation success
access_tokenstringJWT token for use in headers
token_typestringAlways Bearer
expires_inintegerValidity in seconds (3600 = 60 minutes)

Response 401

json
{
  "worked": false,
  "detail": "Invalid credentials"
}

Using the Token

Include the token in the Authorization header of all subsequent requests:

Authorization: Bearer eyJhbGciOiJIUzUxMiIsInR5cCI6IkpXVCJ9...

Validity

The token expires in 60 minutes. Implement automatic renewal before expiration.

Owem Pay Instituição de Pagamento — ISPB 37839059