Segments

Get strategy segments

Changed on

Retrieve all segments that are referenced by the specified strategy. Returns an empty list of segments if the strategy ID doesn't exist.

get/api/admin/segments/strategies/{strategyId}

Request

  • Base URL
    https://app.unleash-instance.example.com
  • URL
    https://app.unleash-instance.example.com/api/admin/segments/strategies/{strategyId}
  • Auth
    • API key in header Authorization
    • or HTTP bearer

Path parameters

strategyIdstring required

Response

segmentsSchema

Example response

{
  "segments": [
    {
      "id": 2,
      "name": "ios-users",
      "description": "IOS users segment",
      "constraints": [
        {
          "contextName": "appName",
          "operator": "IN",
          "values": [
            "my-app",
            "my-other-app"
          ],
          "value": "my-app"
        }
      ],
      "usedInFeatures": 3,
      "usedInProjects": 2,
      "project": "red-vista",
      "createdBy": "someone@example.com",
      "createdAt": "2023-04-12T11:13:31.960Z"
    }
  ]
}

Changes

    • warning

      added the new SEMVER_GTE enum value to the //// response property for the response status

    • warning

      added the new SEMVER_LTE enum value to the //// response property for the response status

    • warning

      added the new REGEX enum value to the //// response property for the response status