curl --request POST \
--url https://api-eg.olimi.ai/api/v2/campaigns \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "September renewals",
"workingDays": [
"sunday",
"monday",
"tuesday",
"wednesday",
"thursday"
],
"isActive": false,
"agentId": "0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10",
"customerListIds": [
"9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24"
],
"workingStartTime": "09:00",
"workingEndTime": "17:00",
"continueOvernight": false,
"maxLines": 5,
"maxRetries": 2,
"retryDuration": 3600,
"description": "<string>"
}
'import requests
url = "https://api-eg.olimi.ai/api/v2/campaigns"
payload = {
"name": "September renewals",
"workingDays": ["sunday", "monday", "tuesday", "wednesday", "thursday"],
"isActive": False,
"agentId": "0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10",
"customerListIds": ["9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24"],
"workingStartTime": "09:00",
"workingEndTime": "17:00",
"continueOvernight": False,
"maxLines": 5,
"maxRetries": 2,
"retryDuration": 3600,
"description": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'September renewals',
workingDays: ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday'],
isActive: false,
agentId: '0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10',
customerListIds: ['9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24'],
workingStartTime: '09:00',
workingEndTime: '17:00',
continueOvernight: false,
maxLines: 5,
maxRetries: 2,
retryDuration: 3600,
description: '<string>'
})
};
fetch('https://api-eg.olimi.ai/api/v2/campaigns', 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-eg.olimi.ai/api/v2/campaigns",
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([
'name' => 'September renewals',
'workingDays' => [
'sunday',
'monday',
'tuesday',
'wednesday',
'thursday'
],
'isActive' => false,
'agentId' => '0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10',
'customerListIds' => [
'9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24'
],
'workingStartTime' => '09:00',
'workingEndTime' => '17:00',
'continueOvernight' => false,
'maxLines' => 5,
'maxRetries' => 2,
'retryDuration' => 3600,
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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-eg.olimi.ai/api/v2/campaigns"
payload := strings.NewReader("{\n \"name\": \"September renewals\",\n \"workingDays\": [\n \"sunday\",\n \"monday\",\n \"tuesday\",\n \"wednesday\",\n \"thursday\"\n ],\n \"isActive\": false,\n \"agentId\": \"0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10\",\n \"customerListIds\": [\n \"9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24\"\n ],\n \"workingStartTime\": \"09:00\",\n \"workingEndTime\": \"17:00\",\n \"continueOvernight\": false,\n \"maxLines\": 5,\n \"maxRetries\": 2,\n \"retryDuration\": 3600,\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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-eg.olimi.ai/api/v2/campaigns")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"September renewals\",\n \"workingDays\": [\n \"sunday\",\n \"monday\",\n \"tuesday\",\n \"wednesday\",\n \"thursday\"\n ],\n \"isActive\": false,\n \"agentId\": \"0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10\",\n \"customerListIds\": [\n \"9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24\"\n ],\n \"workingStartTime\": \"09:00\",\n \"workingEndTime\": \"17:00\",\n \"continueOvernight\": false,\n \"maxLines\": 5,\n \"maxRetries\": 2,\n \"retryDuration\": 3600,\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eg.olimi.ai/api/v2/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"September renewals\",\n \"workingDays\": [\n \"sunday\",\n \"monday\",\n \"tuesday\",\n \"wednesday\",\n \"thursday\"\n ],\n \"isActive\": false,\n \"agentId\": \"0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10\",\n \"customerListIds\": [\n \"9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24\"\n ],\n \"workingStartTime\": \"09:00\",\n \"workingEndTime\": \"17:00\",\n \"continueOvernight\": false,\n \"maxLines\": 5,\n \"maxRetries\": 2,\n \"retryDuration\": 3600,\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Campaign created successfully",
"data": {
"message": "Campaign fetched successfully",
"data": {
"id": "3e8b5d21-7c4a-4f96-a1d0-6b2e9c7f4a58",
"name": "September renewals",
"description": null,
"callType": "outbound",
"isActive": true,
"workingDays": [
"sunday",
"monday",
"tuesday",
"wednesday",
"thursday"
],
"workingStartTime": "09:00:00",
"workingEndTime": "17:00:00",
"continueOvernight": false,
"maxLines": 5,
"maxRetries": 2,
"retryDuration": 3600,
"agent": {
"id": "0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10",
"name": "Renewals Agent"
},
"customerLists": [
{
"id": "9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24",
"name": "September renewals"
}
],
"createdAt": "2026-09-28T10:15:02.418Z",
"updatedAt": "2026-09-28T10:15:02.418Z"
}
}
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 422,
"message": [
"name must be shorter than or equal to 100 characters"
],
"error": "Unprocessable Entity"
}Create a campaign
Creates an outbound campaign. Send isActive to choose whether it starts dialing straight away.
curl --request POST \
--url https://api-eg.olimi.ai/api/v2/campaigns \
--header 'Content-Type: application/json' \
--header 'X-API-KEY: <api-key>' \
--data '
{
"name": "September renewals",
"workingDays": [
"sunday",
"monday",
"tuesday",
"wednesday",
"thursday"
],
"isActive": false,
"agentId": "0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10",
"customerListIds": [
"9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24"
],
"workingStartTime": "09:00",
"workingEndTime": "17:00",
"continueOvernight": false,
"maxLines": 5,
"maxRetries": 2,
"retryDuration": 3600,
"description": "<string>"
}
'import requests
url = "https://api-eg.olimi.ai/api/v2/campaigns"
payload = {
"name": "September renewals",
"workingDays": ["sunday", "monday", "tuesday", "wednesday", "thursday"],
"isActive": False,
"agentId": "0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10",
"customerListIds": ["9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24"],
"workingStartTime": "09:00",
"workingEndTime": "17:00",
"continueOvernight": False,
"maxLines": 5,
"maxRetries": 2,
"retryDuration": 3600,
"description": "<string>"
}
headers = {
"X-API-KEY": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'X-API-KEY': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'September renewals',
workingDays: ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday'],
isActive: false,
agentId: '0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10',
customerListIds: ['9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24'],
workingStartTime: '09:00',
workingEndTime: '17:00',
continueOvernight: false,
maxLines: 5,
maxRetries: 2,
retryDuration: 3600,
description: '<string>'
})
};
fetch('https://api-eg.olimi.ai/api/v2/campaigns', 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-eg.olimi.ai/api/v2/campaigns",
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([
'name' => 'September renewals',
'workingDays' => [
'sunday',
'monday',
'tuesday',
'wednesday',
'thursday'
],
'isActive' => false,
'agentId' => '0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10',
'customerListIds' => [
'9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24'
],
'workingStartTime' => '09:00',
'workingEndTime' => '17:00',
'continueOvernight' => false,
'maxLines' => 5,
'maxRetries' => 2,
'retryDuration' => 3600,
'description' => '<string>'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"X-API-KEY: <api-key>"
],
]);
$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-eg.olimi.ai/api/v2/campaigns"
payload := strings.NewReader("{\n \"name\": \"September renewals\",\n \"workingDays\": [\n \"sunday\",\n \"monday\",\n \"tuesday\",\n \"wednesday\",\n \"thursday\"\n ],\n \"isActive\": false,\n \"agentId\": \"0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10\",\n \"customerListIds\": [\n \"9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24\"\n ],\n \"workingStartTime\": \"09:00\",\n \"workingEndTime\": \"17:00\",\n \"continueOvernight\": false,\n \"maxLines\": 5,\n \"maxRetries\": 2,\n \"retryDuration\": 3600,\n \"description\": \"<string>\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("X-API-KEY", "<api-key>")
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-eg.olimi.ai/api/v2/campaigns")
.header("X-API-KEY", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"September renewals\",\n \"workingDays\": [\n \"sunday\",\n \"monday\",\n \"tuesday\",\n \"wednesday\",\n \"thursday\"\n ],\n \"isActive\": false,\n \"agentId\": \"0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10\",\n \"customerListIds\": [\n \"9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24\"\n ],\n \"workingStartTime\": \"09:00\",\n \"workingEndTime\": \"17:00\",\n \"continueOvernight\": false,\n \"maxLines\": 5,\n \"maxRetries\": 2,\n \"retryDuration\": 3600,\n \"description\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api-eg.olimi.ai/api/v2/campaigns")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["X-API-KEY"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"September renewals\",\n \"workingDays\": [\n \"sunday\",\n \"monday\",\n \"tuesday\",\n \"wednesday\",\n \"thursday\"\n ],\n \"isActive\": false,\n \"agentId\": \"0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10\",\n \"customerListIds\": [\n \"9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24\"\n ],\n \"workingStartTime\": \"09:00\",\n \"workingEndTime\": \"17:00\",\n \"continueOvernight\": false,\n \"maxLines\": 5,\n \"maxRetries\": 2,\n \"retryDuration\": 3600,\n \"description\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"message": "Campaign created successfully",
"data": {
"message": "Campaign fetched successfully",
"data": {
"id": "3e8b5d21-7c4a-4f96-a1d0-6b2e9c7f4a58",
"name": "September renewals",
"description": null,
"callType": "outbound",
"isActive": true,
"workingDays": [
"sunday",
"monday",
"tuesday",
"wednesday",
"thursday"
],
"workingStartTime": "09:00:00",
"workingEndTime": "17:00:00",
"continueOvernight": false,
"maxLines": 5,
"maxRetries": 2,
"retryDuration": 3600,
"agent": {
"id": "0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10",
"name": "Renewals Agent"
},
"customerLists": [
{
"id": "9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24",
"name": "September renewals"
}
],
"createdAt": "2026-09-28T10:15:02.418Z",
"updatedAt": "2026-09-28T10:15:02.418Z"
}
}
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 404,
"errorCode": "agent_not_found",
"message": "Agent not found"
}{
"statusCode": 422,
"message": [
"name must be shorter than or equal to 100 characters"
],
"error": "Unprocessable Entity"
}data.data, not data.isActive out, the campaign is saved active and starts dialing within about five minutes, skipping the credit check and the free-lines check that "isActive": true gets. Always send isActive explicitly. In the playground, set it before you press Send.isActive: true is saved paused, without an error. Check isActive in the response. When you’ve topped up, start it with Update a campaign."isActive": true but no agentId is accepted; the campaign won’t call anyone until you add an agent.
Common causes of a 422 validation error:
nameis missing, empty or longer than 100 characters.workingDaysis missing, empty, or has a value that isn’t a day name.maxLines,maxRetriesorretryDurationis outside its range.- An ID in
agentIdorcustomerListIdsisn’t a valid UUID.
Authorizations
Body
Surrounding spaces are trimmed.
1 - 100"September renewals"
Days the campaign may call.
1monday, tuesday, wednesday, thursday, friday, saturday, sunday [
"sunday",
"monday",
"tuesday",
"wednesday",
"thursday"
]
Whether to start dialing as soon as the campaign is created. The API accepts it missing, but then saves the campaign active and starts dialing within minutes, so always send it.
false
The outbound agent that makes the calls. Needed before the campaign can dial.
"0d6a3f7e-5b8c-4b1e-9a51-2f1d7c9e4a10"
The customer lists to call. Needed before the campaign can dial.
["9c4e1b7a-2d5f-4a83-b6e0-3f7d9a1c5e24"]
Time of day calls may start, as HH:mm (24-hour).
"09:00"
Time of day calls must stop, as HH:mm. If it's earlier than workingStartTime, the window runs past midnight.
"17:00"
Which day the hours after midnight belong to. See Overnight windows. Defaults to false.
false
How many contacts the campaign dials in each batch. No more than your company's line limit. Defaults to 1.
1 <= x <= 1005
How many more times to call a contact who didn't answer. Defaults to 1.
0 <= x <= 102
Seconds to wait before retrying a contact. If you leave it out, the wait isn't guaranteed, so set it explicitly.
0 <= x <= 120003600
Free text for your own reference.