Skip to main content

Prerequisites

Before you begin, ensure you have:
You’ll need a valid API token. If you haven’t created one yet, follow the authentication guide to generate your token.
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).
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:
success
boolean
Indicates whether the call was initiated successfully
message
string
A human-readable message describing the result
data
object
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 CodeErrorSolution
400Bad RequestCheck your request body format and required fields
401UnauthorizedVerify your API token is correct
404Not FoundCheck your tenant subdomain and endpoint URL
422Validation ErrorReview 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

Complete Example

Here’s a complete working example that initiates a call and monitors its status: