Skip to main content
POST
/
segments
Create segment
curl --request POST \
  --url https://api-message.nativehub.live/api/v1/segments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Premium Customers",
  "conditions": {
    "tags": {
      "segment": "premium"
    },
    "region": [
      "dhaka",
      "chittagong"
    ]
  }
}
'
{
  "id": "e7f8a9b0-c1d2-3456-ef78-901234567890",
  "tenant_id": "c3d4e5f6-a7b8-9012-cdef-123456789012",
  "name": "Premium Customers",
  "conditions": {
    "tags": {
      "segment": "premium"
    },
    "region": [
      "dhaka",
      "chittagong"
    ]
  },
  "contact_count": 1250,
  "created_at": "2026-02-05T10:00:00Z"
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Body

application/json
name
string
required
conditions
object
required

Response

Segment created successfully

id
string<uuid>
tenant_id
string<uuid>
name
string
conditions
object
contact_count
integer
created_at
string<date-time>