Skip to documentation

API · Segments

Create Segment

Create a segment to organize contacts (requires full access). Your team can have up to 500 segments.

POST/segmentsFull access

Request parameters

ParameterTypeDescription
Idempotency-Key
header · optional
string
1–256 characters
Makes the request safe to retry. See Idempotency.
name
body · required
stringTrimmed nonempty segment name, at most 200 characters.

Request example

Set OPENSEND_BASE_URL=https://api.example.com and OPENSEND_API_KEY=os_replace_me on your server.

bash
curl -X POST "$OPENSEND_BASE_URL/segments" \
  -H "Authorization: Bearer $OPENSEND_API_KEY" \
  -H 'Content-Type: application/json' \
  -d '{"name":"Customers"}'

Response

201 · application/json. Example IDs stand for IDs returned by your installation.

json
{
  "object": "segment",
  "id": "YOUR_ID"
}

Behavior and errors

Deleting a segment preserves contacts and cleans memberships in batches.

Use a full-access credential. Resource IDs belong to your team; an unknown or foreign resource returns 404. See authentication, errors, rate limits, and compatibility for the shared contract.