Skip to content

Developers

Contact sync (CRM)

Keep contacts in your CRM or online store and Hitapo in sync both ways: bulk upsert API, deletion, scheduled contact sources and contact webhooks.

Keep your contacts up to date in one place. Three pieces work together: push (your system sends changed contacts to Hitapo), pull (Hitapo reads your API at regular intervals) and notify (contacts that change in Hitapo come back to you by webhook).

externalId: your own ID

Give each contact the ID it has in your own system (externalId, e.g. your CRM customer number). It's unique within a business and is the most reliable way to match records. On the profile page it appears as Customer no. in your system; you can find a contact with GET /contacts?externalId=….

Push: POST /contacts/sync

Send up to 1,000 contacts per request. Contacts that don't exist are created; existing ones are updated. If you send the same request twice, the second one changes nothing (unchanged), so retries are safe.

Send contacts
curl -X POST https://api.hitapo.com/api/v1/contacts/sync \
  -H "Authorization: Bearer $HITAPO_API_KEY" \
  -H "Content-Type: application/json" \
  -H "X-Hitapo-Sync-Origin: crm" \
  -d '{
    "contacts": [
      {
        "externalId": "CRM-1042",
        "firstName": "Ayşe",
        "lastName": "Yılmaz",
        "phone": "0532 123 45 67",
        "email": "ayse@example.com",
        "tags": ["vip"],
        "attributes": { "city": "Izmir", "customerType": "corporate" },
        "consents": { "MESAJ": { "status": "ONAY", "recipientType": "BIREYSEL" } },
        "lists": { "add": ["<list-id>"] }
      }
    ]
  }'
Response
{
  "total": 1, "created": 1, "updated": 0, "unchanged": 0, "errors": 0,
  "results": [ { "index": 0, "id": "8c2e…", "externalId": "CRM-1042", "status": "created" } ]
}
FieldDescription
externalIdYour ID (up to 200 characters). At least one of externalId, phone or email is required.
genderfemale / male, or spellings such as F, M and the Turkish Kadın, K, Bayan, Hanım (female) and Erkek, E, Bay, Bey (male). Values we don't recognise are ignored. A gender the team entered by hand isn't changed.
name, email, phone, languageFields you don't send are left alone; null clears a field. Phone numbers are accepted in any format (0532…, +90 532…) and stored as +90….
tags, tagsModeadd (default) adds tags; replace replaces the existing tags. The abonelik-iptal (unsubscribed) tag isn't removed by replace.
attributesMerged with existing custom fields. To delete a key, send its value as null.
consentsİYS consents: { status: ONAY | RET, recipientType: BIREYSEL | TACIR } for MESAJ, ARAMA, EPOSTA (approved / rejected; individual / merchant). null sets the consent to unknown.
listsAdd to or remove from static lists with { add: [...], remove: [...] }. A request-level listIds adds all contacts.
optedOuttrue: the contact gets no campaign messages. false: removes that status.

Matching

  • Matching follows the matchBy order; the default is ["externalId", "phone", "email"]. Phone numbers and emails are compared ignoring formatting differences.
  • If a contact with a matching phone or email has a different externalId, it's a separate record in your system: a new contact is created and the two aren't merged automatically.
  • If the new phone or email of a contact you update already belongs to another contact, the two records are merged into one profile (merged: true in the response). No duplicate contacts are created.
  • Emails and phone numbers that a web chat visitor typed in themselves (unverified) aren't used for matching.
  • An error in one record (e.g. an invalid email) doesn't stop the others; that record's result comes back with status: "error" and a human-readable error message (Turkish by default).

Delete: POST /contacts/sync/delete

Delete contacts from Hitapo when they're deleted in your system: send { "externalIds": ["CRM-1042"] }, or { "ids": ["…"] } with Hitapo IDs (up to 1,000). This is the same as the KVKK (data protection) erasure on the profile page: conversations and messages are permanently deleted and call records are anonymised. It can't be undone.

Pull: contact sources

To connect without writing code, go to Contacts › Sync › New source and add a URL that returns your contact list as JSON. Hitapo reads it hourly, daily or weekly and updates contacts using the same rules.

  1. Step 1:
    Connection: name the source, and enter the GET URL and any headers it needs, such as Authorization. Header values are stored encrypted and never shown in plain text again.
  2. Step 2:
    Field mapping: Hitapo reads the first records, lists their fields and suggests a mapping. Mark each field as First name, Phone, E-mail, Customer no. in your system, Tags, Custom field or an İYS consent field. If first and last name are in separate fields, map both to the name; they're joined in order.
  3. Step 3:
    Settings: optionally add the contacts to a list and a tag, and choose how often to refresh.
  4. Step 4:
    Save. The first sync starts right away; the result (new, updated, unchanged, errors) appears on the source's card.
  • If the path to the record list (e.g. data.customers) is empty, the largest list is found automatically.
  • Each run processes up to 20,000 records and a 25 MB response.
  • A source never deletes contacts: contacts no longer in the source stay in Hitapo. To delete them, use POST /contacts/sync/delete.
  • In İYS fields, ONAY, evet (yes), true and 1 count as consent; RET, hayır (no), false and 0 as rejection. Other values are ignored.
  • For security, we never connect to local or private network addresses.

Webhooks and loop prevention

To receive contact changes made in Hitapo, listen to the contact.created, contact.updated and contact.deleted events on the Webhooks page. The body contains the full contact (externalId, tags, custom fields, İYS consents and lists).

contact.updated — data
{
  "contact": {
    "id": "8c2e…", "externalId": "CRM-1042", "name": "Ayşe Yılmaz", "firstName": "Ayşe", "lastName": "Yılmaz", "gender": "female", "salutationByName": false, "email": "ayse@example.com", "phone": "+905321234567",
    "tags": ["vip"], "attributes": { "city": "Izmir" },
    "consents": { "MESAJ": { "status": "ONAY", "recipientType": "BIREYSEL", "source": "API senkronizasyonu" } },
    "lists": [ { "id": "…", "name": "Corporate customers" } ]
  },
  "changes": ["tags"],
  "origin": "dashboard"
}

Limits

  • POST /contacts/sync: 120 requests per minute, 1,000 contacts per request, body up to 10 MB.
  • POST /contacts/sync/delete: 30 requests per minute, 1,000 contacts per request.
  • Up to 20 contact sources per business.

Last updated: