Managing Contacts via API
Push and update contacts programmatically, including custom fields for merge-tag personalization.
Why use this instead of CSV import
If your own system already tracks your contacts (e.g. an order system, a guest list, a booking platform), push data directly via this API instead of exporting to CSV each time. This keeps Sakura in sync automatically as your own records change.
POST /api/v1/contacts
Create a new contact.
Request Parameters
firstName(string) — First namelastName(string) — Last namemobile(string, required) — Phone number, international format without +customFields(object) — Any additional per-contact data, as key/value pairs
Example
POST /api/v1/contacts
Authorization: Bearer sk_live_...
Content-Type: application/json
{
"firstName": "Peter",
"lastName": "Mbelwa",
"mobile": "255767279937",
"customFields": { "entry_code": "PL-047", "card_type": "Family" }
}
PATCH /api/v1/contacts/{id}
Update an existing contact's name or custom fields. customFields are merged onto whatever the contact already has — a partial update (e.g. just updating one field) will not remove the others.
Example
PATCH /api/v1/contacts/clx1234abcd
Authorization: Bearer sk_live_...
{ "customFields": { "rsvp_status": "confirmed" } }
Using custom fields in messages
Any custom field becomes a {{tag}} merge-tag in your campaign message, alongside the built-in {{name}}/{{phone}}/{{company}}/{{date}}/{{balance}} tags. A field named entry_code is used as {{entry_code}} in your message text — matching what you sent in the API call.
contacts:read (for GET) and contacts:write (for POST/PATCH/DELETE) — these are granted automatically when you generate a key from Developer > API Keys in the portal.
Related in Developer API
API Authentication
How to authenticate your API requests with Bearer tokens.
Sending SMS via API
Complete guide to sending SMS programmatically using the REST API.
Webhooks & Callbacks
Receive real-time delivery notifications and event callbacks.
SDKs & Libraries
Quick-start code examples in Node.js, Python, PHP, and Java.