Patches a Campaign

PATCH/campaigns/{id}

Patches a Campaign for a given Campaign id.

Privileges: campaign-detector.manage

Auditlog Event: campaign.detector.campaign.patch

Errors:

  • CAMPAIGN_DETECTOR_API_CAMPAIGN_NOT_FOUND - campaign not found
  • BAD_REQUEST_BODY_FORMAT - Unable to decode request body
  • INT_APP_ERROR - unexpected internal error / missing instance context

Validation Errors:

  • CAMPAIGN_DETECTOR_API_CAMPAIGN_STATUS_NOT_SUPPORTED - The given status is not supported
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_ARCHIVED_STATUS_CANNOT_BE_CHANGED - The status of the archived campaign cannot be changed
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_DURATION_NOT_SUPPORTED - The given active duration value is not supported
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_DURATION_CANNOT_BE_UPDATED - The action duration can be changed only for active or inactive campaigns
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_NAME_IS_REQUIRED - The name is a required field and cannot be empty
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_NAME_IS_TOO_LONG - The name cannot be longer than 255 characters
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_PRIORITY_NOT_SUPPORTED - The given priority value is not supported
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_LANG_LEN_NOT_EQ_2 - The lang field must have 2 characters
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_LANG_NOT_FOUND - Language not found
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTION_NOT_SUPPORTED - The given action value is not supported
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTION_METHOD_REQUIRED - The action method id required and cannot be empty
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_GROUP_NOT_FOUND - campaign group not found
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_CANNOT_BE_IGNORED - Only new campaigns can be ignored
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_UNTIL_DT_IS_REQUIRED - The value for the active until dt field is required and cannot be empty
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_UNTIL_DT_NOT_VALID_FORMAT - The value for the active until dt field is not in the valid date-time format
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_UNTIL_DT_IS_FAR_IN_FUTURE - The given value for the active until dt field is in far in the future
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_ACTIVE_UNTIL_DT_IS_IN_PAST - The given value for the active until dt field cannot be in the past
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_TAG_IS_INACTIVE - Campaign tag tagname is inactive
  • CAMPAIGN_DETECTOR_API_CAMPAIGN_LANGUAGE_IS_TOO_LONG - The language cannot be longer than 50 characters
Base URL
https://api-cpaas.sms.es/bulk/campaign-detector/v1
Authentication

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

Request

Path parameters

idintegerrequired

Campaign ID

Body required

application/json
actionstring
Possible values: none, silently-drop, reject-standard, reject-custom
actionMethodobject
Show child attributes
methodstring
objectstring
parametersobject
Show child attributes
chargestring
dlrErrorstring
dlrStatusstring
activeDurationstring

Use a activeUntilDt field if this value is equal to 'limited'. Use this only if the status is equal to active or inactive.

Possible values: unlimited, limited
activeUntilDtstring (date-time)

This value cannot be in the past and cannot be in the far future

confobject
groupIdinteger
langstring
min length: 2 · max length: 2
languagestring
namestring
max length: 255
prioritystring
Possible values: low, normal, high, critical
statusstring

The status of the archived campaign cannot be changed.

Possible values: active, ignored, inactive, archived
tagsobject[]
Show child attributes
idintegerrequired

Request example

cURL · cURL
curl -L -X PATCH "https://api-cpaas.sms.es/bulk/campaign-detector/v1/campaigns/{id}" \
  -H "Content-Type: application/json" \
  -H "Accept: application/json" \
  -H "Authorization: Bearer <access_token>" \
  --data-raw '{
  "action": "none",
  "actionMethod": {
    "method": "string",
    "object": "string",
    "parameters": {
      "charge": "string",
      "dlrError": "string",
      "dlrStatus": "string"
    }
  },
  "activeDuration": "unlimited",
  "activeUntilDt": "2026-01-01T12:00:00Z",
  "conf": {},
  "groupId": 0,
  "lang": "string",
  "language": "string",
  "name": "string",
  "priority": "low",
  "status": "active",
  "tags": [
    {
      "id": 0
    }
  ]
}'

Responses

Campaign data

application/json
actionstring
Possible values: none, silently-drop, reject-standard, reject-custom
actionMethodobject
Show child attributes
methodstring
objectstring
parametersobject
Show child attributes
chargestring
dlrErrorstring
dlrStatusstring
activeDurationstring
Possible values: unknown, unlimited, limited
activeUntilDtstring (date-time)
confobject
flagsstring
groupobject
Show child attributes
idinteger
namestring
groupIdinteger
idinteger
insertDtstring (date-time)
instanceIdinteger
langstring
langDataobject
Show child attributes
idstring
namestring
languagestring
msgCodingstring
Possible values: gsm, unicode, binary, unknown
msgDtstring (date-time)
msgHashstring
msgSenderstring
msgTextstring
msgTypestring
Possible values: mt, mo
namestring
prioritystring
Possible values: low, normal, high, critical
smsPartinteger

it makes sense only if smsTotalParts > 0, i.e. 0 <= smsPart <= smsTotalParts

smsTotalPartsinteger

indicates does template represents concatenated message or not, when value is > 0 then this is concatenated message

statusstring
Possible values: new, active, ignored, inactive, archived
statusDtstring (date-time)
tagsobject[]
Show child attributes
idinteger
namestring
typestring
Possible values: system, custom
totalHitsinteger
updateDtstring (date-time)
Example response
{
  "action": "none",
  "actionMethod": {
    "method": "string",
    "object": "string",
    "parameters": {
      "charge": "string",
      "dlrError": "string",
      "dlrStatus": "string"
    }
  },
  "activeDuration": "unknown",
  "activeUntilDt": "2026-01-01T12:00:00Z",
  "conf": {},
  "flags": "string",
  "group": {
    "id": 0,
    "name": "string"
  },
  "groupId": 0,
  "id": 0,
  "insertDt": "2026-01-01T12:00:00Z",
  "instanceId": 0,
  "lang": "string",
  "langData": {
    "id": "string",
    "name": "string"
  },
  "language": "string",
  "msgCoding": "gsm",
  "msgDt": "2026-01-01T12:00:00Z",
  "msgHash": "string",
  "msgSender": "string",
  "msgText": "string",
  "msgType": "mt",
  "name": "string",
  "priority": "low",
  "smsPart": 0,
  "smsTotalParts": 0,
  "status": "new",
  "statusDt": "2026-01-01T12:00:00Z",
  "tags": [
    {
      "id": 0,
      "name": "string",
      "type": "system"
    }
  ],
  "totalHits": 0,
  "updateDt": "2026-01-01T12:00:00Z"
}