Skip to main content

Setup

Navigate to the settings page in Levers app, and scroll to the API keys section. Click on Add API key. Enter the name of the key and click Create. Copy the client id and client secret and save it in a secure manner.

Integration

API Authentication

Learn how to authenticate your API requests using your client credentials.

Quickstart Code

Get started with sample code for making your first API call.

API Authentication

To authenticate with the Levers API, you need to obtain a bearer token using your client credentials.

Step 1: Get Your Access Token

Important Token Behavior:
  • Dev environment: Tokens are valid for 24 hours
  • Production: Tokens are valid for 5 minutes
Issuing a new token will invalidate all existing tokens for the same client. Ensure your application handles re-authentication gracefully.

Step 2: Use the Access Token

Include the access token in the Authorization header for all subsequent API requests:

Quickstart Code

Install the following packages:
Create a .env file in the root directory of your project and add the following variables:
Create main.py in the root directory of your project and copy the following code into it:
Run the following command to execute the code:
You’ll see the following output:

Integrating AI Phone Calls

Learn how to integrate AI-powered phone calls for automated collections and customer communication.
1

Create Contact

First, create a contact that will receive the AI phone call.
For more details, see the Create Contact API reference.
2

Fetch Contacts

Retrieve your contacts to get the contact UUID for the AI phone call.
For more details, see the Get Contacts API reference.
3

Trigger AI Phone Call

Use the contact UUID to initiate an AI-powered phone call.
For more details, see the Call Contact API reference.