Get a segment
GET <your-unleash-url>/api/admin/segments/:id
Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
Retrieves a segment based on its ID.
Request
Path Parameters
- id string required
Responses
- 200
- 404
adminSegmentSchema
- application/json
- Schema
- Example (from schema)
Schema
- id integer required
The ID of this segment
- name string required
The name of this segment
- description string nullable
The description for this segment
constraints object[]required
- usedInFeatures integer 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.
- usedInProjects integer nullable
The number of projects that use this segment. The number includes any projects with pending change requests that would add this segment.
- project string nullable
The project the segment belongs to. Only present if the segment is a project-specific segment.
- createdBy string nullable
The creator's email or username
- createdAt date-time required
When 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 string
The ID of the error instance
- name string
The name of the error kind
- message string
A description of what went wrong.
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "NotFoundError",
"message": "Could not find the addon with ID \"12345\"."
}
Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
Request
Request
curl / cURL
curl -L -X GET '<your-unleash-url>/api/admin/segments/:id' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
python / requests
curl -L -X GET '<your-unleash-url>/api/admin/segments/:id' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
go / native
curl -L -X GET '<your-unleash-url>/api/admin/segments/:id' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
nodejs / axios
curl -L -X GET '<your-unleash-url>/api/admin/segments/:id' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
ruby / Net::HTTP
curl -L -X GET '<your-unleash-url>/api/admin/segments/:id' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
csharp / RestSharp
curl -L -X GET '<your-unleash-url>/api/admin/segments/:id' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
php / cURL
curl -L -X GET '<your-unleash-url>/api/admin/segments/:id' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
java / OkHttp
curl -L -X GET '<your-unleash-url>/api/admin/segments/:id' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
powershell / RestMethod
curl -L -X GET '<your-unleash-url>/api/admin/segments/:id' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'