Skip to main content

Authentication

All API endpoints are authenticated using JWT tokens. Levers uses your client_id and client_secret keys to control access to our API. You can find your keys in your settings page. To generate a new access token follow the steps below:
curl -X 'POST' \
  'https://api.dev.uselevers.com/auth/v1/api-key/auth' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "clientId": "<YOUR_CLIENT_ID>",
  "clientSecret": "<YOUR_CLIENT_SECRET>"
}'
In response to the above request you’ll receive an access token which can be used to authenticate the API endpoints.
{
  "access_token": "eyJhbGciOiJFUzUxMiIsInR5cRI6IkpXVCJ9.eyJ1dWlkIjoi8jdmZWJiYWYtMzJiYi00YzgxLWE0MTgtZGJhZTU3YzIxMakdmlakwmdlkasmldkxldmVycy5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiZmlyc3Rfbmk1NnYyhvFf_YQAlQ4vWO_hC2O_pVPwi142xrsLahn_t-jJzoRRscO8jBAwstkrXVOycIOUvvCE"
}
Use the access token to authenticate an API endpoint
curl -X 'GET' \
  'https://api.dev.uselevers.com/api-service/v1/contact?page=1&size=50' \
  -H 'accept: application/json' \
  -H 'Authorization: Bearer eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyJ1dWlkIjoiZjdmZWJiYWYtMzJiYi00YzgxLWE0MTgtZGJhZTU3YzIxMakdmlaksmdlkasmldkxldmVycy5jb20iLCJlbWFpbF92ZXJpZmllZCI6dHJ1ZSwiZmlyc3Rfbmk1NnYyhvFf_YQAlQ4vWO_hC2O_pVPwi142xrsLahn_t-jJzoRRscO8jBAwstkrXVOycIOUvvCE'