# POST Trigger

## Dispatch Surveys

<mark style="color:green;">`POST`</mark> `https://api.feedbackly.com/v5.0.3/triggers/rest/:apiActionId`

Dispatch API have rate limit of 500 contacts/minute. Please be careful with retries since we're sending out surveys right away after receiving the API request. \
\
\*Refer to "[Preparing Campaign](https://docs.feedbackly.com/dispatch-api/preparing-campaign)" to get apiActionId from feedbackly dashboard.

#### Headers

| Name          | Type   | Description                                                                                          |
| ------------- | ------ | ---------------------------------------------------------------------------------------------------- |
| Authorization | String | <p>Authentication token to access the API eg:<br>'Authorization': 'ey0iuefoo834xcunerun348efnsd'</p> |
| Content-Type  | String | Use: 'Content-Type':'application/json'                                                               |

#### Request Body

| Name                                       | Type       | Description                                                                                                    |
| ------------------------------------------ | ---------- | -------------------------------------------------------------------------------------------------------------- |
| actionId<mark style="color:red;">\*</mark> | String     | Unique identifier to differentiate original requests. Feedbackly will block requests with duplicate actionIds. |
| contacts<mark style="color:red;">\*</mark> | contact\[] | Array of [contact object](#contact)s                                                                           |
| ~~apiActionId~~                            | String     | \[DEPRECIATED] ApiActionId to be used in body instead of URI param                                             |

{% tabs %}
{% tab title="Request (POST)" %}

```
{
  "actionId": "123456789",
  "contacts": [
    {
    "email": "some.user@example.com",
    "metadata": {
      "type": "Test"
      }
    }
  ]
}
```

{% endtab %}

{% tab title="200 Response successfully retrieved." %}

```
{
    "campaigns": {
        "65f16af0d948b98372d6b6aa": [
            {
                "email": "some.user@example.com",
                "metadata": {
                    "type": "Test"
                }
            }
        ]
    }
}
```

{% endtab %}
{% endtabs %}

### Contact Object <a href="#contact" id="contact"></a>

Please note that either email or phone must be existing per contact. Metadata and options are optional.

| Field    | Type                              | Description                                                                                   |
| -------- | --------------------------------- | --------------------------------------------------------------------------------------------- |
| email    | String                            | Valid email address of survey receiver                                                        |
| phone    | String                            | Valid phone number with country code of survey receiver. (with or without + in the beginning) |
| metadata | {\[key:string]: string \| number} | Contact related metadata.                                                                     |
| options  | {}                                | Additional options                                                                            |

#### Options

To override default admin notification receivers, use this. Multiple emails can be specified as an array.

```
"options":{
	"notificationReceiver":["other.email@example.com"],
	"overrideDefaultReceivers":true
}
```
