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 Mihu workspace URL (e.g., if your URL is https://abc.mihu.ai, your tenant is abc).
You’ll need an Agent ID to initiate calls. You can find your agents in the Mihu 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 Mihu 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:
boolean
Indicates whether the call was initiated successfully
string
A human-readable message describing the result
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

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: