Sign up and get started with Confidence today! Create your account
Sign up and get started with Confidence today! Create your account
Create a new segment. A segment defines a part of the population of an
entity, for example, the population of users. It contains an overall
proportion of the population as well as optional targeting criteria, like
the country a user is from. A segment can also be coordinated with other
segments, by setting exclusivity_tags and exclusive_to, preventing one
user to be included in two segments, that are exclusive to each other,
simultaneously.
Note, the segment is not active until it is allocated.
curl --request POST \
--url https://flags.eu.confidence.dev/v1/segments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"displayName": "<string>",
"description": "<string>",
"targeting": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"allocation": {
"proportion": {
"value": "<string>"
},
"exclusivityTags": [
"<string>"
],
"exclusiveTo": [
"<string>"
]
},
"labels": [
{}
],
"workflowInstance": "<string>",
"flag": "<string>",
"owner": "<string>"
}
'{
"createTime": {},
"updateTime": {},
"creator": "<string>",
"updater": "<string>",
"name": "<string>",
"displayName": "<string>",
"description": "<string>",
"targeting": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"allocation": {
"proportion": {
"value": "<string>"
},
"exclusivityTags": [
"<string>"
],
"exclusiveTo": [
"<string>"
]
},
"state": "STATE_UNSPECIFIED",
"bitsetAllocation": {
"bitset": {}
},
"labels": [
{}
],
"workflowInstance": "<string>",
"flag": "<string>",
"owner": "<string>"
}Documentation Index
Fetch the complete documentation index at: https://confidence.spotify.com/llms.txt
Use this file to discover all available pages before exploring further.
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
The ID to use for the segment, which will become the final component of the segment's resource name.
This value should be 4-63 characters, and valid characters are /[a-z][0-9]-/.
The resource name of the segment.
For example:
segments/0smva5nxuhv4yts6paxt
A human-friendly name for the segment.
A description for the segment.
How much of the total population that is allocated to this segment, and the coordination with other segments.
Show child attributes
General labels for this resource.
Show child attributes
The workflow instance that created this segment. If set, permissions will be inherited from the workflow instance, in addition to the segment permissions.
The flag owning the rule this segment is connected to. If set, permissions will be inherited from the flag, in addition to the segment permissions.
The owner of the resource. If not set will default to the creator.
Returns a Segment.
A reusable slice of an entity population.
Time when the segment was first created.
Time when the segment was last updated.
Reference to the identity that created this segment.
Reference to the identity that last updated this segment.
The resource name of the segment.
For example:
segments/0smva5nxuhv4yts6paxt
A human-friendly name for the segment.
A description for the segment.
How much of the total population that is allocated to this segment, and the coordination with other segments.
Show child attributes
Current state of the segment.
STATE_UNSPECIFIED, OK, UNALLOCATED, ALLOCATED, ARCHIVED A bitset representing the buckets that are allocated for this segment.
Show child attributes
General labels for this resource.
Show child attributes
The workflow instance that created this segment. If set, permissions will be inherited from the workflow instance, in addition to the segment permissions.
The flag owning the rule this segment is connected to. If set, permissions will be inherited from the flag, in addition to the segment permissions.
The owner of the resource. If not set will default to the creator.
Was this page helpful?
curl --request POST \
--url https://flags.eu.confidence.dev/v1/segments \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"displayName": "<string>",
"description": "<string>",
"targeting": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"allocation": {
"proportion": {
"value": "<string>"
},
"exclusivityTags": [
"<string>"
],
"exclusiveTo": [
"<string>"
]
},
"labels": [
{}
],
"workflowInstance": "<string>",
"flag": "<string>",
"owner": "<string>"
}
'{
"createTime": {},
"updateTime": {},
"creator": "<string>",
"updater": "<string>",
"name": "<string>",
"displayName": "<string>",
"description": "<string>",
"targeting": {
"criteria": [
{}
],
"expression": {
"ref": "<string>",
"not": {},
"and": {
"operands": [
{}
]
},
"or": {
"operands": [
{}
]
}
}
},
"allocation": {
"proportion": {
"value": "<string>"
},
"exclusivityTags": [
"<string>"
],
"exclusiveTo": [
"<string>"
]
},
"state": "STATE_UNSPECIFIED",
"bitsetAllocation": {
"bitset": {}
},
"labels": [
{}
],
"workflowInstance": "<string>",
"flag": "<string>",
"owner": "<string>"
}