Skip to Content
Contacts APICustomer Profile Sync

Customer Profile Sync API

Use the Contacts API to create and update customer profiles whenever customer data changes in your website, CRM, payment platform, app, database, or internal workflow.

✦
Try this with AI Copilot
Show me how to sync customer profiles with the SMSLeopard Contacts API
Ask AI →

What To Sync

Start with the fields your team needs for segmentation, personalization, and customer understanding.

Source eventProfile fields to update
Website signupName, phone number, email, source, plan, signup date
Payment receivedLast payment date, amount, product, account status
Purchase completedLast purchase, purchase amount, category, branch
Support conversationRecent issue, support status, sentiment, preferred channel
Survey responseNPS score, satisfaction rating, missing data, stated preference

Endpoint

POSThttps://api.smsleopard.com/v1/contacts/create

Example Request

curl -X POST "https://api.smsleopard.com/v1/contacts/create" \ -u "$API_KEY:$API_SECRET" \ -H "Content-Type: application/json" \ -d '{ "name": "Willis Salama", "phone_number": "254700000001", "email": "willis@example.com", "group_ids": [12], "custom_metadata": { "fields": [ { "name": "customer_since", "value": "2023-01-15" }, { "name": "last_purchase", "value": "Premium bundle" }, { "name": "last_purchase_amount", "value": "KES 8400" }, { "name": "preferred_channel", "value": "WhatsApp" }, { "name": "location", "value": "Nairobi" } ] } }'

Updating an Existing Profile

POST /v1/contacts/create only creates. If the phone number is already a contact it returns 400 with "error_code": "contact_exists". To keep a profile current, look it up first:

  1. POST /v1/contacts/lookup with {"phone": "+254700000001"}. The number must start with +. Returns 200 with the contact, or 404 (resource_not_found) when there is none.
  2. Found: PATCH /v1/contacts/{id} with the fields to change: name, email, phone, and custom_fields (same {"fields": [...]} shape as custom_metadata). A field with the same name is replaced; other fields are kept. Returns 200 with the updated contact.
  3. Not found: create it with POST /v1/contacts/create as above.
curl -X POST "https://api.smsleopard.com/v1/contacts/lookup" \ -u "$API_KEY:$API_SECRET" \ -H "Content-Type: application/json" \ -d '{"phone": "+254700000001"}' curl -X PATCH "https://api.smsleopard.com/v1/contacts/123" \ -u "$API_KEY:$API_SECRET" \ -H "Content-Type: application/json" \ -d '{"custom_fields": {"fields": [{"name": "last_purchase", "value": "Premium bundle"}]}}'

Use the field names that match your business language. The strongest customer profiles are simple, consistent, and updated from the system where the data is generated.