Numberly
Campaigns

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.

Prerequisites: Retrieving the Campaign ID

To modify a campaign's status, you must have its unique identifier (ID).

  • Via the User Interface (NMP / Sendingly): The ID is often present directly in the campaign URL within the Sendingly application.
  • Via the API: The ID is returned in the response of the API call used for campaign creation (via POST /v1/campaigns).

The ID is the path-parameter element {id} in the endpoint URL: /v1/campaigns/{id}.

Modifying the Status: The PATCH Call

Status modification is performed by submitting a PATCH request to the /v1/campaigns/{id} endpoint.

Endpoint and Method

  • Method: PATCH
  • Path: /v1/campaigns/{id}
  • Request Body (PatchCampaignPayload): Must include the status field.

Request Body (Payload)

The status is the only campaign element that can be modified via this programmatic endpoint. Accepted values for the status field are draft or published.

FieldTypeDescriptionPossible Values
statusstringThe new status of the campaign.draft, published

JSON Payload Example for publication:

{
  "status": "published"
}

cURL

curl -X PATCH 'https://api.numberly.com/v1/campaigns/123' \
-H 'Authorization: Bearer <access_token>' \
-H 'Content-Type: application/json' \
-d '{
  "status": "published"
}'

API Response (Success):

{
  "id": 1
}