Get Campaigns

Overview

This endpoint retrieves a list of campaigns associated with the authenticated user’s company.

Endpoint Details

  • URL: /campaign/list
  • Method: GET
  • Authentication: Required ( API KEY )

Request Headers

HeaderValueDescription
AuthorizationBearer <api_key>Your API KEY

Example Request

    Response

    Success Response

    • Status Code: 200 OK
    {
      "status": "ok",
      "message": "ok",
      "data": [
        {
          "name": "Summer Campaign",
          "notes": "Campaign for summer promotions",
          "status": "active",
          "campaign_type": "outbound",
          "contacts_list_source": ["web", "manual"],
          "contacts_list_tags": [["vip"], ["new-customer"]],
          "contacts_list_categories": [["sales"], ["support"]],
          "contacts_list_source_metadata": {
            "web": {
              "source_url": "https://example.com"
            }
          },
          "agent_variables_contact_metadata_mapping": {
            "first_name": "contact.firstname"
          },
          "call_progress": 50,
          "call_time_of_day_from": "09:00:00",
          "call_time_of_day_to": "17:00:00",
          "number_of_call_attempts": [3, 5],
          "retry_delay": [60, 120],
          "retry_delay_unit": ["seconds", "seconds"],
          "days_of_week": [1, 2, 3, 4, 5],
          "time_zone": "UTC",
          "created_at": "2023-10-01T12:00:00Z",
          "updated_at": "2023-10-01T12:00:00Z",
          "deleted_at": null,
          "started_at": "2023-10-01",
          "ended_at": "2023-10-31",
          "webhook_mapping_variables": {
            "event": "call_completed"
          },
          "webhook_mapping_variables_sources": {
            "event": "system"
          }
        }
      ]
    }
    
    
    

    Error Response

    • Status Code: 200 OK (with error message)
    When an error occurs in your endpoint, the server responds with an HTTP status code of 200 OK. However, the response body contains an error message in a structured format to indicate that something went wrong. This approach is sometimes used to standardize API responses, even for errors.
    {
      "status": "error",
      "message": "error",
      "data": ""
    }
    

    Response Fields

    Each object in the data array represents a campaign and has the following structure:
    FieldTypeDescription
    namestringThe name of the campaign.
    notesstringAdditional notes or description for the campaign.
    statusstringThe current status of the campaign (e.g., active, paused).
    campaign_typestringThe type of campaign (e.g., outbound, inbound).
    contacts_list_sourcearraySources of the contacts list (e.g., web, manual).
    contacts_list_tagsarrayTags associated with the contacts list.
    contacts_list_categoriesarrayCategories associated with the contacts list.
    contacts_list_source_metadataobjectMetadata about the contacts list sources.
    agent_variables_contact_metadata_mappingobjectMapping of agent variables to contact metadata.
    call_progressintegerThe progress of the campaign (e.g., percentage completed).
    call_time_of_day_fromstringThe start time for calls (in HH:MM:SS format).
    call_time_of_day_tostringThe end time for calls (in HH:MM:SS format).
    number_of_call_attemptsarrayNumber of call attempts for each contact.
    retry_delayarrayDelay between retry attempts (in seconds).
    retry_delay_unitarrayUnit of the retry delay (e.g., seconds).
    days_of_weekarrayDays of the week when the campaign is active (e.g., 1 for Monday).
    time_zonestringThe time zone for the campaign.
    created_atstringTimestamp when the campaign was created.
    updated_atstringTimestamp when the campaign was last updated.
    deleted_atstringTimestamp when the campaign was deleted (if applicable).
    started_atstringThe start date of the campaign.
    ended_atstringThe end date of the campaign.
    webhook_mapping_variablesobjectVariables for webhook mappings.
    webhook_mapping_variables_sourcesobjectSources for webhook mapping variables.