Skip to main content
POST
https://api.getmalakai.com/api/
/
api
/
campaigns
/
inbound
Create an Inbound Campaign
curl --request POST \
  --url https://api.getmalakai.com/api/api/campaigns/inbound \
  --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>",
  "transfer_numbers": {},
  "webhooks": {}
}
'
{
  "responseCode": 2000,
  "message": "Campaign created successfully",
  "data": {
    "campaign_name": "Demo Campaign",
    "agent_id": "25e57eca-5582-4ba7-849c-1234",
    "webhooks": [
      "https://example.com/webhook"
    ],
    "transfer_numbers": {
      "Support": "+1234567890",
      "Sales": "+0987654321"
    },
    "phone_number": "+1122334455",
    "model": "Claude 3 Haiku",
    "workflow_id": "291069c3-d653-479c-97f9-5678"
  }
}

Headers

Authorization
string
required
Your API key for authentication. Prefix with Bearer .
x-access-token
string
required
Your access token for authentication.

Body

campaign_name
string
required
The name of the campaign to be created (e.g., “Demo Campaign”).
agent_id
string
required
The ID of the agent associated with the campaign (e.g., “25e57eca-5582-4ba7-849c-xxxx”).
workflow_id
string
required
The workflow ID linked to the campaign (e.g., “291069c3-d653-479c-97f9-xxxx”).
transfer_numbers
object
Key-value pairs of labels and phone numbers for call transfers.
webhooks
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

message
string
Status of the request in the form of a short message.
data
object[]
List of the created campaign objects, each including a unique id.
{
  "responseCode": 2000,
  "message": "Campaign created successfully",
  "data": {
    "campaign_name": "Demo Campaign",
    "agent_id": "25e57eca-5582-4ba7-849c-1234",
    "webhooks": [
      "https://example.com/webhook"
    ],
    "transfer_numbers": {
      "Support": "+1234567890",
      "Sales": "+0987654321"
    },
    "phone_number": "+1122334455",
    "model": "Claude 3 Haiku",
    "workflow_id": "291069c3-d653-479c-97f9-5678"
  }
}