usend Docs
API endpoints

Segments

Create, list, retrieve and delete segments.

A segment groups contacts for broadcasts. Segments and audiences are the same resource: a segment ID works as an audience_id and the other way around.

Create a segment

POST /segments

NameTypeRequiredDescription
namestringYesThe segment name.
cURL
curl -X POST https://api.usend.et/segments \
  -H "Authorization: Bearer us_123456789" \
  -H "Content-Type: application/json" \
  -d '{ "name": "Newsletter" }'
Response
{ "object": "segment", "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf", "name": "Newsletter" }

Retrieve a segment

GET /segments/{id}

cURL
curl https://api.usend.et/segments/78261eea-8f8b-4381-83c6-79fa7120f1cf \
  -H "Authorization: Bearer us_123456789"
Response
{
  "object": "segment",
  "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
  "name": "Newsletter",
  "created_at": "2026-10-11T08:00:00.000Z",
  "contact_count": 1240
}

List segments

GET /segments

cURL
curl https://api.usend.et/segments \
  -H "Authorization: Bearer us_123456789"
Response
{
  "object": "list",
  "data": [
    {
      "object": "segment",
      "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf",
      "name": "Newsletter",
      "created_at": "2026-10-11T08:00:00.000Z",
      "contact_count": 1240
    }
  ],
  "has_more": false
}

Delete a segment

DELETE /segments/{id}

Deletes the segment and its memberships. A segment that a broadcast uses cannot be deleted: the request fails with 422 validation_error.

cURL
curl -X DELETE https://api.usend.et/segments/78261eea-8f8b-4381-83c6-79fa7120f1cf \
  -H "Authorization: Bearer us_123456789"
Response
{ "object": "segment", "id": "78261eea-8f8b-4381-83c6-79fa7120f1cf", "deleted": true }