Prerequisites
Before you begin, ensure you have:API Token
API Token
You’ll need a valid API token. If you haven’t created one yet, follow the authentication guide to generate your token.
Tenant ID
Tenant ID
Know your workspace tenant/subdomain. This is the subdomain in your Mindhunters workspace URL (e.g., if your URL is
https://abc.mindhunters.ai, your tenant is abc).Agent ID
Agent ID
You’ll need an Agent ID to initiate calls. You can find your agents in the Mindhunters dashboard under the Agents section. The Agent ID is a UUID format identifier.
Make Your First API Call
Let’s initiate an AI-powered voice call using the Mindhunters API. This example will show you how to start a conversation with a phone number.Step 1: Set Up Your Environment
First, set up your credentials as environment variables:Step 2: Initiate Your First Call
Step 3: Understanding the Response
When successful, you’ll receive a response like this:Indicates whether the call was initiated successfully
A human-readable message describing the result
Contains the call details
Advanced Call Options
You can customize your call with additional parameters:Checking Call Status
After initiating a call, you can check its status using the call ID:Handling Errors
Always implement proper error handling:Common Error Responses
| Status Code | Error | Solution |
|---|---|---|
| 400 | Bad Request | Check your request body format and required fields |
| 401 | Unauthorized | Verify your API token is correct |
| 404 | Not Found | Check your tenant subdomain and endpoint URL |
| 422 | Validation Error | Review the error message for invalid parameters |
Next Steps
Congratulations! You’ve made your first API call. Here’s what to explore next:Set Up Webhooks
Receive real-time updates about your calls
Explore API Reference
Discover all available endpoints and features
Monitor API Usage
Track your API requests and responses
Error Handling
Learn about error codes and troubleshooting
