Create a Campaign
curl --request POST \
--url https://api.getmalakai.com/campaigns/outbound \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'x-access-token: <x-access-token>' \
--data '
{
"campaign_name": "<string>",
"agent_id": "<string>",
"workflow_id": "<string>",
"max_duration": 123,
"schema_analysis": [
"<string>"
],
"model": "<string>",
"transfer_numbers": {},
"is_draft": true,
"voice_mail": "<string>",
"dynamic_data": {},
"webhooks": {}
}
'import requests
url = "https://api.getmalakai.com/campaigns/outbound"
payload = {
"campaign_name": "<string>",
"agent_id": "<string>",
"workflow_id": "<string>",
"max_duration": 123,
"schema_analysis": ["<string>"],
"model": "<string>",
"transfer_numbers": {},
"is_draft": True,
"voice_mail": "<string>",
"dynamic_data": {},
"webhooks": {}
}
headers = {
"Authorization": "<authorization>",
"x-access-token": "<x-access-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'x-access-token': '<x-access-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
campaign_name: '<string>',
agent_id: '<string>',
workflow_id: '<string>',
max_duration: 123,
schema_analysis: ['<string>'],
model: '<string>',
transfer_numbers: {},
is_draft: true,
voice_mail: '<string>',
dynamic_data: {},
webhooks: {}
})
};
fetch('https://api.getmalakai.com/campaigns/outbound', 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://api.getmalakai.com/campaigns/outbound",
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([
'campaign_name' => '<string>',
'agent_id' => '<string>',
'workflow_id' => '<string>',
'max_duration' => 123,
'schema_analysis' => [
'<string>'
],
'model' => '<string>',
'transfer_numbers' => [
],
'is_draft' => true,
'voice_mail' => '<string>',
'dynamic_data' => [
],
'webhooks' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"x-access-token: <x-access-token>"
],
]);
$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://api.getmalakai.com/campaigns/outbound"
payload := strings.NewReader("{\n \"campaign_name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"workflow_id\": \"<string>\",\n \"max_duration\": 123,\n \"schema_analysis\": [\n \"<string>\"\n ],\n \"model\": \"<string>\",\n \"transfer_numbers\": {},\n \"is_draft\": true,\n \"voice_mail\": \"<string>\",\n \"dynamic_data\": {},\n \"webhooks\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("x-access-token", "<x-access-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://api.getmalakai.com/campaigns/outbound")
.header("Authorization", "<authorization>")
.header("x-access-token", "<x-access-token>")
.header("Content-Type", "application/json")
.body("{\n \"campaign_name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"workflow_id\": \"<string>\",\n \"max_duration\": 123,\n \"schema_analysis\": [\n \"<string>\"\n ],\n \"model\": \"<string>\",\n \"transfer_numbers\": {},\n \"is_draft\": true,\n \"voice_mail\": \"<string>\",\n \"dynamic_data\": {},\n \"webhooks\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmalakai.com/campaigns/outbound")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["x-access-token"] = '<x-access-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaign_name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"workflow_id\": \"<string>\",\n \"max_duration\": 123,\n \"schema_analysis\": [\n \"<string>\"\n ],\n \"model\": \"<string>\",\n \"transfer_numbers\": {},\n \"is_draft\": true,\n \"voice_mail\": \"<string>\",\n \"dynamic_data\": {},\n \"webhooks\": {}\n}"
response = http.request(request)
puts response.read_body{
"responseCode": 2000,
"message": "Compaign created successfully",
"data": {
"campaign_name": "demo_campaign",
"agent_id": "AGENT_ID_HERE",
"workflow_id": "WORKFLOW_ID_HERE",
"max_duration": 300,
"schema_analysis": [
"did the human answer?"
],
"model": "Claude 3 Haiku",
"transfer_numbers": {
"test": "PHONE_NUMBER_HERE"
},
"user_id": "USER_ID_HERE",
"is_draft": true,
"voice_mail": null,
"dynamic_data": null,
"webhooks": null,
"ml_campaign_id": null,
"status": null,
"state": null,
"id": "CAMPAIGN_ID_HERE",
"created_at": "2025-08-05T07:29:59.422Z",
"updated_at": "2025-08-05T07:29:59.422Z"
}
}
Outbound
Create a Campaign
Create a new campaign from scratch
POST
campaigns
/
outbound
Create a Campaign
curl --request POST \
--url https://api.getmalakai.com/campaigns/outbound \
--header 'Authorization: <authorization>' \
--header 'Content-Type: application/json' \
--header 'x-access-token: <x-access-token>' \
--data '
{
"campaign_name": "<string>",
"agent_id": "<string>",
"workflow_id": "<string>",
"max_duration": 123,
"schema_analysis": [
"<string>"
],
"model": "<string>",
"transfer_numbers": {},
"is_draft": true,
"voice_mail": "<string>",
"dynamic_data": {},
"webhooks": {}
}
'import requests
url = "https://api.getmalakai.com/campaigns/outbound"
payload = {
"campaign_name": "<string>",
"agent_id": "<string>",
"workflow_id": "<string>",
"max_duration": 123,
"schema_analysis": ["<string>"],
"model": "<string>",
"transfer_numbers": {},
"is_draft": True,
"voice_mail": "<string>",
"dynamic_data": {},
"webhooks": {}
}
headers = {
"Authorization": "<authorization>",
"x-access-token": "<x-access-token>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
Authorization: '<authorization>',
'x-access-token': '<x-access-token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
campaign_name: '<string>',
agent_id: '<string>',
workflow_id: '<string>',
max_duration: 123,
schema_analysis: ['<string>'],
model: '<string>',
transfer_numbers: {},
is_draft: true,
voice_mail: '<string>',
dynamic_data: {},
webhooks: {}
})
};
fetch('https://api.getmalakai.com/campaigns/outbound', 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://api.getmalakai.com/campaigns/outbound",
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([
'campaign_name' => '<string>',
'agent_id' => '<string>',
'workflow_id' => '<string>',
'max_duration' => 123,
'schema_analysis' => [
'<string>'
],
'model' => '<string>',
'transfer_numbers' => [
],
'is_draft' => true,
'voice_mail' => '<string>',
'dynamic_data' => [
],
'webhooks' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: <authorization>",
"Content-Type: application/json",
"x-access-token: <x-access-token>"
],
]);
$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://api.getmalakai.com/campaigns/outbound"
payload := strings.NewReader("{\n \"campaign_name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"workflow_id\": \"<string>\",\n \"max_duration\": 123,\n \"schema_analysis\": [\n \"<string>\"\n ],\n \"model\": \"<string>\",\n \"transfer_numbers\": {},\n \"is_draft\": true,\n \"voice_mail\": \"<string>\",\n \"dynamic_data\": {},\n \"webhooks\": {}\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("Authorization", "<authorization>")
req.Header.Add("x-access-token", "<x-access-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://api.getmalakai.com/campaigns/outbound")
.header("Authorization", "<authorization>")
.header("x-access-token", "<x-access-token>")
.header("Content-Type", "application/json")
.body("{\n \"campaign_name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"workflow_id\": \"<string>\",\n \"max_duration\": 123,\n \"schema_analysis\": [\n \"<string>\"\n ],\n \"model\": \"<string>\",\n \"transfer_numbers\": {},\n \"is_draft\": true,\n \"voice_mail\": \"<string>\",\n \"dynamic_data\": {},\n \"webhooks\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.getmalakai.com/campaigns/outbound")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = '<authorization>'
request["x-access-token"] = '<x-access-token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"campaign_name\": \"<string>\",\n \"agent_id\": \"<string>\",\n \"workflow_id\": \"<string>\",\n \"max_duration\": 123,\n \"schema_analysis\": [\n \"<string>\"\n ],\n \"model\": \"<string>\",\n \"transfer_numbers\": {},\n \"is_draft\": true,\n \"voice_mail\": \"<string>\",\n \"dynamic_data\": {},\n \"webhooks\": {}\n}"
response = http.request(request)
puts response.read_body{
"responseCode": 2000,
"message": "Compaign created successfully",
"data": {
"campaign_name": "demo_campaign",
"agent_id": "AGENT_ID_HERE",
"workflow_id": "WORKFLOW_ID_HERE",
"max_duration": 300,
"schema_analysis": [
"did the human answer?"
],
"model": "Claude 3 Haiku",
"transfer_numbers": {
"test": "PHONE_NUMBER_HERE"
},
"user_id": "USER_ID_HERE",
"is_draft": true,
"voice_mail": null,
"dynamic_data": null,
"webhooks": null,
"ml_campaign_id": null,
"status": null,
"state": null,
"id": "CAMPAIGN_ID_HERE",
"created_at": "2025-08-05T07:29:59.422Z",
"updated_at": "2025-08-05T07:29:59.422Z"
}
}
Headers
string
required
Your API key for authentication. Prefix with
Bearer .string
required
Your access token for authentication.
Body
string
required
The name of the campaign to be created (e.g., “Demo Campaign”).
string
required
The ID of the agent associated with the campaign (e.g., “25e57eca-5582-4ba7-849c-xxxx”).
string
required
The workflow ID linked to the campaign (e.g., “291069c3-d653-479c-97f9-xxxx”).
number
required
Maximum duration in seconds for each interaction in the campaign (e.g., 300).
string[]
A list of schema analysis items to evaluate during the campaign (e.g., [“did the human answer?”]).
string
required
The AI model used in the campaign (e.g., “Claude 3 Haiku”).
object
Key-value pairs of labels and phone numbers for call transfers.
boolean
Indicates whether the campaign is in draft state (e.g., true).
string
Voicemail message or reference; null if not set.
object
Dynamic key-value pairs used within the campaign; null if not set.
object
Webhook configurations for the campaign; null if not set.
Request Example
{
"campaign_name": "demo_campaign",
"agent_id": "AGENT_ID_HERE",
"workflow_id": "WORKFLOW_ID_HERE",
"max_duration": 300,
"schema_analysis": [
"did the human answer?"
],
"model": "Claude 3 Haiku",
"transfer_numbers": {
"test": "PHONE_NUMBER_HERE"
},
"webhooks": [],
"contacts": [
"CONTACT_ID_HERE"
],
"dialers": [
"DIALER_ID_HERE"
]
}
Response
string
Status of the request in the form of a short message.
object[]
List of the created campaign objects, each including a unique
id.{
"responseCode": 2000,
"message": "Compaign created successfully",
"data": {
"campaign_name": "demo_campaign",
"agent_id": "AGENT_ID_HERE",
"workflow_id": "WORKFLOW_ID_HERE",
"max_duration": 300,
"schema_analysis": [
"did the human answer?"
],
"model": "Claude 3 Haiku",
"transfer_numbers": {
"test": "PHONE_NUMBER_HERE"
},
"user_id": "USER_ID_HERE",
"is_draft": true,
"voice_mail": null,
"dynamic_data": null,
"webhooks": null,
"ml_campaign_id": null,
"status": null,
"state": null,
"id": "CAMPAIGN_ID_HERE",
"created_at": "2025-08-05T07:29:59.422Z",
"updated_at": "2025-08-05T07:29:59.422Z"
}
}
⌘I