Create a campaign
Prerequisites and Configuration
Before creating a campaign, you must retrieve the identifiers for dependent resources. Campaign creation requires aggregating several technical entities available via the settings endpoints.
Important Technical Note: Each resource used (Sender, Content, Targeting, etc.) must be explicitly authorized for the specified group (
group_id) within the Sendingly administration interface.
Retrieving Identifiers
Here are the endpoints to query to build your creation payload:
| Resource | Description | Endpoint |
|---|---|---|
| Group ID | Permission group identifier | GET /v1/settings/groups |
| Content ID | Identifier of previously created email content | GET /v1/contents or create via POST /v1/contents |
| Tags | Campaign classification | GET /v1/settings/tag-families |
| Sender | Sender (Email or SMS) associated with the group | GET /v1/settings/groups/{id}/senders |
| Opt-in ID | Consent management | GET /v1/settings/groups/{id}/optins |
| Targeting | Targeting procedures and parameters | GET /v1/settings/groups/{id}/targeting-procedures |
Note: For mandatory tags, at least one value must be provided during campaign creation.
Campaign Creation via API
The POST /v1/campaigns endpoint is polymorphic. It allows creating Programmable (scheduled) or Transactional campaigns, on Email and SMS channels.
Status Management
The campaign status determines its execution:
draft: The campaign is a draft.published: The campaign is validated. Only a campaign withpublishedstatus can trigger sends.
Payload Structure
The payload varies depending on the type (schedulable, transactional) and the channel.
Creating a Scheduled Email Campaign (schedulable)
POST /v1/campaignsContent-Type: application/json
{
"name": "Marketing Campaign Q1",
"group_id": "65df06372b43d70716133716",
"type": "schedulable",
"communication_type": "marketing",
"channel": "email",
"status": "draft",
"subject": "Discover our new features",
"content": {
"id": 12345,
"language": "en"
},
"sender": {
"name": "Customer Service",
"populations": [
{
"id": 1,
"email": "contact@my-domain.com"
}
]
},
"target": {
"procedure_id": 101,
"optin_id": 1,
"parameters": {
"segment": "active_30d"
}
},
"schedule": {
"type": "one_shot",
"send_at": "2025-06-15T09:00:00Z"
},
"timezone": "Europe/Paris"
}
Creating a Transactional SMS Campaign
POST /v1/campaignsContent-Type: application/json
{
"name": "SMS Alerting",
"group_id": "65df06372b43d70716133716",
"type": "transactional",
"communication_type": "service",
"channel": "sms",
"status": "published",
"content": {
"text": "Your validation code is 8542",
"language": "en",
"optout_text_id": null
},
"sender": {
"id": 945
},
"target": {
"optin_id": null
}
}
API Response Example
In case of success, the API returns an HTTP 201 Created code accompanied by the created campaign object, including its unique identifier (id) and modification dates.
HTTP 201 Created
{
"id": 89012,
"name": "Marketing Campaign Q1",
"group_id": "65df06372b43d70716133716",
"type": "schedulable",
"communication_type": "marketing",
"channel": "email",
"status": "draft",
"created_at": "2025-06-12T14:30:00Z",
"updated_at": "2025-06-12T14:30:00Z",
"schedule": {
"type": "one_shot",
"send_at": "2025-06-15T09:00:00Z"
}
}
Note: Keep the returned
id(e.g.,89012) for future operations (update, deletion, or retrieving statistics).
Retrieve email contents
This technical guide details the methods for programmatically retrieving HTML content resources stored on the Numberly Martech Platform (NMP). The API provides access to this content either via a paginated list or individually using a specific identifier.
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.