ESTAGE Support
IdeasMy tickets

Save a segment

Permission segments:writeRate limit writesIdempotent with Idempotency-Key

conditions: 1 to 50 rules, all of which a contact must meet: [{ rule: { field, condition: "c" (has any of) | "k" (has none of), value: [] } }]. Ids inside rules (tags, lists, products, affiliate programs, field_id, template_id, automation_id, broadcast_id) must belong to this project, or the request is a 422 naming them. The name is unique in the project.

POSThttps://api.estage.com/v1/segments

Authorization

ESTAGE-API-Keystringheaderrequired

A project key, est_live_…, from Settings → API keys. Call from server code only.

Body

application/json
namestringrequired≤ 255 chars
conditionsarray of objectrequired≤ 50 items
Show 1 field
ruleobjectrequired

field, condition, value, field_id, template_id, automation_id, broadcast_id

Headers

Idempotency-Keystring≤ 255 chars

Any unique string per attempt. A retry with the same key gets the first answer back instead of doing the work twice.

RequestcURL
curl --request POST \
  --url 'https://api.estage.com/v1/segments' \
  --header 'ESTAGE-API-Key: est_live_your-api-key' \
  --header 'Content-Type: application/json' \
  --header 'Idempotency-Key: your-unique-key' \
  --data '{
    "name": "Customers still mailable",
    "conditions": [
      {
        "rule": {
          "field": "tag",
          "condition": "c",
          "value": [
            12
          ]
        }
      },
      {
        "rule": {
          "field": "suppressed",
          "condition": "k",
          "value": [
            "email"
          ]
        }
      }
    ]
  }'
Created
{
  "data": {
    "id": 5,
    "name": "Customers still mailable",
    "conditions": [
      {
        "rule": {
          "field": "tag",
          "condition": "c",
          "value": [
            12
          ]
        }
      },
      {
        "rule": {
          "field": "suppressed",
          "condition": "k",
          "value": [
            "email"
          ]
        }
      }
    ],
    "created_at": "2026-11-13T10:30:00Z",
    "updated_at": "2026-11-13T10:30:00Z"
  }
}
Example. Errors are { error: { code, message, details } }.