Initiate a new call
curl --request POST \
--url https://{subdomain}.mihu.ai/api/v1/call \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "32d8fc98-be1e-4d32-a12e-146f397fb1cb2",
"prompt": {
"overwrite": true,
"content": "You are Micheal from the support team. You are calling about the issue with the order get order from the customer."
},
"participant": {
"number": "+12345678900",
"about": "The customer named John Doe.\\n He is a regular customer\\nHis order number is 12345."
},
"message": {
"start": "Hello there!This is a test call.How can help you today?"
}
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/call"
payload = {
"agentId": "32d8fc98-be1e-4d32-a12e-146f397fb1cb2",
"prompt": {
"overwrite": True,
"content": "You are Micheal from the support team. You are calling about the issue with the order get order from the customer."
},
"participant": {
"number": "+12345678900",
"about": "The customer named John Doe.\n He is a regular customer\nHis order number is 12345."
},
"message": { "start": "Hello there!This is a test call.How can help you today?" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: '32d8fc98-be1e-4d32-a12e-146f397fb1cb2',
prompt: {
overwrite: true,
content: 'You are Micheal from the support team. You are calling about the issue with the order get order from the customer.'
},
participant: {
number: '+12345678900',
about: 'The customer named John Doe.\n He is a regular customer\nHis order number is 12345.'
},
message: {start: 'Hello there!This is a test call.How can help you today?'}
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/call', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.mihu.ai/api/v1/call",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agentId' => '32d8fc98-be1e-4d32-a12e-146f397fb1cb2',
'prompt' => [
'overwrite' => true,
'content' => 'You are Micheal from the support team. You are calling about the issue with the order get order from the customer.'
],
'participant' => [
'number' => '+12345678900',
'about' => 'The customer named John Doe.\\n He is a regular customer\\nHis order number is 12345.'
],
'message' => [
'start' => 'Hello there!This is a test call.How can help you today?'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.mihu.ai/api/v1/call"
payload := strings.NewReader("{\n \"agentId\": \"32d8fc98-be1e-4d32-a12e-146f397fb1cb2\",\n \"prompt\": {\n \"overwrite\": true,\n \"content\": \"You are Micheal from the support team. You are calling about the issue with the order get order from the customer.\"\n },\n \"participant\": {\n \"number\": \"+12345678900\",\n \"about\": \"The customer named John Doe.\\\\n He is a regular customer\\\\nHis order number is 12345.\"\n },\n \"message\": {\n \"start\": \"Hello there!This is a test call.How can help you today?\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.mihu.ai/api/v1/call")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"32d8fc98-be1e-4d32-a12e-146f397fb1cb2\",\n \"prompt\": {\n \"overwrite\": true,\n \"content\": \"You are Micheal from the support team. You are calling about the issue with the order get order from the customer.\"\n },\n \"participant\": {\n \"number\": \"+12345678900\",\n \"about\": \"The customer named John Doe.\\\\n He is a regular customer\\\\nHis order number is 12345.\"\n },\n \"message\": {\n \"start\": \"Hello there!This is a test call.How can help you today?\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"32d8fc98-be1e-4d32-a12e-146f397fb1cb2\",\n \"prompt\": {\n \"overwrite\": true,\n \"content\": \"You are Micheal from the support team. You are calling about the issue with the order get order from the customer.\"\n },\n \"participant\": {\n \"number\": \"+12345678900\",\n \"about\": \"The customer named John Doe.\\\\n He is a regular customer\\\\nHis order number is 12345.\"\n },\n \"message\": {\n \"start\": \"Hello there!This is a test call.How can help you today?\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Call created successfully",
"data": {
"id": "some-call-id",
"agentId": "32d8fc98-be1e-4d32-a12e-146f397fb1cb2",
"status": "success",
"conversation_uuid": "bfb5a86b-83df-4602-b046-c26c5b216df5",
"contact_uuid": "746b5a86b-83df-4602-b046-c26c5b216df5",
"listen_url": "<string>",
"record_url": "<string>"
}
}{
"success": false,
"message": "Agent not found",
"data": [
"<unknown>"
]
}{
"success": false,
"message": "The agentId field is required. | The participant.number field is required.",
"data": [
"<unknown>"
]
}{
"success": false,
"message": "An unexpected error occurred.",
"data": [
"<unknown>"
]
}Call
Initiate a new call
Initiates a call if the specified agent exists, has valid call settings, and the participant’s phone number is provided. The call can include a custom greeting message, a prompt to guide the agent, and optional details about the participant. This endpoint is used to trigger outbound calls with specific configurations for agents and participants.
POST
/
api
/
v1
/
call
Initiate a new call
curl --request POST \
--url https://{subdomain}.mihu.ai/api/v1/call \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"agentId": "32d8fc98-be1e-4d32-a12e-146f397fb1cb2",
"prompt": {
"overwrite": true,
"content": "You are Micheal from the support team. You are calling about the issue with the order get order from the customer."
},
"participant": {
"number": "+12345678900",
"about": "The customer named John Doe.\\n He is a regular customer\\nHis order number is 12345."
},
"message": {
"start": "Hello there!This is a test call.How can help you today?"
}
}
'import requests
url = "https://{subdomain}.mihu.ai/api/v1/call"
payload = {
"agentId": "32d8fc98-be1e-4d32-a12e-146f397fb1cb2",
"prompt": {
"overwrite": True,
"content": "You are Micheal from the support team. You are calling about the issue with the order get order from the customer."
},
"participant": {
"number": "+12345678900",
"about": "The customer named John Doe.\n He is a regular customer\nHis order number is 12345."
},
"message": { "start": "Hello there!This is a test call.How can help you today?" }
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
agentId: '32d8fc98-be1e-4d32-a12e-146f397fb1cb2',
prompt: {
overwrite: true,
content: 'You are Micheal from the support team. You are calling about the issue with the order get order from the customer.'
},
participant: {
number: '+12345678900',
about: 'The customer named John Doe.\n He is a regular customer\nHis order number is 12345.'
},
message: {start: 'Hello there!This is a test call.How can help you today?'}
})
};
fetch('https://{subdomain}.mihu.ai/api/v1/call', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://{subdomain}.mihu.ai/api/v1/call",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POSTFIELDS => json_encode([
'agentId' => '32d8fc98-be1e-4d32-a12e-146f397fb1cb2',
'prompt' => [
'overwrite' => true,
'content' => 'You are Micheal from the support team. You are calling about the issue with the order get order from the customer.'
],
'participant' => [
'number' => '+12345678900',
'about' => 'The customer named John Doe.\\n He is a regular customer\\nHis order number is 12345.'
],
'message' => [
'start' => 'Hello there!This is a test call.How can help you today?'
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://{subdomain}.mihu.ai/api/v1/call"
payload := strings.NewReader("{\n \"agentId\": \"32d8fc98-be1e-4d32-a12e-146f397fb1cb2\",\n \"prompt\": {\n \"overwrite\": true,\n \"content\": \"You are Micheal from the support team. You are calling about the issue with the order get order from the customer.\"\n },\n \"participant\": {\n \"number\": \"+12345678900\",\n \"about\": \"The customer named John Doe.\\\\n He is a regular customer\\\\nHis order number is 12345.\"\n },\n \"message\": {\n \"start\": \"Hello there!This is a test call.How can help you today?\"\n }\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://{subdomain}.mihu.ai/api/v1/call")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"agentId\": \"32d8fc98-be1e-4d32-a12e-146f397fb1cb2\",\n \"prompt\": {\n \"overwrite\": true,\n \"content\": \"You are Micheal from the support team. You are calling about the issue with the order get order from the customer.\"\n },\n \"participant\": {\n \"number\": \"+12345678900\",\n \"about\": \"The customer named John Doe.\\\\n He is a regular customer\\\\nHis order number is 12345.\"\n },\n \"message\": {\n \"start\": \"Hello there!This is a test call.How can help you today?\"\n }\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://{subdomain}.mihu.ai/api/v1/call")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"agentId\": \"32d8fc98-be1e-4d32-a12e-146f397fb1cb2\",\n \"prompt\": {\n \"overwrite\": true,\n \"content\": \"You are Micheal from the support team. You are calling about the issue with the order get order from the customer.\"\n },\n \"participant\": {\n \"number\": \"+12345678900\",\n \"about\": \"The customer named John Doe.\\\\n He is a regular customer\\\\nHis order number is 12345.\"\n },\n \"message\": {\n \"start\": \"Hello there!This is a test call.How can help you today?\"\n }\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"message": "Call created successfully",
"data": {
"id": "some-call-id",
"agentId": "32d8fc98-be1e-4d32-a12e-146f397fb1cb2",
"status": "success",
"conversation_uuid": "bfb5a86b-83df-4602-b046-c26c5b216df5",
"contact_uuid": "746b5a86b-83df-4602-b046-c26c5b216df5",
"listen_url": "<string>",
"record_url": "<string>"
}
}{
"success": false,
"message": "Agent not found",
"data": [
"<unknown>"
]
}{
"success": false,
"message": "The agentId field is required. | The participant.number field is required.",
"data": [
"<unknown>"
]
}{
"success": false,
"message": "An unexpected error occurred.",
"data": [
"<unknown>"
]
}Authorizations
Body
application/json
Response
Success
