A script to mass update Intercom contacts
Create a .env
file based on .env.example
by copying the example and filling in the bearer token value of you Intercom workspace.
cp .env.example .env
Install packages
npm install
npm run getContacts
- Get a list of all contact ids associated with your workspace
npm run sweepContacts
- Update the list of contacts based on defined request
You can do what you want with the fetched contacts by altering the requestOpts body property in voidCustomAttributes.js:
requestOpts.body = JSON.stringify({
custom_attributes: {
my_atttribute: "Updated value",
},
});
https://developers.intercom.com/docs/references/rest-api/errors/rate-limiting/