Segments
Use Segments to organize your contacts into targeted groups. A contact can be in only one segment at a time. Use Tags if you need to apply multiple tags to a contact.
List segments
GET /v1/organization/contacts/segmentscurl https://api.bahasha.app/v1/organization/contacts/segments \
-H "Authorization: Bearer bh_live_xxxxxxxxxxxx"Response
{
"data": [
{
"id": "67f12bb3882d745f33f3d300",
"name": "Returning Customers",
"description": "Customers with repeat purchases",
"contact_count": 128,
"created_at": "2026-04-18T09:10:22.000Z",
"updated_at": "2026-04-24T10:11:02.000Z"
}
]
}Create a segment
POST /v1/organization/contacts/segmentscurl -X POST https://api.bahasha.app/v1/organization/contacts/segments \
-H "Authorization: Bearer bh_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"name": "Returning Customers",
"description": "Customers with repeat purchases"
}'Move contacts to a segment
PATCH /v1/organization/contacts/segments/contactscurl -X PATCH https://api.bahasha.app/v1/organization/contacts/segments/contacts \
-H "Authorization: Bearer bh_live_xxxxxxxxxxxx" \
-H "Content-Type: application/json" \
-d '{
"contact_ids": [
"68011f5f8f7f109de8f62f5e",
"68011f5f8f7f109de8f62f5f"
],
"segment_id": "67f12bb3882d745f33f3d300"
}'Send "segment_id": null to remove contacts from any segment.
Delete a segment
DELETE /v1/organization/contacts/segments/:idcurl -X DELETE https://api.bahasha.app/v1/organization/contacts/segments/67f12bb3882d745f33f3d300 \
-H "Authorization: Bearer bh_live_xxxxxxxxxxxx"Deleting a segment removes the segment and contacts currently inside it. Use with caution.