AuthenticationGet access token

Get access token

Returns a JWT access token using OAuth 2.0 Client Credentials. Send api_key and api_secret in the Authorization: Basic header as the base64-encoded string api_key:api_secret.

Credentials are managed in Conta Simples Internet Banking.

Important:

  • The token expires in 30 minutes (expires_in: 1800).
  • Refresh the token before it expires to avoid interruptions.
  • Use Content-Type: application/x-www-form-urlencoded in the body (only grant_type=client_credentials).
curl -X POST "https://api-sandbox.contasimples.com/oauth/v1/access-token" \
  -H "Content-Type: application/x-www-form-urlencoded" \
  -H "Authorization: Basic YOUR_CREDENTIALS" \
  --data-urlencode grant_type=client_credentials
{
  "access_token": "eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCJ9...",
  "token_type": "Bearer",
  "expires_in": 1800
}
POST
/oauth/v1/access-token
POST
Base URLstring

Target server for requests. Edit to use your own host.

Basic Authentication
Usernamestring
Required

Username for basic authentication

Passwordpassword
Required

Password for basic authentication

API key and API secret as api_key:api_secret, base64-encoded. Header: Authorization: Basic {base64(api_key:api_secret)}
Content-Typestring
Required

The media type of the request body

Options: application/x-www-form-urlencoded
grant_typestring
Required

OAuth 2.0 grant type. Always client_credentials.

Options: client_credentials
Request Preview
Response

Response will appear here after sending the request

Authentication

header
Authorizationstring
Required

Basic authentication credentials. API key and API secret as api_key:api_secret, base64-encoded. Header: Authorization: Basic \{base64(api_key:api_secret)\}

Body

application/x-www-form-urlencoded
grant_typestring
Required

OAuth 2.0 grant type. Always client_credentials.

Allowed values:client_credentials

Responses

access_tokenstring
Required

JWT used to call the API. Pass it as Authorization: Bearer {token}.

token_typestring
Required

Token type. Always Bearer.

Allowed values:Bearer
expires_ininteger
Required

Token lifetime in seconds. Default: 1800 (30 minutes).