API
Contacts API
Add, update, list, and remove subscribers.
These routes manage subscribers in the key's project.
/api/v1/contactsScope
Query
qstatuslimitoffsetEach contact includes verification_status (valid, risky, invalid, or null when not checked yet), verification_reason, and verification_suggestion. Reasons: syntax, no_mx, previously_bounced, complained, disposable, typo, dns_timeout.
Each contact also includes country, tags (a list of words), and custom, which holds the contact's values for your contact fields by key. Fields with no value are left out of custom.
email is null for a contact saved with only a phone or WhatsApp number. instagram_user_id is the contact's Instagram user id, or null.
/api/v1/contactsScope
Fields
emailfirst_namelast_namephonewhatsappcountrynotesstatustagscustomlist_idsforce_resubscribeUpsert
/api/v1/contacts/upsertScope
Fields
emailRequiredfirst_namelast_namephonewhatsappcountrynotesstatustagscustomlist_idsforce_resubscribeReturns
id, created, restored, status, verification
Creates the contact, or updates the one with this email. Only the fields you send change, and null clears one. tags replaces the contact's tags. Returns 201 when the contact is new and 200 when it already existed. A deleted contact with the address is restored with the same id.
{
"email": "priya@example.com",
"first_name": "Priya",
"tags": ["vip"],
"custom": { "order_count": 3 }
}Bulk upsert
/api/v1/contacts/bulk-upsertScope
Fields
contacts (required)
Returns
id, status, total, status_url
Up to 1,000 contacts, each with the same fields as upsert. Every contact is checked first. One bad contact, a repeated address, or more new contacts than the plan allows returns an error, and nothing is queued. Otherwise the response is 202 and the contacts are saved in the background, usually within a minute.
{
"contacts": [
{ "email": "ada@example.com", "custom": { "order_count": 1 } },
{ "email": "alan@example.com", "tags": ["vip"] }
]
}/api/v1/contacts/bulk-upsert/{id}Scope
Returns
id, status, total, created, updated, restored, skipped, error, created_at, finished_at
status is queued, running, done, or failed. skipped counts people who unsubscribed and were sent status subscribed without force_resubscribe, and contacts whose field was deleted before the job ran. failed means the plan's contact limit was reached part way: error says so, and the counts show what was saved. Results are kept for 30 days.
One contact
/api/v1/contacts/{id}Scope
/api/v1/contacts/{id}Scope
Fields
emailfirst_namelast_namephonewhatsappcountrynotesstatustagscustomSend email null to remove the address. The contact must keep an email or a valid phone or whatsapp number, or the response is HTTP 422 with code email_or_phone_required. A new phone or whatsapp number that another contact already has returns HTTP 409 with code phone_taken and that contact's id.
/api/v1/contacts/{id}Scope
Deletes the contact. It disappears from every list, count, and API response, and can be restored for your plan's retention period. Returns ok and deleted true.
/api/v1/contacts/{id}/restoreScope
Returns
id, restored
Brings back a deleted contact with the same id, lists, and history. Returns 404 when no deleted contact has that id, and the standard 402 limit error when the project is at its contact limit. Addresses on the suppression list stay there.
Import
/api/v1/contacts/importScope
Fields
contactsRequiredlist_idresubscribeinclude_risky{
"contacts": [{ "email": "ada@example.com", "first_name": "Ada" }],
"list_id": 12,
"resubscribe": false
}list_id must be a static list. A dynamic list returns 409 with code list_is_dynamic.
Up to 200 contacts per request. Unsubscribed addresses are skipped unless resubscribe is true. Each contact can also have country, tags, and custom. Imported tags are added to the ones a contact already has. A wrong custom key or value returns HTTP 422 naming the contact and the key, and nothing is imported. Deleted contacts in the import are restored and counted in restored.
Each contact needs an email or a valid phone or whatsapp number. Contacts with neither are not imported and are listed in invalid with their index and code email_or_phone_required. Contacts are found by email, then by phone number, so a repeated number updates the contact saved earlier in the request. A contact whose email and number belong to two different contacts, or whose number belongs to a contact with another email, is skipped, counted in skippedConflicts, and listed in skipped.
Every address is checked first; contacts without an email are not checked. Invalid addresses are never imported and are counted in skippedInvalid. Risky addresses are imported unless include_risky is false; then they are counted in skippedRisky. The response also has verification, with counts of valid, risky, invalid, and unchecked, and skipped, listing up to 50 skipped addresses with their status and reason.
Language
- Contacts take language
- a code such as en, hi or gu, or a name such as Hindi. hi-IN is saved as hi. Send null to clear it. A language VeloSend doesn't know answers HTTP 400. Contacts are returned with their language, and the campaign sends each person the version in their language when there is one. See Messages in each person's language.
Import quality
/api/v1/contacts/importBody
also returns import_id and quality: { "email_rows": 120"invalid": 9"invalid_share": 7.5"status": "confirm_needed" }. status is okconfirm_needed (5% to 15% of 50 or more email addresses misspelt or on a domain that takes no email) or held (15% or more: the contacts it added are skipped by campaigns and marketing automations until a review). Bulk upserts follow the same rules once their job has checked every address. See Why is my import held?