Skip to main content
POST

Overview

Create a holiday list in your organization. Campaigns that use it don’t place calls on its dates. To start from a country’s public holidays, fetch them with Get Template Holidays and send them as holidays.

Prerequisites

  • An API key for your workspace

Endpoint

Request

string
required
Your workspace API key. Create one from the profile menu in the dashboard → API Keys.

Request Parameters

string
required
Name of the holiday list. Must be unique in your organization.
array[object]
required
The holidays. Each item has:
  • label – name of the holiday
  • date – the date, in YYYY-MM-DD format (a full ISO 8601 timestamp is cut to its date)
Send an empty array to create a list with no dates yet.
boolean
Set to true to make this the organization’s default list, preselected when creating a campaign in the dashboard. The previous default stops being the default.

Response

object
required
The new holiday list. data._id is the ID to use as holidayListId on a campaign.

Error Handling

Errors return status: false, with the reason in errorMessage.
  • 400 Bad Request
    • Holiday list name is required or Holidays must be an array.
    • isDefault must be a boolean when provided.
    • Each holiday must have a valid date and label, or Invalid date format for holiday.
    • A holiday list with this name already exists for your organization.
  • 401 Unauthorized – Missing or invalid API key.
  • 500 Internal Server Error – Unexpected server error.