Skip to main content

Setting up your account

Don't have credentials yet? Reach out to support@pleevi.ai!

Fetching an access token

To obtain an OAuth2 access token, you need to provide your client_id and client_secret.

Endpoint

POST /v1/identity/client-login

Request Headers

  • Authorization: Basic authentication header containing your client_id:client_secret base64 encoded.

Request Parameters

The request must include the following parameters in the body using the application/x-www-form-urlencoded format with UTF-8 encoding:

  • grant_type (REQUIRED): Must be set to the value client_credentials.

Request Example

curl -X POST "https://api.pleevi.ai/v1/identity/client-login" \
-u your_client_id:your_client_secret \
-d "grant_type=client_credentials"

Response

On successful authentication, the response will contain an OAuth2 access token.

{
"access_token": "your_access_token",
"type": "bearer",
"expires_in": 3600
}

Make sure to securely store your client_id and client_secret, and never expose them in your client-side code.

info

For any issues or further assistance, feel free to contact us at support@pleevi.ai.

Authenticating

All of our endpoints require this access_token. It should be included in the Authorization header in the Bearer format

For example, to retrieve a site (see later):

curl -X 'GET' \
'https://api.pleevi.ai/v1/sites/<SITE_ID>' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-H 'Authorization: Bearer <YOUR_ACCESS_TOKEN>'