Get Campaign by UUID

GET/services/{serviceUuid}/campaigns/{campaignUuid}

Fetch existing campaign by its UUID Example:

bash
  curl -X 'GET' \
    'https://api-cpaas.sms.es/news/v1/services/5491ccd2-c1dc-11ee-8cde-63aaf4399859/campaigns/6491ccd2-c1dc-11ee-8cde-63aaf4399859' \
    -H 'accept: application/json'
Base URL
https://api-cpaas.sms.es/news/v1
Authentication

OAuth2 — send Authorization: Bearer <access_token>. Token URL: https://accounts-cpaas.sms.es/oauth2/access-token

Request

Path parameters

serviceUuidstringrequired

service (BM Account) UUID

campaignUuidstringrequired

campaign UUID

Query parameters

fieldsstring[]

Include optional fields in the response tasks, messages.

Possible values: tasks, messages

Request example

cURL · cURL
curl -L -X GET "https://api-cpaas.sms.es/news/v1/services/{serviceUuid}/campaigns/{campaignUuid}" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access_token>"

Responses

Campaign data

application/json
namestringrequired

Campaign Name

Example: New Campaign
statusstringrequired

When creating a campaign it can be either active or draft

Possible values: active, stopped, finished, draft · Example: active
sending_typestringrequired

Messaging channel

Possible values: sms, webpush, email, telegram, rbm, whatsapp · Example: sms
schedule_typestringrequired

Schedule type defines when a campaign is to be executed, now run as soon as saved, once run once in the defined future time, scheduled run per rrule spec

Possible values: now, once, scheduled · Example: once
schedule_rrulestring

This field defined how and when the campaign is to be execute. In the case of schedule_type once this is time in the format Y-m-d H:i:s in UTC timezone. For scheduled it's iCal RRule string to define recurency

Example: 2024-05-01 17:05:00
templatestringrequired

Campaign message content. On the wire this is always a string, but its decoded form depends on sending_type:

  • sms — plain text (not JSON), e.g. Hello world.
  • webpush — a JSON-serialized webpush payload (title/body/icon/image/ target URL); this is JSON but not the Esperanto format.

  • all other channels (email, telegram, rbm, whatsapp) — a JSON-serialized Esperanto MessageBatch (an object with a messages array). A single message may also be supplied as the bare message body and is wrapped into a MessageBatch automatically.

See x-content-schema for the machine-readable definition of each decoded form.

Example: Hello world
webpush_titlestring

Webpush message title

webpush_bodystring

Webpush message content body

webpush_target_urlstring

Webpush message target URL

webpush_iconstring

Webpush message URL to an icon

webpush_imagestring

Webpush message URL to an image

senderstringrequired

Campaign messages sender, depending on the sending type, a sender can be sms registered sender id, email email address, whatsapp business phone number id

Example: +41587000000
recipient_listsstringrequired

one or more (comma separated) list uuid(s) from which the contacts are to be targeted

Example: cf9eeb30-c1af-11ee-8073-bf4d6e8c1618
query_typestring

If all contacts from a list are to be targeted, use all. If you want to apply segmentation by query field set this value to segmentation

Possible values: all, segmentation · Example: segmentation
querystring

Segmentation query applied when query_type is segmentation. On the wire this is a JSON-serialized string, but its decoded structure is the SegmentationQuery model: an object with a segmentation array of groups (SegmentationQueryGroup), each combining an operator with an array of rules (SegmentationRule). See x-content-schema below for the full, machine-readable definition of the encoded value.

Example: {"segmentation":[{"operator":"OR","rules":[{"field":"subscription_options_in","condition":"in","value":["7c4c1e07-4c65-4861-ab82-9f8fd9cd3913","94bb60a3-7b4b-4614-913c-0a2760e5f633"],"operator":"AND"}]}]}
uuidstring

Campaign ID.

created_dtstring (date-time)

Campaign's created time in RFC3339 format.

updated_dtstring (date-time)

Campaign's updated time in RFC3339 format.

next_dtstring (date-time)

Campaign's next execution time in RFC3339 format.

last_dtstring (date-time)

Campaign's last execution time in RFC3339 format.

Example response
{
  "name": "New Campaign",
  "status": "active",
  "sending_type": "sms",
  "schedule_type": "once",
  "schedule_rrule": "2024-05-01 17:05:00",
  "template": "Hello world",
  "webpush_title": "string",
  "webpush_body": "string",
  "webpush_target_url": "string",
  "webpush_icon": "string",
  "webpush_image": "string",
  "sender": "+41587000000",
  "recipient_lists": "cf9eeb30-c1af-11ee-8073-bf4d6e8c1618",
  "query_type": "segmentation",
  "query": "{\"segmentation\":[{\"operator\":\"OR\",\"rules\":[{\"field\":\"subscription_options_in\",\"condition\":\"in\",\"value\":[\"7c4c1e07-4c65-4861-ab82-9f8fd9cd3913\",\"94bb60a3-7b4b-4614-913c-0a2760e5f633\"],\"operator\":\"AND\"}]}]}\n",
  "uuid": "string",
  "created_dt": "2026-01-01T12:00:00Z",
  "updated_dt": "2026-01-01T12:00:00Z",
  "next_dt": "2026-01-01T12:00:00Z",
  "last_dt": "2026-01-01T12:00:00Z"
}