Trigger a send
Prerequisites
Before initiating a send, you must have the unique identifier (id) of the targeted campaign. This identifier can be retrieved in two ways:
- Via the user interface: Directly in the campaign URL on the platform.
- Via the API: By consulting the list of campaigns or from the response when creating a campaign via the
POST /v1/campaignsendpoint.
Triggering a Send
Campaign activation is performed via a POST request on the sends resource. This operation is identical regardless of the channel (Email or SMS).
Endpoint
POST /v1/campaigns/{id}/sends
Body Parameters
The request body must contain an execution_id.
| Field | Type | Required | Description |
|---|---|---|---|
execution_id | String | Yes | Unique identifier guaranteeing the uniqueness of the send. A campaign cannot be sent twice with the same execution_id. The requester is responsible for its generation and uniqueness. |
Request Example (cURL)
curl -X POST "https://api.nmp.com/v1/campaigns/125/sends" \
-H "Authorization: Bearer <ACCESS_TOKEN>" \
-H "Content-Type: application/json" \
-d '{
"execution_id": "trigger_order_2023_11_27_A"
}'
API Responses
Success (201 Created)
The API returns the identifier of the created send order (id), which will be useful for tracking.
{
"id": 890
}
Error: Conflict (409 Conflict)
If an execution_id has already been used for this campaign, the API will return a 409 error.
{
"errors": [
{
"code": "CONFLICT",
"message": "An order with this execution_id already exists."
}
],
"metadata": {
"timestamp": 1742294105
}
}
Update campaign status
The NMP API allows you to modify the status of an existing campaign using the PATCH method on the dedicated endpoint. This is an essential feature for integrators wishing to automate the lifecycle of their campaigns.
Track your campaigns
Campaigns on the NMP can be managed via the interface or programmatically. The API provides two dedicated endpoints to track the progress of sending orders in real-time, whether for a specific execution or for the history attached to a campaign.