Get a segment
GEThttps://us.app.unleash-hosted.com/ushosted/api/admin/segments/:id
Retrieves a segment based on its ID.
Request
Path Parameters
id stringrequired
Responses
- 200
- 404
adminSegmentSchema
- application/json
- Schema
- Example (from schema)
Schema
id integerrequired
The ID of this segment
Example:
2
name stringrequired
The name of this segment
Example:
ios-users
description stringnullable
The description for this segment
Example:
IOS users segment
constraints
object[]
required
usedInFeatures integernullable
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.
Example:
3
usedInProjects integernullable
The number of projects that use this segment. The number includes any projects with pending change requests that would add this segment.
Example:
2
project stringnullable
The project the segment belongs to. Only present if the segment is a project-specific segment.
Example:
red-vista
createdBy stringnullable
The creator's email or username
Example:
someone@example.com
createdAt date-timerequired
When the segment was created
Example:
2023-04-12T11:13:31.960Z
{
"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
Example:
9c40958a-daac-400e-98fb-3bb438567008
name string
The name of the error kind
Example:
NotFoundError
message string
A description of what went wrong.
Example:
Could not find the addon with ID "12345".
{
"id": "9c40958a-daac-400e-98fb-3bb438567008",
"name": "NotFoundError",
"message": "Could not find the addon with ID \"12345\"."
}
Authorization: Authorization
name: Authorizationtype: apiKeyin: headerdescription: API key needed to access this API
- curl
- python
- go
- nodejs
- ruby
- csharp
- php
- java
- powershell
- CURL
curl -L 'https://us.app.unleash-hosted.com/ushosted/api/admin/segments/:id' \
-H 'Accept: application/json' \
-H 'Authorization: <API_KEY_VALUE>'
ResponseClear