Get a segment
GET /api/admin/segments/:id
Retrieves a segment based on its ID.
Request
Path Parameters
- id string required
- 200
- 404
adminSegmentSchema
- application/json
- Schema
- Example (from schema)
Schema
- id integer requiredThe ID of this segment 
- name string requiredThe name of this segment 
- description string nullableThe description for this segment 
- constraints object[]required- The list of constraints that are used in this segment Array [contextName string required- The name of the context field that this constraint should apply to. operator string required- Possible values: [ - NOT_IN,- IN,- STR_ENDS_WITH,- STR_STARTS_WITH,- STR_CONTAINS,- NUM_EQ,- NUM_GT,- NUM_GTE,- NUM_LT,- NUM_LTE,- DATE_AFTER,- DATE_BEFORE,- SEMVER_EQ,- SEMVER_GT,- SEMVER_LT]- The operator to use when evaluating this constraint. For more information about the various operators, refer to the strategy constraint operator documentation. caseInsensitive boolean- Default value: - false- Whether the operator should be case sensitive or not. Defaults to - false(being case sensitive).inverted boolean- Default value: - false- Whether the result should be negated or not. If - true, will turn a- trueresult into a- falseresult and vice versa.values string[]- The context values that should be used for constraint evaluation. Use this property instead of - valuefor properties that accept multiple values.value string- The context value that should be used for constraint evaluation. Use this property instead of - valuesfor properties that only accept single values.]
- usedInFeatures integer nullableThe number of feature flags that use this segment. The number also includes the any flags with pending change requests that would add this segment. 
- usedInProjects integer nullableThe number of projects that use this segment. The number includes any projects with pending change requests that would add this segment. 
- project string nullableThe project the segment belongs to. Only present if the segment is a project-specific segment. 
- createdBy string nullableThe creator's email or username 
- createdAt date-time requiredWhen the segment was created 
{
  "id": 2,
  "name": "ios-users",
  "description": "IOS users segment",
  "constraints": [
    {
      "contextName": "appName",
      "operator": "IN",
      "caseInsensitive": false,
      "inverted": false,
      "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"
}
The requested resource was not found.
- application/json
- Schema
- Example (from schema)
Schema
- id stringThe ID of the error instance 
- name stringThe name of the error kind 
- message stringA description of what went wrong. 
{
  "id": "9c40958a-daac-400e-98fb-3bb438567008",
  "name": "NotFoundError",
  "message": "Could not find the addon with ID \"12345\"."
}