Skip to main content
POST
/
v1
/
voice-agents
/
campaigns
Create an outbound campaign
curl --request POST \
  --url https://api.tryhamsa.com/v1/voice-agents/campaigns \
  --header 'Authorization: <api-key>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Q1 Customer Outreach",
  "phoneNumber": "+14155551212",
  "voiceAgentId": "68f7656f-098b-4c43-b165-7cfd2cc8ac40",
  "recipients": [
    {
      "phoneNumber": "+1234567890",
      "ignoreE164Validation": false,
      "name": "John Doe"
    }
  ],
  "sendType": "NOW",
  "timeRange": {
    "days": [
      "MONDAY",
      "TUESDAY",
      "WEDNESDAY"
    ],
    "startCallingTime": "09:00",
    "endCallingTime": "17:00"
  },
  "reservedConcurrency": 10,
  "scheduledDate": "2025-12-01T09:00:00Z",
  "scheduledTimezone": "America/New_York"
}
'
{
  "success": true,
  "message": "Campaign created successfully",
  "messageKey": "CAMPAIGN_CREATED_SUCCESSFULLY",
  "data": {
    "id": "a8f7656f-098b-4c43-b165-7cfd2cc8ac50",
    "name": "Q1 Customer Outreach",
    "status": "SCHEDULED",
    "sendType": "NOW",
    "scheduledDate": "2025-12-01T09:00:00Z",
    "scheduledTimezone": "America/New_York",
    "timeRange": {
      "days": [
        "MONDAY",
        "TUESDAY",
        "WEDNESDAY"
      ],
      "startCallingTime": "09:00",
      "endCallingTime": "17:00"
    },
    "reservedConcurrency": 10,
    "webhookUrl": "https://example.com/webhook",
    "projectId": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
    "userId": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
    "voiceAgentId": "68f7656f-098b-4c43-b165-7cfd2cc8ac40",
    "phoneNumberId": "48f7656f-098b-4c43-b165-7cfd2cc8ac30",
    "createdAt": "2025-12-06T10:00:00.000Z",
    "updatedAt": "2025-12-06T10:00:00.000Z"
  }
}

Documentation Index

Fetch the complete documentation index at: https://docs.tryhamsa.com/llms.txt

Use this file to discover all available pages before exploring further.

Authorizations

Authorization
string
header
required

Pass the API key in the Authorization header, You need to put Token keyword before the API key. e.g. 'Authorization: Token '

Body

application/json
name
string
required

Campaign name (1-100 characters).

Required string length: 1 - 100
Example:

"Q1 Customer Outreach"

phoneNumber
string
required

Phone number to use for the campaign in E.164 format.

Example:

"+14155551212"

voiceAgentId
string<uuid>
required

Voice agent ID to use for the campaign.

Example:

"68f7656f-098b-4c43-b165-7cfd2cc8ac40"

recipients
object[]
required

List of recipients for the campaign (minimum 1 recipient).

Minimum array length: 1
sendType
enum<string>
required

When to send the campaign. Use 'NOW' for immediate sending or 'SCHEDULED' for scheduled sending.

Available options:
NOW,
SCHEDULED
Example:

"NOW"

timeRange
object
required

Time range for making calls.

reservedConcurrency
integer
required

Number of concurrent calls reserved for this campaign (must be positive).

Required range: x >= 1
Example:

10

scheduledDate
string<date-time>

Scheduled date/time in ISO 8601 format (required when sendType is SCHEDULED).

Example:

"2025-12-01T09:00:00Z"

scheduledTimezone
string

Timezone for scheduled campaign (required when sendType is SCHEDULED).

Example:

"America/New_York"

Response

Successful response

success
boolean
Example:

true

message
string
Example:

"Campaign created successfully"

messageKey
string
Example:

"CAMPAIGN_CREATED_SUCCESSFULLY"

data
object