Skip to Content
ContactsCreate and Update Contacts

Create and Update Contacts

Create a contact

POST /v1/organization/contacts

Request body

FieldTypeRequiredDescription
numberstring✓Contact phone number
first_namestring—First name
middle_namestring—Middle name
last_namestring—Last name
full_namestring—Full name
emailstring—Email
tagsstring[]—Contact tags
segment_idsstring[]—Segments to add (max 20)
attributesobject—Custom attributes key/value map
curl -X POST https://api.bahasha.app/v1/organization/contacts \ -H "Authorization: Bearer bh_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "full_name": "Jane Doe", "number": "+254700000000", "email": "[email protected]", "tags": ["vip", "newsletter"], "segment_ids": ["67f12bb3882d745f33f3d300"], "attributes": { "city": "Nairobi", "customer_tier": "Gold" } }'

Update a contact

PATCH /v1/organization/contacts/:id

Send only the fields you want to update.

curl -X PATCH https://api.bahasha.app/v1/organization/contacts/68011f5f8f7f109de8f62f5e \ -H "Authorization: Bearer bh_live_xxxxxxxxxxxx" \ -H "Content-Type: application/json" \ -d '{ "merge_attributes": true, "tags": ["vip", "new_segment"], "attributes": { "city": "Mombasa", "customer_tier": "Platinum" } }'

Set "merge_attributes": true to merge supplied custom attributes without erasing unrelated attributes already on the contact. Send "segment_ids": [] to remove the contact from every segment.