Skip to main content
PATCH
/
v1
/
campaigns
/
{campaign_id}
Update a campaign
curl --request PATCH \
  --url https://api.openmic.ai/v1/campaigns/{campaign_id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "<string>",
  "from_number": "<string>",
  "time_start": "<string>",
  "time_end": "<string>",
  "timezone": "<string>",
  "contact_list_id": 123,
  "days": [
    "Monday"
  ]
}
'
{
  "id": 123,
  "name": "<string>",
  "type": "outbound",
  "status": "Scheduled",
  "bot_uid": "<string>",
  "from_number": "<string>",
  "contact_list_id": 123,
  "time_start": "<string>",
  "time_end": "<string>",
  "timezone": "<string>",
  "days": [
    "Monday"
  ],
  "schedule_type": "single",
  "current_index": 123,
  "total_contacts": 123,
  "created_at": "2023-11-07T05:31:56Z",
  "updated_at": "2023-11-07T05:31:56Z"
}

Authorizations

Authorization
string
header
required

API key authentication. Include your API key in the Authorization header as: Authorization: Bearer <your-api-key>

Path Parameters

campaign_id
integer
required

Body

application/json

All fields are optional. Only provided fields will be updated.

name
string

Campaign name.

Maximum string length: 255
from_number
string

Phone number to dial from in E.164 format.

time_start
string

Start time for the calling window in HH:MM format (e.g. "09:00").

time_end
string

End time for the calling window in HH:MM format (e.g. "17:00").

timezone
string

IANA timezone for the calling window.

contact_list_id
integer

ID of the contact list to dial.

days
enum<string>[]

Days of week to run the campaign (e.g. ["Monday", "Wednesday", "Friday"]). Note: When setting days, time_start and time_end must also be provided (either in the same request or already set on the campaign).

Available options:
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
Sunday

Response

Updated campaign

id
integer

Unique identifier.

name
string

Campaign name.

type
enum<string>

Campaign type (always outbound).

Available options:
outbound
status
enum<string>

Current campaign status.

Available options:
Scheduled,
Running,
Stopped,
Completed,
Failed,
Expired,
Paused
bot_uid
string

Bot UID for API reference.

from_number
string

Phone number used to dial from (E.164 format).

contact_list_id
integer

Associated contact list ID.

time_start
string

Daily calling window start time in HH:MM format.

time_end
string

Daily calling window end time in HH:MM format.

timezone
string

Calling window timezone (IANA format).

days
enum<string>[]

Days of week the campaign runs on (for recurring campaigns).

Available options:
Monday,
Tuesday,
Wednesday,
Thursday,
Friday,
Saturday,
Sunday
schedule_type
enum<string>

Schedule type: single (one-time) or multi (recurring on specific days).

Available options:
single,
multi
current_index
integer

Number of contacts already called.

total_contacts
integer

Total number of contacts in the campaign's contact list.

created_at
string<date-time>
updated_at
string<date-time>