Skip to main content
A configuration is an org-level, reusable bundle that a campaign points at. It defines when contacts may be called (calling windows per timezone), how aggressively to retry, how to normalize uploaded phone numbers, and which agent version does the dialing. Create a configuration once and reuse it across many campaigns. A configuration has three parts:
  • Schedule — when calls are allowed, by timezone.
  • Dialing policy — retry limit and the default country code for normalizing numbers.
  • Agent — which agent (and version) to dial with.

Schedule

The schedule controls which timezones are inside their calling window at a given moment. Calls are only placed to contacts whose timezone is currently in a window.
FieldTypeDefaultDescription
default_timezonestring (IANA)America/New_YorkFallback timezone for contacts that do not carry one. Must be a valid IANA identifier.
default_windowsTimeWindow[][]Calling windows used for regular contacts and all retries. An empty list means no calls are allowed.
overridesScheduleOverride[][]Per-timezone window lists that replace default_windows for the listed timezones.
scheduled_windowsTimeWindow[] | nullnullWindows used only for first-time scheduled contacts. When null, falls back to default_windows.
scheduled_overridesScheduleOverride[] | nullnullPer-timezone windows for first-time scheduled contacts. When null, falls back to overrides.

TimeWindow

A TimeWindow is a set of weekdays plus a daily start and end time.
FieldTypeDescription
daysstring[]One or more of mon, tue, wed, thu, fri, sat, sun.
startstringStart time in 24-hour HH:MM (hour 0-23, minute 0-59).
endstringEnd time in 24-hour HH:MM. Must differ from start.
If start is earlier than end, the window is a normal same-day range (for example 09:00-17:00). If start is later than end, the window crosses midnight (for example 22:30-03:30), and the early-morning portion is attributed to the previous day’s days entry.
{
  "days": ["mon", "tue", "wed", "thu", "fri"],
  "start": "09:00",
  "end": "17:00"
}
If default_windows is empty and no override matches a contact’s timezone, no calls are placed to that contact. Set at least one window before launching a campaign.

ScheduleOverride

A ScheduleOverride attaches a list of windows to one or more timezones. For any contact in a listed timezone, these windows replace default_windows entirely.
FieldTypeDescription
timezonesstring[]IANA timezone identifiers this override applies to.
windowsTimeWindow[]Windows used for the listed timezones.
{
  "timezones": ["America/Los_Angeles", "America/Vancouver"],
  "windows": [
    { "days": ["mon", "tue", "wed", "thu", "fri"], "start": "10:00", "end": "18:00" }
  ]
}

Regular vs scheduled windows

There are two parallel sets of windows. Use scheduled windows when you want first-time scheduled contacts to be dialed on a different schedule than everyone else.
Window setApplies toFalls back to
default_windows / overridesRegular contacts and all retries(none)
scheduled_windows / scheduled_overridesFirst-time scheduled contacts onlydefault_windows / overrides when null
To list every valid IANA timezone identifier accepted by these fields, call:
curl https://api.anyreach.ai/campaign/timezones \
  -H "Authorization: Bearer <token>" \
  -H "X-Anyreach-Org: <organization_id>"

Dialing policy

FieldTypeDefaultConstraintsDescription
max_attempts_per_phone_numberinteger2Minimum 1How many times a single phone number may be dialed before it is exhausted.
default_country_codestring+1+ followed by 1-4 digitsCountry code applied when normalizing uploaded numbers to E.164.
When contacts are uploaded against a campaign, numbers without an explicit country code are parsed using default_country_code and formatted to E.164 (for example, +44). Numbers that cannot be parsed are reported as invalid. See Contacts for upload behavior and Dialing and retries for how attempts are spent.

Agent

FieldTypeDefaultDescription
agent_idUUIDrequiredThe agent that dials contacts in campaigns using this configuration.
versioninteger | nullnullA specific published agent version. When omitted, the latest published version is used.

Default configuration

A configuration can be marked as the organization’s default with is_default. Only one default may exist per organization.
Creating or updating a configuration with is_default: true while a default already exists returns 409 Conflict. Un-default or delete the existing default first.

Endpoints

All endpoints require the campaigns:read scope to read and campaigns:manage to create, update, or delete.
MethodPathDescription
POST/campaign/configurationsCreate a configuration.
GET/campaign/configurationsList all configurations for the organization.
GET/campaign/configurations/{config_id}Get one configuration.
PATCH/campaign/configurations/{config_id}Update a configuration. Changes propagate to active campaigns.
DELETE/campaign/configurations/{config_id}Delete a configuration.
GET/campaign/timezonesList all valid IANA timezone identifiers.
Deleting a configuration that is referenced by one or more campaigns returns 409 Conflict. Reassign or delete those campaigns first.

Create a configuration

curl -X POST https://api.anyreach.ai/campaign/configurations \
  -H "Authorization: Bearer <token>" \
  -H "X-Anyreach-Org: <organization_id>" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "US business hours",
    "is_default": true,
    "default_timezone": "America/New_York",
    "default_windows": [
      { "days": ["mon", "tue", "wed", "thu", "fri"], "start": "09:00", "end": "17:00" }
    ],
    "max_attempts_per_phone_number": 2,
    "default_country_code": "+1",
    "agent_id": "00000000-0000-0000-0000-000000000000"
  }'

Contacts

Upload contacts and how numbers are normalized to E.164.

Dialing and retries

How attempts and calling windows govern when calls go out.