Delete a contact and their data
const url = 'https://api.threadkite.app/v1/contacts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/erase';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"confirm":"ERASE","includeDuplicates":true}'};
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.threadkite.app/v1/contacts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/erase \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "confirm": "ERASE", "includeDuplicates": true }'Deletes the contact’s messages, files, chat transcripts, call recordings (at Twilio too), form submissions, lead emails and consent details, with the contacts merged with it and (unless includeDuplicates is false) other contacts with the same email address or phone number. Counts and reports stay correct. Use it to honour an erasure request. Runs in the background: poll GET /v1/privacy/requests/{id}; a contact.erased webhook follows for each contact. Cannot be undone. If they get in touch again, they are a new contact.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The contact’s name, or ERASE, typed to confirm
Example
ERASEAlso delete other contacts with the same email address or phone number (the same person entered twice)
Responses
Section titled “Responses”object
queued and running while the worker is on it, done, failed (run it again), or expired (an export past its download date)
The contact it was asked for
The contact’s name now (null once their data is deleted)
Every contact covered (merged and same-person contacts too)
Who asked: a team member or an API key
Whether you asked for it (only you can download your export)
object
Contacts covered (merged and same-person contacts too)
Messages, notes and events, including chat transcripts
Files they sent or were sent
Website assistant chats
Calls (kept for counts; their number and transcript go)
Recordings and voicemails deleted in your Twilio account
Recordings Threadkite can’t delete (ones in an account that is no longer connected)
Recordings a provider has not deleted yet (retried daily)
Voicemail transcripts
Contact form submissions
Lead emails as they arrived
Marketplace conversations
Consent records (an opt-out is kept, without its details)
Consent history events (every change and its proof)
Ids in other systems
Linked records (deals, invoices) on their threads
Tasks on their threads (titles and notes cleared)
Appointments with them (notes cleared)
Replies to them not sent yet (deleted)
Replies the AI drafted for the team on their threads (deleted)
Things they own (deleted)
Files deleted from storage
Events about them (an export)
Automations they went through (an export)
Bulk messages they were sent, or kept from (an export)
Videos sent to them (an export)
What the organisation’s industry pack holds about them besides counts (only what there is)
object
Stable, and namespaced by the pack that holds it
What it is, in plain words
Plain-English notes for you
object
The id to find it by in the provider account (Twilio RecordingSid)
An export’s size in bytes
When an export’s download stops working
An export you can download now
Example
{ "kind": "erasure", "status": "queued", "packItems": [ { "key": "property.viewings", "label": "Viewings" } ], "recordingsLeftAtProvider": [ { "provider": "twilio" } ]}The confirmation is not the contact’s name or ERASE (code confirmation_mismatch)
object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}Missing or invalid API key
object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}The organisation is on the Free plan (code upgrade_required)
object
Stable machine-readable reason
The feature that needs Pro
Where to upgrade or pay, in the web app
Example
{ "statusCode": 402, "code": "upgrade_required", "message": "Connections are part of Pro. Upgrade to connect texts, calls and more.", "feature": "extraSeats", "upgradePath": "/settings/billing"}The key does not have the scope (or the person the permission)
object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}Already deleted
object
Stable machine-readable reason
With code invalid: every problem with the request, by field (message is the first)
object
Dotted path inside the item, e.g. attributes.price.amountMinor
Example
{ "statusCode": 403, "code": "forbidden", "message": "You do not have permission to do that.", "errors": [ { "message": "Enter the make" } ]}Rate limit reached
object
Stable machine-readable reason
Seconds until another request will be accepted
Example
{ "statusCode": 429, "code": "rate_limited", "message": "Too many requests. Each key can make 120 requests a minute; try again in 12 seconds.", "retryAfter": 12}