Create access token
POST
/v1/auth
const url = 'https://sender.api.kivra.com/v1/auth';const options = { method: 'POST', headers: { Authorization: 'Basic <credentials>', 'Content-Type': 'application/x-www-form-urlencoded' }, body: new URLSearchParams({grant_type: 'client_credentials'})};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://sender.api.kivra.com/v1/auth \ --header 'Authorization: Basic <credentials>' \ --header 'Content-Type: application/x-www-form-urlencoded' \ --data grant_type=client_credentialsAuthenticate with OAuth 2.0 client credentials to obtain an access token for Partner API requests.
See the Partner API authentication guide for details. Tenant integrations use the same endpoint; see the Tenant API authentication guide.
Authorizations
Section titled “Authorizations”Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/x-www-form-urlencoded
object
grant_type
required
string
Responses
Section titled “Responses”Access token created
Media typeapplication/json
TokenResponse
object
access_token
required
OAuth 2.0 access token.
string
token_type
required
Token type to use in the Authorization header.
string
expires_in
required
Lifetime of the access token in seconds.
integer
Examplegenerated
{ "access_token": "example", "token_type": "example", "expires_in": 1}The request body is invalid.
The client credentials are invalid.