Numberly
Messages

Send a message

This technical guide details the integration process for the automated sending of transactional messages (Email, SMS and Vocal) via the Numberly Martech Platform (NMP) API.

Campaign Preparation

Before you can send messages, a "container" campaign must exist. It defines the default configuration (sender, subject, typology). You can create it via the interface or programmatically, or retrieve an existing campaign code.

Endpoint: POST {subdomain}.api.numberly.com/v1/campaigns

Example of Creating a Transactional Email Campaign

{
  "name": "Order Confirmation",
  "group_id": "YOUR_GROUP_ID",
  "communication_type": "service",
  "type": "transactional",
  "channel": "email",
  "subject": "Your order has been received",
  "sender": {
    "name": "Customer Service",
    "email": "no-reply@yourdomain.com"
  },
  "content": {
    "language": "en"
  },
  "target": {
    "optin_id": 1
  },
  "code": "ORDER_CONFIRMATION_V1" 
}

Technical Note: The code field defined here is crucial. It will serve as the reference key (campaign.code) when sending individual messages.

Sending Transactional Messages

Once the campaign is active, use the messaging endpoint to trigger individual or batch sends.

Endpoint: POST {subdomain}.api.numberly.com/v1/messages

Key Payload Parameters

  • campaign.code: The unique textual identifier of the campaign (configured in the previous step).
  • campaign.version: Which version of the campaign content to render, either published (default) or draft. If you set it to draft, recipients receive the work-in-progress content instead of the validated version.
  • channel: The sending channel (email or sms or vocal).
  • recipients: Array of objects containing contact details (email or mobile or number) and personalization variables.

Example A: Sending an Email

POST {subdomain}.api.numberly.com/v1/messages
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
{
  "channel": "email",
  "campaign": {
    "code": "ORDER_CONFIRMATION_V1",
    "version": "published"
  },
  "recipients": [
    {
      "email": "client@example.com",
      "name": "John Doe",
      "params": {
        "ORDER_ID": "CMD-12345",
        "ORDER_DATE": "2023-10-27"
      }
    }
  ]
}

Example B: Sending an SMS

For the SMS channel, the recipient field changes from email to mobile (with E.164 format).

POST {subdomain}.api.numberly.com/v1/messages
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN
{
  "channel": "sms",
  "campaign": {
    "code": "SMS_ALERT_CODE",
    "version": "published"
  },
  "recipients": [
    {
      "mobile": "+33612345678",
      "params": {
        "PROMO_CODE": "WELCOME20"
      }
    }
  ]
}

Example C : Sending a Vocal

For the vocal channel, the recipient field changes to number (format E.164).

There is 2 possible value for the field scenario_id :

  • 50 : unsubscribe scenario. Press 3 to confirm the unsubscription.
  • 54 : message repeat scenario. The key to use can be set via the repeatKey parameter (other than key 3).
POST {subdomain}.api.numberly.com/v1/messages
Content-Type: application/json
Authorization: Bearer YOUR_ACCESS_TOKEN`
{
  "channel": "vocal",
  "recipient": 
    {
      "name": "Jean Dupont",
      "number": "+33612345678",
      "params": {
      }
    },
  "group_id": "YOUR_GROUP_ID",
  "attachments": 
    {
      "filename": "Filename in .wav or .txt",
      "content": "Content of the file in base64 format"
    },
  "configuration": 
    {
      "scenario_id": "54"
    }
}

API Responses

  • 202 Accepted: The request is valid and has been queued for processing.
  • 400 Bad Request: Validation error (e.g., invalid email format, campaign code not found).
  • 429 Too Many Requests: Rate limit reached.

Success Response Example (HTTP 202)

When the request is accepted, the API returns an object containing the list of created messages (objects) as well as metadata. Each object contains the unique message identifier (id) which will be useful for tracking, as well as the associated recipient.

{
  "objects": [
    {
      "id": "20250521080949870162296c8c2f7e7448539b1d9f963cd22c89",
      "recipient": "client@example.com"
    }
  ],
  "metadata": {
    "timestamp": 1716278989.0
  }
}