Segments

Retrieves a segment based on its ID.

get/api/admin/segments/{id}

Request

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

Path parameters

idinteger required

a segment id

Response

adminSegmentSchema

idinteger required

The ID of this segment

namestring required

The name of this segment

descriptionstring nullable

The description for this segment

usedInFeaturesinteger nullable

The number of feature flags that use this segment. The number also includes the any flags with pending change requests that would add this segment.

usedInProjectsinteger nullable

The number of projects that use this segment. The number includes any projects with pending change requests that would add this segment.

projectstring nullable

The project the segment belongs to. Only present if the segment is a project-specific segment.

createdBystring nullable

The creator's email or username

createdAtstring date-time required

When the segment was created

Example response

{
  "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