Skip to main content
POST
/
api
/
auth
/
token
Gerar token de acesso JWT
curl --request POST \
  --url https://api.avista.global/api/auth/token \
  --header 'Content-Type: application/json' \
  --header 'X-SSL-Client-Cert: <x-ssl-client-cert>' \
  --data '
{
  "clientId": "account-93-550e8400",
  "clientSecret": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"
}
'
{
  "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 1800
}
Este endpoint gera um token JWT de acesso válido por 30 minutos (1800 segundos). Requer certificado X.509 vinculado à conta e credenciais OAuth 2.0.
O certificado X.509 deve ser enviado URL-encoded no header X-SSL-Client-Cert. O certificado deve estar previamente vinculado à sua conta.

Headers

X-SSL-Client-Cert
string
required

Certificado PEM do cliente codificado em URL (header padrão do NGINX)

Example:

"-----BEGIN%20CERTIFICATE-----%0AMIIBkTCB..."

Body

application/json
clientId
string
required

OAuth 2.0 client ID obtido da criação de credencial

Example:

"account-93-550e8400"

clientSecret
string
required

OAuth 2.0 client secret (8-64 caracteres)

Example:

"a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6"

Response

Token gerado com sucesso

access_token
string
required

JWT access token

Example:

"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9..."

token_type
string
required

Tipo do token

Example:

"Bearer"

expires_in
number
required

Tempo de expiração do token em segundos

Example:

1800