Add or update subscriptions in bulk by contact key
const url = 'https://api.tryletterhead.com/api/v3/contacts/keyed/example/subscriptions/bulk';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"channels":["example"],"status":1}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.tryletterhead.com/api/v3/contacts/keyed/example/subscriptions/bulk \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "channels": [ "example" ], "status": 1 }'Same as Add or update subscriptions in bulk (POST /api/v3/contacts/{email}/subscriptions/bulk), with the contact addressed by its contactKey instead of its email address. A new subscription is created for each channel the contact isn’t already subscribed to; for channels they already have, the subscription’s status is updated. The same status is applied to every channel in the payload. See the subscription status table on Add or update subscriptions in bulk.
Authorizations
Section titled “Authorizations ”Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters ”The contact’s opaque 64-character hex key.
Request Body required
Section titled “Request Body required ”object
Channel slugs to subscribe (preferred). 1–200 entries, each unique.
The subscription status to apply to every channel in the payload.
Example generated
{ "channels": [ "example" ], "status": 1}Responses
Section titled “ Responses ”200 OK. Same shape as GET /api/v3/contacts/{email}.
object
The contact, with its updated subscription list. Full field list under GET /api/v3/contacts/{email}.
object
Example generated
{ "items": {}, "message": "example", "total": 1}Still can’t find what you need? Contact support.