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.