Skip to main content

Subscribe a single user to a list

Subscribe a user to an existing list (note: if the List does not exist, it will be automatically created).

URL: https://api.courier.com/lists/:list_id/subscriptions/:user_id

Method: PUT

Path Parameters

list_idstringrequired
A unique identifier associated with the list you wish to retrieve.
user_idstringrequired
A unique identifier representing the recipient associated with the list

Body Parameters

notificationsrecord
json object that contains notification ids with the respective preferences
categoriesrecord
json object that contains category ids with the respective preferences

Response

status: 204 Successfully created

Request Example

curl --request PUT \
--url https://api.courier.com/lists/example.list.id/subscriptions/0460766e-8463-4905-ae98-b72c7aef41d6 \
--header 'Accept: application/json'

Responses Example

Empty

Example

Method: PUT

URL: https://api.courier.com/lists/abcdefgh12345678/subscriptions/0460766e-8463-4905-ae98-b72c7aef41d6

Body: ​

{
"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"
}
}
}
}
Was this helpful?