API
Contacts API
Create and update contacts from any system (a backend, a data warehouse, a partner integration) through one generic endpoint, single or batch. Field names are matched intelligently, unknown fields become custom properties, and consent is protected by design: syncing data can never resubscribe someone who opted out.
On this page10 sections
Which endpoint do I want?#
- POST /api/v1/contacts (this guide): syncing contact data: bulk upserts, enrichment, migrations. Never triggers automations.
- POST /api/leads/intake: a signup event: one person just opted in, welcome automations should fire.
1. Create an API key#
- Go to Settings → API keys and create a key. The narrow Contact intake only scope is enough for this endpoint; the optional
crmblock below needs a Full access key. - Authenticate every call with
Authorization: Bearer sc_live_…(orX-API-Key).
2. One contact#
curl -X POST https://www.sendcore.me/api/v1/contacts \
-H "Authorization: Bearer sc_live_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"email": "anna@example.com",
"first_name": "Anna",
"phone": "+39 333 1234567",
"birthday": "1990-07-15",
"tags": ["VIP", "Fiera Milano"],
"consent": "subscribed",
"consent_attestation": true,
"consent_source": "landing_signup",
"piano_scelto": "premium"
}'Response. One row per contact, always telling the whole truth:
{
"ok": true,
"contact": {
"email": "anna@example.com",
"created": true, // created vs updated
"consent_state": "SUBSCRIBED",
"consent_preserved": false, // true = your "subscribed" did not apply
"first_subscription": true, // transitioned into SUBSCRIBED
"suppressed": false // true = on the unsubscribe list: accepted, but won't be mailed
}
}3. Batch#
Send up to 500 contacts per request as { "contacts": [ … ] }. Rows that fail validation are reported by index in invalid without failing the rest; duplicate emails within one batch collapse to the last occurrence.
curl -X POST https://www.sendcore.me/api/v1/contacts \
-H "Authorization: Bearer sc_live_xxxxxxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{"consent_attestation": true, "contacts": [
{"email": "anna@example.com", "first_name": "Anna"},
{"email": "marco@example.com", "first_name": "Marco", "consent": "subscribed"}
]}'Response:
{
"ok": true,
"results": [ { "email": "…", "created": true, … } ],
"invalid": [ { "index": 3, "error": "invalid_email" } ],
"stats": { "received": 120, "created": 80, "updated": 39, "invalid": 1, "suppressed": 2, "consent_preserved": 0, "unreadable_birthdays": 0, "subscribed_without_attestation": 0, "held": 0 }
}Field names#
Keys go through the same matching engine as the CSV importer: email_address, firstName, phone_number, Date of birth, a single full_name (split into first/last) and Italian names like telefono or cognome all land on the right field. address, city, state, postal_code and country (and their aliases: indirizzo, zip, cap…) are stored as the canonical address properties, the ones segments filter on and the export names. Any other scalar key is kept as a custom property (at most 15 per contact); non-scalar values are refused and listed in ignored_keys rather than guessed at. Explicit custom_properties win over auto-detected keys.
birthday is read like the birthday column of an import: 1990-07-15, or day first, 15/07/1990 (also with - or .), or an Excel date number. 05/03/1990 is 5 March; only a second number above 12 makes it month first. A birthday without the year, with a two-digit year or that does not exist is not saved (a birthday already stored stays) and is counted in stats.unreadable_birthdays. See How the birthday is read.
Consent, precisely#
- Omit consent when syncing data. The presence of an email in your system is not marketing consent. A row without
consentnever changes an existing contact's state; a new contact lands asUNKNOWN. "consent": "subscribed"is an assertion that this person actually opted in (form, checkbox, verbal consent you recorded). It applies only together with"consent_attestation": true(see Consent attestation). Send it only then: it updates existing contacts too.- Mirroring another system? A full export or a nightly sync carries the consent you recorded back then, not what the person chose since. Add
"consent_policy": "preserve"at the top level of the request (next tocontacts, or beside the fields of a single contact):subscribedthen applies to new contacts only, an existing contact keeps the choice made in Sendcore, and every other field still updates. Rows where that protection applied come back withconsent_preserved: true. The default,"assert", is the behaviour above. "consent": "unsubscribed"always applies: downgrading is the safe direction. Accepted dialects: yes/no, true/false, subscribed/unsubscribed/non-subscribed, opted in/opted out…- People who clicked unsubscribe are on the suppression list, and this API never removes them from it, whatever you send. Their rows come back with
suppressed: trueand are never markedSUBSCRIBED: data accepted, no marketing email will go out.
A nightly mirror of your own database, then, looks like this. New people land subscribed, everyone else keeps their choice, and every address, phone and property still updates:
{
"consent_policy": "preserve",
"consent_attestation": true,
"contacts": [
{ "email": "anna@example.com", "first_name": "Anna", "city": "Firenze", "consent": "subscribed" },
{ "email": "marco@example.com", "first_name": "Marco", "city": "Prato", "consent": "subscribed" }
]
}Consent attestation#
A contact is saved as SUBSCRIBED only when the request carries "consent_attestation": true at the top level (next to contacts, or beside the fields of a single contact). It is your statement that the people you send as subscribed agreed to receive your marketing emails. Sendcore records it on the import, with the API key that sent it and when.
- Only the JSON value
truecounts."true",1or a missing field do not. - Without it, the contacts are still saved, every field included, but
subscribedis not applied: a new contact lands asUNKNOWN(not subscribed), an existing one keeps its state. Each such row comes back withconsent_needs_attestation: true,stats.subscribed_without_attestationcounts them, andwarningssays it in words. This is deliberate: an integration that sentsubscribedbefore this rule existed keeps working, but no longer subscribes anyone until it adds the attestation. - Optional
consent_sourceat the top level says where the consent was given, in your words (up to 60 characters, for example"Newsletter form 2025"). It is stored as each subscribed contact's consent source. Aconsent_sourceon a single row wins for that row. unsubscribednever needs the attestation: it always applies.
Large imports#
The API counts as an import, like a file in Audience → Imports, and no import is held, however many new contacts your requests add: every row is applied as the request says, under the consent rules above. See Large imports.
stats.heldis always0. It stays in the response so an integration that reads it keeps working. No row carriesheld: trueand no response carriesholdany more.- Until 21 November 2026 the new contacts past a daily limit were held, not subscribed. For an import held then that still waits,
GET /api/v1/contacts/import-holdslists it (normally the list is empty), withrun_id,limitandlimit_reason(bandoryoung_account).POST /api/v1/contacts/import-holdswith{ "run_id": "…", "choice": "…" }makes the same choices as the box:keep_up_to_limitorrequest_review(with an optionalnote). It needs a Full access key. check_upgradeis retired with the limit: it changes nothing and answers409withhold_retired. A run_id that is not a held import answers404. Both answers say that imports are no longer held.
Sendcore logs every request as part of an import: the API's requests of one day (UTC) share one import record, with its counts and the attestation. The response's run_id names it.
CRM handoff (optional)#
Add a crm block to any row to also create or update a CRM card, idempotently: same (source, external_id) → same card, forever (external_id defaults to the contact's email). Needs a Full access key and a plan with the CRM; if either is missing the contact is still saved and the row's crm result carries the error.
{
"email": "anna@example.com",
"consent": "subscribed",
"consent_attestation": true,
"crm": {
"pipeline_id": "…", // required: see /api/v1/crm/pipelines
"stage_id": "…", // optional: moves the card when it changes
"external_id": "LEAD-12345", // optional: defaults to the email
"source": "my_backend", // optional label, default contacts_api
"title": "Anna: premium", // optional
"amount": 1200 // optional
}
}Idempotency, limits, errors#
- Repeating a request converges to the same state: safe to retry on any failure.
- On
429or a 5xx, retry with exponential backoff (2s, 4s, 8s), as the PHP example does. Other 4xx are validation refusals: fix the payload or the key instead of retrying. - Rate limits: 240 requests/min per IP, 300/min per account (HTTP 429,
rate_limit_exceeded). - Errors are stable tokens with the usual statuses:
missing_api_key/invalid_api_key(401),key_scope_insufficient(403),invalid_json/invalid_email/batch_too_large(400).