POST
/
auth
Obtain a JWT Access Token
curl --request POST \
  --url https://api.customer.com/sarvam/byok/v1/auth \
  --header 'Authorization: Basic <encoded-value>' \
  --header 'Content-Type: application/x-www-form-urlencoded' \
  --header 'x-request-id: <x-request-id>' \
  --header 'x-request-timestamp: <x-request-timestamp>' \
  --data grant_type=client_credentials
{
  "data": {
    "access_token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c",
    "token_type": "Bearer",
    "expires_in": 3600
  }
}

Authorizations

Authorization
string
header
required

HTTP Basic authentication for the /auth endpoint, using the Client ID as the username and the Client Secret as the password.

Headers

x-request-id
string<uuid>
required

A unique identifier for this specific API call, generated by the client (Samvaad).

x-trace-id
string<uuid>

An identifier to trace a single request across multiple services.

x-request-timestamp
string<date-time>
required

The ISO 8601 timestamp of when the client sent the request.

Body

application/x-www-form-urlencoded

The request body must specify the grant type as 'client_credentials'.

grant_type
string
required

The OAuth2 grant type. Must be client_credentials.

Example:

"client_credentials"

Response

Authentication successful. Returns a JWT access token.

data
object
required

The response from a successful authentication request.