Skip to main content
POST
/
segments
cURL
curl --request POST \
  --url https://www.greenflash.ai/api/v1/segments \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "High-Intent Enterprise Users",
  "description": "Users with high commercial intent from the enterprise plan",
  "icon": "Users",
  "filters": {
    "rules": [
      {
        "type": "analysis",
        "field": "commercialIntent",
        "operator": "gte",
        "value": 0.6
      },
      {
        "type": "property",
        "key": "plan",
        "operator": "eq",
        "value": "enterprise"
      }
    ]
  }
}
'
{
  "id": "423e4567-e89b-12d3-a456-426614174003",
  "name": "High-Intent Enterprise Users",
  "type": "custom",
  "description": "Users with high commercial intent from the enterprise plan",
  "icon": "Users",
  "filters": {
    "rules": [
      {
        "type": "analysis",
        "field": "commercialIntent",
        "operator": "gte",
        "value": 0.6
      },
      {
        "type": "property",
        "key": "plan",
        "operator": "eq",
        "value": "enterprise"
      }
    ]
  },
  "createdAt": "2026-03-25T14:30:00.000Z",
  "updatedAt": "2026-03-25T14:30:00.000Z"
}

Authorizations

Authorization
string
header
required

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

Body

application/json
filters
object
required

Filter configuration defining segment membership.

name
string

Segment name. If omitted, an auto-generated name will be assigned.

Maximum string length: 255
description
string

A description of the segment purpose.

icon
string

Icon identifier for the segment (e.g. "Users", "Tag").

Maximum string length: 50

Response

Segment created successfully

id
string<uuid>
required

The created segment ID.

name
string
required

The segment name.

type
enum<string>
required

Always "custom" for API-created segments.

Available options:
custom
description
string | null
required

Segment description.

icon
string | null
required

Icon identifier.

filters
object
required

The filter configuration.

createdAt
string<date-time>
required

When the segment was created.

updatedAt
string<date-time>
required

When the segment was last updated.