Numberly
Campaigns

Trigger a send

This technical guide details the procedure to trigger the sending of "trigger" type campaigns (Email or SMS) via the NMP API and track their execution programmatically.

Prerequisites

Before initiating a send, you must have the unique identifier (id) of the targeted campaign. This identifier can be retrieved in two ways:

  1. Via the user interface: Directly in the campaign URL on the platform.
  2. Via the API: By consulting the list of campaigns or from the response when creating a campaign via the POST /v1/campaigns endpoint.

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.

FieldTypeRequiredDescription
execution_idStringYesUnique 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
  }
}