Skip to main content

Subscribe a user(s) to a list

PUThttps://api.courier.com/lists/:list_id/subscriptions
Subscribe multiple recipients to a list (note: if the List does not exist, it will be automatically created)
PATH PARAMS
list_idstringrequired
A unique identifier associated with the list you wish to retrieve.
BODY PARAM
recipientsarray
An array of list subscriptions
Responses
AUTH TOKEN
curl --request PUT \
--url https://api.courier.com/lists/example.list.id/subscriptions \
--header 'Accept: application/json'
Response Example
Empty

Example

Method: PUT

URL: https://api.courier.com/lists/abcdefgh12345678/subscriptions

Body: ​

{
"recipientId": "0460766e-8463-4905-ae98-b72c7aef41d6",
"preferences": {
"notifications": {
"abcdefgh12345678": {
"channel_preferences": [
{
"channel": "direct_message"
}
],
"rules": [
{
"type": "snooze"
}
],
"status": "OPTED_IN"
}
},
"categories": {
"cooking": {
"channel_preferences": [
{
"channel": "direct_message"
}
],
"rules": [
{
"type": "snooze"
}
],
"status": "OPTED_IN"
}
}
}
}