← Back to API Reference

POST /segments

Create Segment

Compatibility endpoint to create segment data.

Request (cURL)

curl -X POST "http://localhost:8080/v1/segments" \
  -H "Authorization: Bearer <API_KEY>" \
  -H "Content-Type: application/json" \
  -d '{
  "name": "vip-customers",
  "audience_id": "aud_123",
  "external_key": "woo_buy_again",
  "type": "static",
  "conditions": {
    "totalOrders": {
      "gte": 3
    }
  }
}'

Response Example

{
  "id": "id_123"
}

Request Body Example

{
  "name": "vip-customers",
  "audience_id": "aud_123",
  "external_key": "woo_buy_again",
  "type": "static",
  "conditions": {
    "totalOrders": {
      "gte": 3
    }
  }
}