Contacts
6 endpoints in this family.
List contacts
GET/api/v1/contacts
Returns the people this workspace has talked to, searchable by name, phone number or email.
Query parameters
qstringSearch by name, phone number or email.
consentstringOnly contacts with this broadcast consent:
in(recorded),out(withdrawn),unknown(never asked).inoutunknownblockedbooleantruekeeps only blocked contacts.channelstringOnly contacts who have a conversation on this channel type (for example
whatsapp).scopestringaccountfor the contacts of every client of your account, each with itsclient(a key that sees every client).accountlimitintegerHow many to return.
cursorstringOpaque cursor from the previous page.
Response
A page of contacts.
data.itemsContact[]The contacts, newest first.
data.nextCursorstringPass it as
cursorfor the next page;nullat the end.data.hasMorebooleanWhether another page exists.
data.totalintegerHow many match, on the first page only;
nullafter.
curl https://nodium.io/api/v1/contacts \ -H "Authorization: Bearer $NODIUM_KEY"{ "data": { "items": [ {} ], "nextCursor": "…", "hasMore": true, "total": 0 }}Create a contact
POST/api/v1/contacts
Creates someone before they have written. A contact needs at least one identity — a phone number or an email address — otherwise nothing can ever reach them.
If that identity is already known, the existing contact is returned rather than duplicated.
Body
displayNamestringTheir name, as you want it displayed.
phonestringPhone number in E.164 form.
emailstringEmail address.
Response
The contact.
data.contactContact
Refusals
- 422
no_identityNeither a phone number nor an email address was given.
curl -X POST https://nodium.io/api/v1/contacts \ -H "Authorization: Bearer $NODIUM_KEY" \ -H "Content-Type: application/json" \ -d '{ "phone": "+33612345678" }'{ "data": { "contact": { "id": "…", "displayName": "…", "phone": "…", "email": "…", "externalId": "…", "optInAt": "…", "optOutAt": "…", "blocked": true, "conversationCount": 0, "createdAt": "…", "updatedAt": "…" } }}Get one contact
GET/api/v1/contacts/{id}
Returns the contact with all their identities and their conversations.
Path parameters
idstringThe contact id.
Response
The contact.
data.contactContact
curl https://nodium.io/api/v1/contacts/<id> \ -H "Authorization: Bearer $NODIUM_KEY"{ "data": { "contact": { "id": "…", "displayName": "…", "phone": "…", "email": "…", "externalId": "…", "optInAt": "…", "optOutAt": "…", "blocked": true, "conversationCount": 0, "createdAt": "…", "updatedAt": "…" } }}Update a contact
PATCH/api/v1/contacts/{id}
Changes the name, the consent (optIn) or the block flag (blocked). Fields you leave out keep their value.
Blocking also blocks at WhatsApp, on every WhatsApp number of the client this contact has a conversation with: the person can no longer write to it. WhatsApp only blocks someone who wrote to the number in the last 24 hours; when it refuses, the contact stays blocked in Nodium (nothing is sent, their messages are discarded) and whatsappBlock says which number refused and why. Unblocking works at any time.
Path parameters
idstringThe contact id.
Body
displayNamestringTheir name.
optInbooleantruerecords the broadcast consent,falsewithdraws it.blockedbooleantrueblocks the contact: nothing is sent to them, their messages are discarded.
Response
The contact, updated.
data.contactContactdata.whatsappBlockobject[]Only when
blockedwas sent: one line per WhatsApp number,channelId,okanderror(WhatsApp's reason when it refused).
curl -X PATCH https://nodium.io/api/v1/contacts/<id> \ -H "Authorization: Bearer $NODIUM_KEY" \ -H "Content-Type: application/json" \ -d '{ "displayName": "…", "optIn": true }'{ "data": { "contact": { "id": "…", "displayName": "…", "phone": "…", "email": "…", "externalId": "…", "optInAt": "…", "optOutAt": "…", "blocked": true, "conversationCount": 0, "createdAt": "…", "updatedAt": "…" }, "whatsappBlock": [ {} ] }}Export contacts as CSV
GET/api/v1/contacts/export
Returns the contacts of your workspace as a CSV file (UTF-8), with the same filters as GET /contacts. At most 10,000 rows: narrow the filters beyond that. Columns: id, name, phone, email, external_id, consent (in, out or unknown), blocked, conversations, created_at, updated_at.
Query parameters
qstringSearch by name, phone number or email.
consentstringOnly contacts with this broadcast consent.
inoutunknownblockedbooleantruekeeps only blocked contacts.channelstringOnly contacts who have a conversation on this channel type.
Response
The CSV file.
curl https://nodium.io/api/v1/contacts/export \ -H "Authorization: Bearer $NODIUM_KEY"Returns the file itself, not wrapped: its type is in Content-Type.
Erase a person, for good
DEL/api/v1/privacy/contacts/{id}
Irreversible. Deletes the contact, their identities, their messages and their conversations. Meant for a right-to-erasure request.
What is kept is what carries no personal data: counters, and the record that an erasure happened. The call returns a report of what was removed.
Path parameters
idstringThe contact id.
Response
A report: what was erased, and how much of it.
data.erasedbooleanAlways
true.data.removedobjectCounts removed:
identities,conversations,messages,files(stored media).data.emptiedobjectCounts kept for deduplication but emptied of their content:
providerEvents,eventLog,webhookDeliveries.
curl -X DELETE https://nodium.io/api/v1/privacy/contacts/<id> \ -H "Authorization: Bearer $NODIUM_KEY"{ "data": { "erased": true, "removed": {}, "emptied": {} }}