curl --request POST \
--url http://localhost:8080/api/v2/environments/production/namespaces/default/resources \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"key": "<key>",
"payload": {
"@type": "flipt.core.Segment",
"key": "<key>",
"name": "<name>"
}
}'
{
"resource": {
"namespaceKey": "default",
"key": "<key>",
"payload": {
"@type": "flipt.core.Segment",
"key": "<key>",
"name": "<name>"
}
},
"revision": "<revision>"
}
Segments
Create Segment
Create a new segment in a namespace.
POST
/
api
/
v2
/
environments
/
{environmentKey}
/
namespaces
/
{namespaceKey}
/
resources
curl --request POST \
--url http://localhost:8080/api/v2/environments/production/namespaces/default/resources \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"key": "<key>",
"payload": {
"@type": "flipt.core.Segment",
"key": "<key>",
"name": "<name>"
}
}'
{
"resource": {
"namespaceKey": "default",
"key": "<key>",
"payload": {
"@type": "flipt.core.Segment",
"key": "<key>",
"name": "<name>"
}
},
"revision": "<revision>"
}
curl --request POST \
--url http://localhost:8080/api/v2/environments/production/namespaces/default/resources \
--header 'Content-Type: application/json' \
--header 'Accept: application/json' \
--data '{
"key": "<key>",
"payload": {
"@type": "flipt.core.Segment",
"key": "<key>",
"name": "<name>"
}
}'
{
"resource": {
"namespaceKey": "default",
"key": "<key>",
"payload": {
"@type": "flipt.core.Segment",
"key": "<key>",
"name": "<name>"
}
},
"revision": "<revision>"
}
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The environment identifier, e.g. 'production'.
The namespace key for which to list resources, e.g. 'default'.
Body
application/json
The request message for creating or updating a resource.
The environment identifier, e.g. 'production'.
The namespace key for which to list resources, e.g. 'default'.
The resource key.
The arbitrary typed resource payload (e.g. flipt.core.Flag, flipt.core.Segment). {"@type": "flipt.core.Flag", "key": "my_flag"}
- Option 1
- Option 2
Show child attributes
Show child attributes
The resource revision for optimistic concurrency.
Was this page helpful?