Loading...
Skip to main content

Subscribe to one or more lists

Subscribes the given user to one or more lists. If the list does not exist, it will be created.

URL: https://api.courier.com/profiles/:user_id/lists

Method: POST

Path Parameters

user_idstringrequired
A unique identifier representing the user associated with the requested profile.

Body Parameters

listsarray
+ Show Properties

Responses

status: 204 OK

statusstring

status: 400 Bad Request

messagestring
A message describing the error that occurred.
typestring
[invalid_request_error] The type of error that occurred.

Request Example

curl --request POST \
--url https://api.courier.com/profiles/0460766e-8463-4905-ae98-b72c7aef41d6/lists \
--header 'Accept: application/json'

Responses Example

{
"status": "SUCCESS"
}
{
"message": "Error Message",
"type": "invalid_request_error"
}

Example

Method: POST

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

Body: ​

{
"notifications": {
"{notificationKey}": {
"channel_preferences": [
{
"channel": "direct_message"
}
],
"rules": [
{
"type": "snooze"
}
],
"status": "OPTED_IN"
}
}
}