📘Make sure communication channels like Mobile and Email are configured in InTouch for subscription.
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"
}
]
}
}'
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"
}
]
}
'
| URI | v1.1/customer/subscriptions |
|---|
| HTTP method | POST |
| Authentication | Basic |
| Pagination supported? | No |
| Rate limit | Yes |
| Batch support | No |
| Parameter | Datatype | Description |
|---|
| mobile/email/external_id/id* | string | Provide any of the customer identifiers to update subscription details. |
| priority* | enum | Specify the service that you want to update. Value: TRANS for personalized messages, and BULK for campaign or promotional messages. |
| scope | enum | Set the scope to 'all' always. |
| channel* | enum | Pass the communication channel that you want to update. Value: sms, email. |
| is_subscribed* | enum | Specify 0 to unsubscribe, 1 to subscribe. |
| Field | Type | Description |
|---|
| response | Object | Top-level wrapper for status and subscription results. |
| status | Object | Overall API execution status. |
| success | boolean/string | Whether the request succeeded (may be "true"/"false" as strings). |
| code | integer | HTTP-like status code (e.g., 200). |
| message | string | Human-readable status message. |
| total | integer | Total number of items processed/returned. |
| success_count | integer | Number of items successfully processed. |
| subscriptions | Object | Container for subscription records. |
| subscription | Array of objects | List of subscription results, one per channel/scope. |
| user_id | string | Internal user identifier. |
| mobile | string | MSISDN in country code format (e.g., "91xxxxxxxxxx"). |
| email | string | Email address of the user. |
| channel | string | Communication channel (e.g., "EMAIL", "SMS"). |
| priority | string | Message priority/category (e.g., "BULK"). |
| scope | string | Subscription scope (e.g., "ALL"). |
| is_subscribed | integer | Subscription flag per channel/scope (1/0 or "1"/"0"). |
| item_status | Object | Per-item operation status. |
| code | integer | Item-level status/result code (e.g., "1000"). |
| message | string | Item-level status message. |
| success | boolean | Whether the item operation succeeded. |
| Code | Description |
|---|
| 201 | Some requests have failed due to errors. |
| 400 | Bad Request. The request is malformed or missing required parameters (e.g., invalid format). |
| 401 | Unauthorized. Authentication failed or the user lacks valid credentials. |
| 500 | Internal Server Error. An unexpected server error occurred. |