Segments
Get segment
Get a single segment by key.<br/><br/>Segments can be rule-based, list-based, or synced. Big segments include larger list-based segments and synced segments. Some fields in the response only apply to big segments.
get/api/v2/segments/{projectKey}/{environmentKey}/{segmentKey}
Path parameters
projectKeystring string required
The project key
The project key
environmentKeystring string required
The environment key
The environment key
segmentKeystring string required
The segment key
The segment key
Response
Segment response
Example response
{
"name": "Example segment",
"description": "Bundle our sample customers together",
"tags": [
"testing"
],
"key": "segment-key-123abc",
"included": [
"user-key-123abc"
],
"excluded": [
"user-key-123abc"
],
"rules": [
{
"_id": "1234a56b7c89d012345e678f",
"clauses": [
{
"_id": "12ab3c45de678910fab12345",
"attribute": "email",
"negate": false,
"op": "endsWith",
"values": [
".edu"
]
}
]
}
],
"version": 1,
"_access": {
"denied": [
{
"reason": {
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
],
"effect": "allow"
}
}
],
"allowed": [
{
"reason": {
"resources": [
"proj/*:env/*;qa_*:/flag/*"
],
"actions": [
"*"
],
"effect": "allow"
}
}
]
},
"_flags": [
{
"name": "Example flag",
"key": "flag-key-123abc"
}
],
"_external": "amplitude",
"_externalLink": "https://analytics.amplitude.com/org/1234/cohort/123abc"
}