Update Subscription Details

This API allows you to update SMS/email subscription details of a customer.

Note

📘

Make sure communication channels like Mobile and Email are configured in InTouch for subscription.

Example request

curl --location 'https://eu.api.capillarytech.com/v1.1/customer/subscriptions?format=json' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic =' \
--header 'Cookie: _cfuvid=iH5ZoGjh2NaRGTbIMaIYS6zsemu6jtA_Dya0VMkpL3c-1757338223833-0.0.1.1-604800000' \
--data-raw '{
  "root": {
    "subscription": [
      {
        "email": "[email protected]",
        "priority": "bulk",
        "scope": "all",
        "channel": "email",
        "is_subscribed": "1"
      },
      {
        "email": "[email protected]",
        "priority": "bulk",
        "scope": "all",
        "channel": "sms",
        "is_subscribed": "0"
      }
    ]
  }
}'

API Endpoint Example

curl --location 'https://eu.api.capillarytech.com/v2/customers/565039505/subscriptions?format=json' \
--header 'accept: application/json' \
--header 'content-type: application/json' \
--header 'Authorization: Basic dGpfY2FwaWxsYXJ5OjVjMTc3MDJlOTI5NjQ4MjUzZTY3ZDJiMGM2ZTk5ZjE5' \
--header 'Cookie: _cfuvid=ELP_n3u8qC1Vt2z0yryFjifRT6N.CVONHAt3Fse0zsQ-1750659660819-0.0.1.1-604800000; _cfuvid=Xlu0xR4rWHodl7BXGQjSJ88NKmFp2TybTHNUzeYcwfs-1750676916066-0.0.1.1-604800000' \
--data '
{
  "communicationId": -1,
  "campaignId": -1,
  "reason": "This is V2 subscription api",
  "scope": {
    "scope": "USER",
    "subScope": "NONE"
  },
  "subscriptions": [
    {
      "channel": "EMAIL",
      "priority": "BULK",
      "type": "OPTOUT",
      "orgUnitId": 200031782,
      "sourceName": "FACEBOOK",
      "accountId": "01"
    },
    {
      "channel": "MOBILE",
      "accountId": "01",
      "priority": "BULK",
      "type": "OPTIN",
      "orgUnitId": 200031782,
      "sourceName": "FACEBOOK"
    },
    {
      "channel": "EMAIL",
      "accountId": "01",
      "priority": "TRANS",
      "type": "OPTIN",
      "orgUnitId": 200031782,
      "sourceName": "FACEBOOK"
    },
    {
      "channel": "MOBILE",
      "accountId": "01",
      "priority": "TANS",
      "type": "OPTOUT",
      "orgUnitId": 200031782,
      "sourceName": "FACEBOOK"
    }
  ]
}
'

Prerequisites

  • Basic Authentication
  • Default access group

Resource information

URIv1.1/customer/subscriptions
HTTP methodPOST
AuthenticationBasic
Pagination supported?No
Rate limitYes
Batch supportNo

Request Body Parameters

ParameterDatatypeDescription
mobile/email/external_id/id*stringProvide any of the customer identifiers to update subscription details.
priority*enumSpecify the service that you want to update. Value: TRANS for personalized messages, and BULK for campaign or promotional messages.
scopeenumSet the scope to 'all' always.
channel*enumPass the communication channel that you want to update. Value: sms, email.
is_subscribed*enumSpecify 0 to unsubscribe, 1 to subscribe.

Response parameters

FieldTypeDescription
responseObjectTop-level wrapper for status and subscription results.
statusObjectOverall API execution status.
successboolean/stringWhether the request succeeded (may be "true"/"false" as strings).
codeintegerHTTP-like status code (e.g., 200).
messagestringHuman-readable status message.
totalintegerTotal number of items processed/returned.
success_countintegerNumber of items successfully processed.
subscriptionsObjectContainer for subscription records.
subscriptionArray of objectsList of subscription results, one per channel/scope.
user_idstringInternal user identifier.
mobilestringMSISDN in country code format (e.g., "91xxxxxxxxxx").
emailstringEmail address of the user.
channelstringCommunication channel (e.g., "EMAIL", "SMS").
prioritystringMessage priority/category (e.g., "BULK").
scopestringSubscription scope (e.g., "ALL").
is_subscribedintegerSubscription flag per channel/scope (1/0 or "1"/"0").
item_statusObjectPer-item operation status.
codeintegerItem-level status/result code (e.g., "1000").
messagestringItem-level status message.
successbooleanWhether the item operation succeeded.

Error codes

CodeDescription
201Some requests have failed due to errors.
400Bad Request. The request is malformed or missing required parameters (e.g., invalid format).
401Unauthorized. Authentication failed or the user lacks valid credentials.
500Internal Server Error. An unexpected server error occurred.
Language
Credentials
Basic
base64
:
URL
Click Try It! to start a request and see the response here!