Create Subscription

The Create Subscription command allows you to add a new Subscription to a List for a specific Contact.  See REST API Subscriptions Overview for a table of Subscription data available to POST.  Subscription creation does not result in a tracking event.  It also does not allow you to overwrite opt outs using a Force Subscribe option.

POST /subscriptions


Request Body Parameters

The Create Subscription command requires the following in the Posted JSON:

  • Subscriber ID: "subscriberId": [subscriberId], an integer > 0
  • List ID: "listId": [listId], an integer > 0
  • Format: "formatId": [1,2,99], where 1=plain text, 2=html, and 99=MIME

All other POST-able fields are optional, and can be found in the Data Fields table in REST API Subscriptions Overview.   

Request Body Example

Using Create Contact with all arguments, line breaks in JSON for readability:

curl --request POST \ 
--url '' \
--header 'authorization: Basic bXlBY2NvdW50Onh5enB3ZDEyMw==' \
--header 'content-type: application/json' \
--header 'accept: application/vnd.whatcounts-v1+json' \
--data '{ "subscriberId": 7160984, "listId": 5, "formatId": 99 }' \

Response Body

The response returns all available Subscription data.  Based on the example above, the response returns:

HTTP/1.1 200 OK
Server: serverName
Content-Type: application/json
Content-Length: 926
Link: <>;
Date: Fri, 17 Jun 2016 12:54:44 GMT
"subscriptionId": 120002
"subscriberId": 7160984 "listId": 5 "formatId": 99 "createdDate": "Jun 17, 2016 1:12:54 PM" }

Error Response

Error Response Codes include both Client Errors (4xx) and Server Errors (5xx).  Descriptions of each can be found in Response Codes

For example, if a Subscription already exists for the Contact, the error would appear as:

"error": "Cannot insert duplicate subscription"
"status": "Internal Server Error"
"statusCode": 500
Was this article helpful?
0 out of 0 found this helpful
Have more questions? Submit a request


Powered by Zendesk