User Segments

Creates a user segment in the resolved project.

Requires at least Member. Re-fetches via ListUserSegmentsQuery (there is no single-segment query) and locates the new segment by the id returned from CreateUserSegmentCommand so the response reflects exactly what was persisted (e.g. server-assigned condition ids, folded into the public shape via FromDto).

post/api/v1/orgs/{org}/projects/{project}/segments

Request

  • Base URL: https://api.featureflip.io
  • URL: https://api.featureflip.io/api/v1/orgs/{org}/projects/{project}/segments
  • Auth: API key in header Authorization

Path parameters

orgstring required
projectstring required

Request body

keystring nullable required
namestring nullable required
descriptionstring nullable

Example request

{
  "key": "beta-testers",
  "name": "Beta Testers",
  "description": "Users enrolled in the beta program.",
  "conditions": [
    {
      "attribute": "email",
      "operator": "EndsWith",
      "values": [
        "@acme.com"
      ],
      "negate": false
    }
  ]
}

Response

Created

idstring uuid required
keystring nullable required
namestring nullable required
descriptionstring nullable
createdAtstring date-time required
updatedAtstring date-time required
_actionsobject

Capability hints: which operations the authenticated caller may perform on this resource, each with allowed + optional reason. Computed from the caller's role and the resource's state. Injected at runtime; safe to ignore. Present only on top-level resource responses — nested occurrences (e.g. a rule inside a targeting-config response) do not carry it.

Example response

{
  "id": "0197b6a1-3c4d-7e5f-8a6b-7c8d9e0f1a2b",
  "key": "beta-testers",
  "name": "Beta Testers",
  "description": "Users enrolled in the beta program.",
  "conditions": [
    {
      "attribute": "email",
      "operator": "EndsWith",
      "values": [
        "@acme.com"
      ],
      "negate": false
    }
  ],
  "createdAt": "2026-06-01T12:00:00Z",
  "updatedAt": "2026-06-15T08:30:00Z"
}

Changes

No recorded changes to this operation across all 1 revision of this API.