diff --git a/docs/docs.json b/docs/docs.json index d3b5b559..77b60571 100644 --- a/docs/docs.json +++ b/docs/docs.json @@ -187,8 +187,79 @@ "pages": [ "v2/reference/overview" ] + }, + { + "group": "Authentication", + "pages": [ + "v2/reference/authentication/list-tokens", + "v2/reference/authentication/get-token", + "v2/reference/authentication/get-self", + "v2/reference/authentication/revoke-self" + ] + }, + { + "group": "Environments", + "pages": [ + "v2/reference/environments/list-environments" + ] + }, + { + "group": "Branches", + "pages": [ + "v2/reference/branches/list-branches", + "v2/reference/branches/create-branch", + "v2/reference/branches/list-changes", + "v2/reference/branches/propose-branch", + "v2/reference/branches/delete-branch" + ] + }, + { + "group": "Namespaces", + "pages": [ + "v2/reference/namespaces/list-namespaces", + "v2/reference/namespaces/create-namespace", + "v2/reference/namespaces/get-namespace", + "v2/reference/namespaces/update-namespace", + "v2/reference/namespaces/delete-namespace" + ] + }, + { + "group": "Flags", + "pages": [ + "v2/reference/flags/list-flags", + "v2/reference/flags/create-flag", + "v2/reference/flags/get-flag", + "v2/reference/flags/update-flag", + "v2/reference/flags/delete-flag" + ] + }, + { + "group": "Segments", + "pages": [ + "v2/reference/segments/list-segments", + "v2/reference/segments/create-segment", + "v2/reference/segments/get-segment", + "v2/reference/segments/update-segment", + "v2/reference/segments/delete-segment" + ] + }, + { + "group": "Evaluation", + "pages": [ + "v2/reference/evaluation/snapshot", + "v2/reference/evaluation/stream", + "v2/reference/evaluation/boolean-evaluation", + "v2/reference/evaluation/variant-evaluation", + "v2/reference/evaluation/batch-evaluation" + ] + }, + { + "group": "OpenFeature Evaluation [OFREP]", + "pages": [ + "v2/reference/openfeature/flag-evaluation", + "v2/reference/openfeature/bulk-evaluation" + ] } - ] }, { @@ -539,12 +610,17 @@ "dismissible": true }, "api": { - "openapi": "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml", + "openapi": [ + "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml", + "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/flipt/openapi.yaml", + "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml", + "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/evaluation/openapi.yaml" + ], "playground": { "display": "simple" }, "mdx": { - "server": "https://try.flipt.io", + "server": "http://localhost:8080", "auth": { "method": "bearer" } diff --git a/docs/v1/reference/authentication/create-token.mdx b/docs/v1/reference/authentication/create-token.mdx index d47331d0..ecef685b 100644 --- a/docs/v1/reference/authentication/create-token.mdx +++ b/docs/v1/reference/authentication/create-token.mdx @@ -1,13 +1,13 @@ --- title: "Create Token" -openapi: POST /auth/v1/method/token +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /auth/v1/method/token" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/auth/v1/method/token \ + --url http://localhost:8080/auth/v1/method/token \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'Authorization: Bearer ' \ diff --git a/docs/v1/reference/authentication/delete-token.mdx b/docs/v1/reference/authentication/delete-token.mdx index 6be9b462..7e1ac18a 100644 --- a/docs/v1/reference/authentication/delete-token.mdx +++ b/docs/v1/reference/authentication/delete-token.mdx @@ -1,13 +1,13 @@ --- title: "Delete Token" -openapi: DELETE /auth/v1/tokens/{id} +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml DELETE /auth/v1/tokens/{id}" --- ```bash cURL curl --request DELETE \ - --url https://try.flipt.io/auth/v1/tokens/{id} \ + --url http://localhost:8080/auth/v1/tokens/{id} \ --header 'Authorization: Bearer {token}' ``` diff --git a/docs/v1/reference/authentication/expire-self.mdx b/docs/v1/reference/authentication/expire-self.mdx index c1ce5404..190960b9 100644 --- a/docs/v1/reference/authentication/expire-self.mdx +++ b/docs/v1/reference/authentication/expire-self.mdx @@ -1,13 +1,13 @@ --- title: "Expire Self" -openapi: PUT /auth/v1/self/expire +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml PUT /auth/v1/self/expire" --- ```bash cURL curl --request PUT \ - --url https://try.flipt.io/auth/v1/self/expire \ + --url http://localhost:8080/auth/v1/self/expire \ --header 'Authorization: Bearer ' ``` diff --git a/docs/v1/reference/authentication/get-self.mdx b/docs/v1/reference/authentication/get-self.mdx index 3d5a7f5d..7284098c 100644 --- a/docs/v1/reference/authentication/get-self.mdx +++ b/docs/v1/reference/authentication/get-self.mdx @@ -1,13 +1,13 @@ --- title: "Get Self" -openapi: GET /auth/v1/self +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /auth/v1/self" --- ```bash cURL curl --request GET \ - --url https://try.flipt.io/auth/v1/self \ + --url http://localhost:8080/auth/v1/self \ --header 'Accept: application/json' \ --header 'Authorization: Bearer ' ``` diff --git a/docs/v1/reference/authentication/get-token.mdx b/docs/v1/reference/authentication/get-token.mdx index 16c8d4b8..1ffc1da7 100644 --- a/docs/v1/reference/authentication/get-token.mdx +++ b/docs/v1/reference/authentication/get-token.mdx @@ -1,12 +1,12 @@ --- title: "Get Token" -openapi: GET /auth/v1/tokens/{id} +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /auth/v1/tokens/{id}" --- ```bash cURL -curl --url https://try.flipt.io/auth/v1/tokens/{id} \ +curl --url http://localhost:8080/auth/v1/tokens/{id} \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {token}' ``` diff --git a/docs/v1/reference/authentication/list-tokens.mdx b/docs/v1/reference/authentication/list-tokens.mdx index ff3d5881..ca453f53 100644 --- a/docs/v1/reference/authentication/list-tokens.mdx +++ b/docs/v1/reference/authentication/list-tokens.mdx @@ -1,12 +1,12 @@ --- title: "List Tokens" -openapi: GET /auth/v1/tokens +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /auth/v1/tokens" --- ```bash cURL -curl --url https://try.flipt.io/auth/v1/tokens \ +curl --url http://localhost:8080/auth/v1/tokens \ --header 'Accept: application/json' \ --header 'Authorization: Bearer {token}' ``` diff --git a/docs/v1/reference/constraints/create-constraint.mdx b/docs/v1/reference/constraints/create-constraint.mdx index 17a833a7..491e0ca8 100644 --- a/docs/v1/reference/constraints/create-constraint.mdx +++ b/docs/v1/reference/constraints/create-constraint.mdx @@ -1,13 +1,13 @@ --- title: "Create Constraint" -openapi: "POST /api/v1/namespaces/{namespaceKey}/segments/{segmentKey}/constraints" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /api/v1/namespaces/{namespaceKey}/segments/{segmentKey}/constraints" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/api/v1/namespaces/default/segments/{segmentKey}/constraints \ + --url http://localhost:8080/api/v1/namespaces/default/segments/{segmentKey}/constraints \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/constraints/delete-constraint.mdx b/docs/v1/reference/constraints/delete-constraint.mdx index 13062e40..1deb5cc4 100644 --- a/docs/v1/reference/constraints/delete-constraint.mdx +++ b/docs/v1/reference/constraints/delete-constraint.mdx @@ -1,13 +1,13 @@ --- title: "Delete Constraint" -openapi: "DELETE /api/v1/namespaces/{namespaceKey}/segments/{segmentKey}/constraints/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml DELETE /api/v1/namespaces/{namespaceKey}/segments/{segmentKey}/constraints/{id}" --- ```bash cURL curl --request DELETE \ - --url https://try.flipt.io/api/v1/namespaces/default/segments/{segmentKey}/constraints/{id} + --url http://localhost:8080/api/v1/namespaces/default/segments/{segmentKey}/constraints/{id} ``` diff --git a/docs/v1/reference/constraints/update-constraint.mdx b/docs/v1/reference/constraints/update-constraint.mdx index d10d52ce..55c2bcbe 100644 --- a/docs/v1/reference/constraints/update-constraint.mdx +++ b/docs/v1/reference/constraints/update-constraint.mdx @@ -1,13 +1,13 @@ --- title: "Update Constraint" -openapi: "PUT /api/v1/namespaces/{namespaceKey}/segments/{segmentKey}/constraints/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml PUT /api/v1/namespaces/{namespaceKey}/segments/{segmentKey}/constraints/{id}" --- ```bash cURL curl --request PUT \ - --url https://try.flipt.io/api/v1/namespaces/default/segments/{segmentKey}/constraints/{id} \ + --url http://localhost:8080/api/v1/namespaces/default/segments/{segmentKey}/constraints/{id} \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/distributions/create-distribution.mdx b/docs/v1/reference/distributions/create-distribution.mdx index 0433da77..0150aa6f 100644 --- a/docs/v1/reference/distributions/create-distribution.mdx +++ b/docs/v1/reference/distributions/create-distribution.mdx @@ -1,13 +1,13 @@ --- title: "Create Distribution" -openapi: "POST /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{ruleId}/distributions" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{ruleId}/distributions" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rules/{ruleId}/distributions \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rules/{ruleId}/distributions \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/distributions/delete-distribution.mdx b/docs/v1/reference/distributions/delete-distribution.mdx index 09a6d4da..acf73441 100644 --- a/docs/v1/reference/distributions/delete-distribution.mdx +++ b/docs/v1/reference/distributions/delete-distribution.mdx @@ -1,13 +1,13 @@ --- title: "Delete Distribution" -openapi: "DELETE /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{ruleId}/distributions/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml DELETE /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{ruleId}/distributions/{id}" --- ```bash cURL curl --request DELETE \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rules/{ruleId}/distributions/{id} + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rules/{ruleId}/distributions/{id} ``` diff --git a/docs/v1/reference/distributions/update-distribution.mdx b/docs/v1/reference/distributions/update-distribution.mdx index ab20ee32..a9a6a375 100644 --- a/docs/v1/reference/distributions/update-distribution.mdx +++ b/docs/v1/reference/distributions/update-distribution.mdx @@ -1,13 +1,13 @@ --- title: "Update Distribution" -openapi: "PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{ruleId}/distributions/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{ruleId}/distributions/{id}" --- ```bash cURL curl --request PUT \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rules/{ruleId}/distributions/{id} \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rules/{ruleId}/distributions/{id} \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/evaluation/batch-evaluation.mdx b/docs/v1/reference/evaluation/batch-evaluation.mdx index cc9b9378..0ecdf269 100644 --- a/docs/v1/reference/evaluation/batch-evaluation.mdx +++ b/docs/v1/reference/evaluation/batch-evaluation.mdx @@ -1,13 +1,13 @@ --- title: "Batch Evaluation" -openapi: "POST /evaluate/v1/batch" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /evaluate/v1/batch" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/evaluate/v1/batch \ + --url http://localhost:8080/evaluate/v1/batch \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/evaluation/boolean-evaluation.mdx b/docs/v1/reference/evaluation/boolean-evaluation.mdx index 6e57f216..4f591e6f 100644 --- a/docs/v1/reference/evaluation/boolean-evaluation.mdx +++ b/docs/v1/reference/evaluation/boolean-evaluation.mdx @@ -1,13 +1,13 @@ --- title: "Boolean Evaluation" -openapi: "POST /evaluate/v1/boolean" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /evaluate/v1/boolean" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/evaluate/v1/boolean \ + --url http://localhost:8080/evaluate/v1/boolean \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/evaluation/variant-evaluation.mdx b/docs/v1/reference/evaluation/variant-evaluation.mdx index c658645f..0c2ba868 100644 --- a/docs/v1/reference/evaluation/variant-evaluation.mdx +++ b/docs/v1/reference/evaluation/variant-evaluation.mdx @@ -1,13 +1,13 @@ --- title: "Variant Evaluation" -openapi: "POST /evaluate/v1/variant" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /evaluate/v1/variant" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/evaluate/v1/variant \ + --url http://localhost:8080/evaluate/v1/variant \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/flags/create-flag.mdx b/docs/v1/reference/flags/create-flag.mdx index 34c9980a..32479f04 100644 --- a/docs/v1/reference/flags/create-flag.mdx +++ b/docs/v1/reference/flags/create-flag.mdx @@ -1,13 +1,13 @@ --- title: "Create Flag" -openapi: "POST /api/v1/namespaces/{namespaceKey}/flags" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /api/v1/namespaces/{namespaceKey}/flags" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/api/v1/namespaces/default/flags \ + --url http://localhost:8080/api/v1/namespaces/default/flags \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/flags/delete-flag.mdx b/docs/v1/reference/flags/delete-flag.mdx index cfec68a1..86822cd2 100644 --- a/docs/v1/reference/flags/delete-flag.mdx +++ b/docs/v1/reference/flags/delete-flag.mdx @@ -1,13 +1,13 @@ --- title: "Delete Flag" -openapi: "DELETE /api/v1/namespaces/{namespaceKey}/flags/{key}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml DELETE /api/v1/namespaces/{namespaceKey}/flags/{key}" --- ```bash cURL curl --request DELETE \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{key} + --url http://localhost:8080/api/v1/namespaces/default/flags/{key} ``` diff --git a/docs/v1/reference/flags/get-flag.mdx b/docs/v1/reference/flags/get-flag.mdx index bdb4a667..d882797a 100644 --- a/docs/v1/reference/flags/get-flag.mdx +++ b/docs/v1/reference/flags/get-flag.mdx @@ -1,12 +1,12 @@ --- title: "Get Flag" -openapi: "GET /api/v1/namespaces/{namespaceKey}/flags/{key}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /api/v1/namespaces/{namespaceKey}/flags/{key}" --- ```bash cURL -curl --url https://try.flipt.io/api/v1/namespaces/default/flags/{key} \ +curl --url http://localhost:8080/api/v1/namespaces/default/flags/{key} \ --header 'Accept: application/json' ``` diff --git a/docs/v1/reference/flags/list-flags.mdx b/docs/v1/reference/flags/list-flags.mdx index 0c819ecd..161e9625 100644 --- a/docs/v1/reference/flags/list-flags.mdx +++ b/docs/v1/reference/flags/list-flags.mdx @@ -1,12 +1,12 @@ --- title: "List Flags" -openapi: "GET /api/v1/namespaces/{namespaceKey}/flags" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /api/v1/namespaces/{namespaceKey}/flags" --- ```bash cURL -curl --url https://try.flipt.io/api/v1/namespaces/default/flags \ +curl --url http://localhost:8080/api/v1/namespaces/default/flags \ --header 'Accept: application/json' ``` diff --git a/docs/v1/reference/flags/update-flag.mdx b/docs/v1/reference/flags/update-flag.mdx index 92d13cde..78b8a4dc 100644 --- a/docs/v1/reference/flags/update-flag.mdx +++ b/docs/v1/reference/flags/update-flag.mdx @@ -1,13 +1,13 @@ --- title: "Update Flag" -openapi: "PUT /api/v1/namespaces/{namespaceKey}/flags/{key}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml PUT /api/v1/namespaces/{namespaceKey}/flags/{key}" --- ```bash cURL curl --request PUT \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{key} \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{key} \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/namespaces/create-namespace.mdx b/docs/v1/reference/namespaces/create-namespace.mdx index c768c5b8..a4175d00 100644 --- a/docs/v1/reference/namespaces/create-namespace.mdx +++ b/docs/v1/reference/namespaces/create-namespace.mdx @@ -1,13 +1,13 @@ --- title: "Create Namespace" -openapi: "POST /api/v1/namespaces" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /api/v1/namespaces" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/api/v1/namespaces \ + --url http://localhost:8080/api/v1/namespaces \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/namespaces/delete-namespace.mdx b/docs/v1/reference/namespaces/delete-namespace.mdx index 74cd891f..ab72d5cc 100644 --- a/docs/v1/reference/namespaces/delete-namespace.mdx +++ b/docs/v1/reference/namespaces/delete-namespace.mdx @@ -1,13 +1,13 @@ --- title: "Delete Namespace" -openapi: "DELETE /api/v1/namespaces/{key}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml DELETE /api/v1/namespaces/{key}" --- ```bash cURL curl --request DELETE \ - --url https://try.flipt.io/api/v1/namespaces/{key} + --url http://localhost:8080/api/v1/namespaces/{key} ``` diff --git a/docs/v1/reference/namespaces/get-namespace.mdx b/docs/v1/reference/namespaces/get-namespace.mdx index 86a83526..de422ac5 100644 --- a/docs/v1/reference/namespaces/get-namespace.mdx +++ b/docs/v1/reference/namespaces/get-namespace.mdx @@ -1,12 +1,12 @@ --- title: "Get Namespace" -openapi: "GET /api/v1/namespaces/{key}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /api/v1/namespaces/{key}" --- ```bash cURL -curl --url https://try.flipt.io/api/v1/namespaces/{key} \ +curl --url http://localhost:8080/api/v1/namespaces/{key} \ --header 'Accept: application/json' ``` diff --git a/docs/v1/reference/namespaces/list-namespaces.mdx b/docs/v1/reference/namespaces/list-namespaces.mdx index 50b4a9a7..75a8b1ad 100644 --- a/docs/v1/reference/namespaces/list-namespaces.mdx +++ b/docs/v1/reference/namespaces/list-namespaces.mdx @@ -1,12 +1,12 @@ --- title: "List Namespaces" -openapi: "GET /api/v1/namespaces" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /api/v1/namespaces" --- ```bash cURL -curl --url https://try.flipt.io/api/v1/namespaces \ +curl --url http://localhost:8080/api/v1/namespaces \ --header 'Accept: application/json' ``` diff --git a/docs/v1/reference/namespaces/update-namespace.mdx b/docs/v1/reference/namespaces/update-namespace.mdx index b375ede1..b1586362 100644 --- a/docs/v1/reference/namespaces/update-namespace.mdx +++ b/docs/v1/reference/namespaces/update-namespace.mdx @@ -1,13 +1,13 @@ --- title: "Update Namespace" -openapi: "PUT /api/v1/namespaces/{key}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml PUT /api/v1/namespaces/{key}" --- ```bash cURL curl --request PUT \ - --url https://try.flipt.io/api/v1/namespaces/{key} \ + --url http://localhost:8080/api/v1/namespaces/{key} \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/openfeature/bulk-evaluation.mdx b/docs/v1/reference/openfeature/bulk-evaluation.mdx index 6ba59eb2..f7506ddb 100644 --- a/docs/v1/reference/openfeature/bulk-evaluation.mdx +++ b/docs/v1/reference/openfeature/bulk-evaluation.mdx @@ -1,13 +1,13 @@ --- title: "Bulk Evaluation" -openapi: "POST /ofrep/v1/evaluate/flags" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /ofrep/v1/evaluate/flags" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/ofrep/v1/evaluate/flags \ + --url http://localhost:8080/ofrep/v1/evaluate/flags \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'X-Flipt-Namespace: ' \ diff --git a/docs/v1/reference/openfeature/configuration.mdx b/docs/v1/reference/openfeature/configuration.mdx index fd7ec7ab..a881aa8a 100644 --- a/docs/v1/reference/openfeature/configuration.mdx +++ b/docs/v1/reference/openfeature/configuration.mdx @@ -1,12 +1,12 @@ --- title: "Configuration" -openapi: "GET /ofrep/v1/configuration" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /ofrep/v1/configuration" --- ```bash cURL -curl --url https://try.flipt.io/ofrep/v1/configuration \ +curl --url http://localhost:8080/ofrep/v1/configuration \ --header 'Accept: application/json' ``` diff --git a/docs/v1/reference/openfeature/flag-evaluation.mdx b/docs/v1/reference/openfeature/flag-evaluation.mdx index 703ec8d3..33f5f5e7 100644 --- a/docs/v1/reference/openfeature/flag-evaluation.mdx +++ b/docs/v1/reference/openfeature/flag-evaluation.mdx @@ -1,13 +1,13 @@ --- title: "Flag Evaluation" -openapi: "POST /ofrep/v1/evaluate/flags/{key}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /ofrep/v1/evaluate/flags/{key}" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/ofrep/v1/evaluate/flags/ \ + --url http://localhost:8080/ofrep/v1/evaluate/flags/ \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --header 'X-Flipt-Namespace: ' \ diff --git a/docs/v1/reference/rollouts/create-rollout.mdx b/docs/v1/reference/rollouts/create-rollout.mdx index 4e1d7777..d01d72cb 100644 --- a/docs/v1/reference/rollouts/create-rollout.mdx +++ b/docs/v1/reference/rollouts/create-rollout.mdx @@ -1,13 +1,13 @@ --- title: "Create Rollout" -openapi: "POST /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rollouts \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rollouts \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/rollouts/delete-rollout.mdx b/docs/v1/reference/rollouts/delete-rollout.mdx index 804a1c86..aab075a0 100644 --- a/docs/v1/reference/rollouts/delete-rollout.mdx +++ b/docs/v1/reference/rollouts/delete-rollout.mdx @@ -1,13 +1,13 @@ --- title: "Delete Rollout" -openapi: "DELETE /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml DELETE /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts/{id}" --- ```bash cURL curl --request DELETE \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rollouts/{id} + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rollouts/{id} ``` diff --git a/docs/v1/reference/rollouts/get-rollout.mdx b/docs/v1/reference/rollouts/get-rollout.mdx index acad0fc6..a941b8a6 100644 --- a/docs/v1/reference/rollouts/get-rollout.mdx +++ b/docs/v1/reference/rollouts/get-rollout.mdx @@ -1,12 +1,12 @@ --- title: "Get Rollout" -openapi: "GET /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts/{id}" --- ```bash cURL -curl --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rollouts/{id} \ +curl --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rollouts/{id} \ --header 'Accept: application/json' ``` diff --git a/docs/v1/reference/rollouts/list-rollouts.mdx b/docs/v1/reference/rollouts/list-rollouts.mdx index cfc39fa7..0a1d93b5 100644 --- a/docs/v1/reference/rollouts/list-rollouts.mdx +++ b/docs/v1/reference/rollouts/list-rollouts.mdx @@ -1,13 +1,13 @@ --- title: "List Rollout" -openapi: "GET /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts" --- ```bash cURL curl --request GET \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rollouts \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rollouts \ --header 'Accept: application/json' ``` diff --git a/docs/v1/reference/rollouts/order-rollouts.mdx b/docs/v1/reference/rollouts/order-rollouts.mdx index 2d611e75..b483207c 100644 --- a/docs/v1/reference/rollouts/order-rollouts.mdx +++ b/docs/v1/reference/rollouts/order-rollouts.mdx @@ -1,13 +1,13 @@ --- title: "Order Rollouts" -openapi: "PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts/order" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts/order" --- ```bash cURL curl --request PUT \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{key}/rollouts/order \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{key}/rollouts/order \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/rollouts/update-rollout.mdx b/docs/v1/reference/rollouts/update-rollout.mdx index 29cd21a0..825ecf51 100644 --- a/docs/v1/reference/rollouts/update-rollout.mdx +++ b/docs/v1/reference/rollouts/update-rollout.mdx @@ -1,13 +1,13 @@ --- title: "Update Rollout" -openapi: "PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rollouts/{id}" --- ```bash cURL curl --request PUT \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rollouts \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rollouts \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/rules/create-rule.mdx b/docs/v1/reference/rules/create-rule.mdx index 8740b790..ad67e0bc 100644 --- a/docs/v1/reference/rules/create-rule.mdx +++ b/docs/v1/reference/rules/create-rule.mdx @@ -1,13 +1,13 @@ --- title: "Create Rule" -openapi: "POST /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rules \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rules \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/rules/delete-rule.mdx b/docs/v1/reference/rules/delete-rule.mdx index 3bfcf9f5..ea8b0e48 100644 --- a/docs/v1/reference/rules/delete-rule.mdx +++ b/docs/v1/reference/rules/delete-rule.mdx @@ -1,13 +1,13 @@ --- title: "Delete Rule" -openapi: "DELETE /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml DELETE /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{id}" --- ```bash cURL curl --request DELETE \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rules/{id} + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rules/{id} ``` diff --git a/docs/v1/reference/rules/get-rule.mdx b/docs/v1/reference/rules/get-rule.mdx index faed1317..3689b3e4 100644 --- a/docs/v1/reference/rules/get-rule.mdx +++ b/docs/v1/reference/rules/get-rule.mdx @@ -1,12 +1,12 @@ --- title: "Get Rule" -openapi: "GET /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{id}" --- ```bash cURL -curl --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rules/{id} \ +curl --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rules/{id} \ --header 'Accept: application/json' ``` diff --git a/docs/v1/reference/rules/list-rules.mdx b/docs/v1/reference/rules/list-rules.mdx index 4113958c..dc5d960c 100644 --- a/docs/v1/reference/rules/list-rules.mdx +++ b/docs/v1/reference/rules/list-rules.mdx @@ -1,13 +1,13 @@ --- title: "List Rules" -openapi: "GET /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules" --- ```bash cURL curl --request GET \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rules \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rules \ --header 'Accept: application/json' ``` diff --git a/docs/v1/reference/rules/order-rules.mdx b/docs/v1/reference/rules/order-rules.mdx index 25b3fa3c..9359d8dd 100644 --- a/docs/v1/reference/rules/order-rules.mdx +++ b/docs/v1/reference/rules/order-rules.mdx @@ -1,13 +1,13 @@ --- title: "Order Rules" -openapi: "PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/order" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/order" --- ```bash cURL curl --request PUT \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{key}/rules/order \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{key}/rules/order \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/rules/update-rule.mdx b/docs/v1/reference/rules/update-rule.mdx index cfeafdf3..efd03c71 100644 --- a/docs/v1/reference/rules/update-rule.mdx +++ b/docs/v1/reference/rules/update-rule.mdx @@ -1,13 +1,13 @@ --- title: "Update Rule" -openapi: "PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/rules/{id}" --- ```bash cURL curl --request PUT \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/rules/{id} \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/rules/{id} \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/segments/create-segment.mdx b/docs/v1/reference/segments/create-segment.mdx index 2da224ab..5f3be951 100644 --- a/docs/v1/reference/segments/create-segment.mdx +++ b/docs/v1/reference/segments/create-segment.mdx @@ -1,13 +1,13 @@ --- title: "Create Segment" -openapi: "POST /api/v1/namespaces/{namespaceKey}/segments" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /api/v1/namespaces/{namespaceKey}/segments" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/api/v1/namespaces/default/segments \ + --url http://localhost:8080/api/v1/namespaces/default/segments \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/segments/delete-segment.mdx b/docs/v1/reference/segments/delete-segment.mdx index 7100ced0..5aa743e2 100644 --- a/docs/v1/reference/segments/delete-segment.mdx +++ b/docs/v1/reference/segments/delete-segment.mdx @@ -1,13 +1,13 @@ --- title: "Delete Segment" -openapi: "DELETE /api/v1/namespaces/{namespaceKey}/segments/{key}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml DELETE /api/v1/namespaces/{namespaceKey}/segments/{key}" --- ```bash cURL curl --request DELETE \ - --url https://try.flipt.io/api/v1/namespaces/default/segments/{key} + --url http://localhost:8080/api/v1/namespaces/default/segments/{key} ``` diff --git a/docs/v1/reference/segments/get-segment.mdx b/docs/v1/reference/segments/get-segment.mdx index de740e68..f6e08475 100644 --- a/docs/v1/reference/segments/get-segment.mdx +++ b/docs/v1/reference/segments/get-segment.mdx @@ -1,12 +1,12 @@ --- title: "Get Segment" -openapi: "GET /api/v1/namespaces/{namespaceKey}/segments/{key}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /api/v1/namespaces/{namespaceKey}/segments/{key}" --- ```bash cURL -curl --url https://try.flipt.io/api/v1/namespaces/default/segments/{key} \ +curl --url http://localhost:8080/api/v1/namespaces/default/segments/{key} \ --header 'Accept: application/json' ``` diff --git a/docs/v1/reference/segments/list-segment.mdx b/docs/v1/reference/segments/list-segment.mdx index a1cb1948..962fcce0 100644 --- a/docs/v1/reference/segments/list-segment.mdx +++ b/docs/v1/reference/segments/list-segment.mdx @@ -1,12 +1,12 @@ --- title: "List Segments" -openapi: "GET /api/v1/namespaces/{namespaceKey}/segments" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml GET /api/v1/namespaces/{namespaceKey}/segments" --- ```bash cURL -curl --url https://try.flipt.io/api/v1/namespaces/default/segments \ +curl --url http://localhost:8080/api/v1/namespaces/default/segments \ --header 'Accept: application/json' ``` diff --git a/docs/v1/reference/segments/update-segment.mdx b/docs/v1/reference/segments/update-segment.mdx index e2eb4aeb..cb8466b9 100644 --- a/docs/v1/reference/segments/update-segment.mdx +++ b/docs/v1/reference/segments/update-segment.mdx @@ -1,13 +1,13 @@ --- title: "Update Segment" -openapi: "PUT /api/v1/namespaces/{namespaceKey}/segments/{key}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml PUT /api/v1/namespaces/{namespaceKey}/segments/{key}" --- ```bash cURL curl --request PUT \ - --url https://try.flipt.io/api/v1/namespaces/default/segments/{key} \ + --url http://localhost:8080/api/v1/namespaces/default/segments/{key} \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/variants/create-variant.mdx b/docs/v1/reference/variants/create-variant.mdx index 12e1b736..9be93f5c 100644 --- a/docs/v1/reference/variants/create-variant.mdx +++ b/docs/v1/reference/variants/create-variant.mdx @@ -1,13 +1,13 @@ --- title: "Create Variant" -openapi: "POST /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml POST /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants" --- ```bash cURL curl --request POST \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/variants \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/variants \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v1/reference/variants/delete-variant.mdx b/docs/v1/reference/variants/delete-variant.mdx index 26c5430c..15e8d486 100644 --- a/docs/v1/reference/variants/delete-variant.mdx +++ b/docs/v1/reference/variants/delete-variant.mdx @@ -1,13 +1,13 @@ --- title: "Delete Variant" -openapi: "DELETE /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml DELETE /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants/{id}" --- ```bash cURL curl --request DELETE \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/variants/{id} + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/variants/{id} ``` diff --git a/docs/v1/reference/variants/update-variant.mdx b/docs/v1/reference/variants/update-variant.mdx index c02993d0..72d4dfcc 100644 --- a/docs/v1/reference/variants/update-variant.mdx +++ b/docs/v1/reference/variants/update-variant.mdx @@ -1,13 +1,13 @@ --- title: "Update Variant" -openapi: "PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants/{id}" +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/main/openapi.yaml PUT /api/v1/namespaces/{namespaceKey}/flags/{flagKey}/variants/{id}" --- ```bash cURL curl --request PUT \ - --url https://try.flipt.io/api/v1/namespaces/default/flags/{flagKey}/variants/{id} \ + --url http://localhost:8080/api/v1/namespaces/default/flags/{flagKey}/variants/{id} \ --header 'Content-Type: application/json' \ --header 'Accept: application/json' \ --data '{ diff --git a/docs/v2/reference/authentication/get-self.mdx b/docs/v2/reference/authentication/get-self.mdx new file mode 100644 index 00000000..dec222a8 --- /dev/null +++ b/docs/v2/reference/authentication/get-self.mdx @@ -0,0 +1,16 @@ +--- +title: "Get Self" +description: "Get the current authentication context." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/flipt/openapi.yaml GET /auth/v1/self" +--- + + + +```bash cURL +curl --request GET \ + --url http://localhost:8080/auth/v1/self \ + --header 'Accept: application/json' \ + --header 'Authorization: Bearer ' +``` + + diff --git a/docs/v2/reference/authentication/get-token.mdx b/docs/v2/reference/authentication/get-token.mdx new file mode 100644 index 00000000..72fbf934 --- /dev/null +++ b/docs/v2/reference/authentication/get-token.mdx @@ -0,0 +1,15 @@ +--- +title: "Get Token" +description: "Get an authentication token by ID." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/flipt/openapi.yaml GET /auth/v1/tokens/{id}" +--- + + + +```bash cURL +curl --url http://localhost:8080/auth/v1/tokens/{id} \ + --header 'Accept: application/json' \ + --header 'Authorization: Bearer {token}' +``` + + diff --git a/docs/v2/reference/authentication/list-tokens.mdx b/docs/v2/reference/authentication/list-tokens.mdx new file mode 100644 index 00000000..d6870b5b --- /dev/null +++ b/docs/v2/reference/authentication/list-tokens.mdx @@ -0,0 +1,15 @@ +--- +title: "List Tokens" +description: "List all authentication tokens." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/flipt/openapi.yaml GET /auth/v1/tokens" +--- + + + +```bash cURL +curl --url http://localhost:8080/auth/v1/tokens \ + --header 'Accept: application/json' \ + --header 'Authorization: Bearer {token}' +``` + + diff --git a/docs/v2/reference/authentication/revoke-self.mdx b/docs/v2/reference/authentication/revoke-self.mdx new file mode 100644 index 00000000..c78758d6 --- /dev/null +++ b/docs/v2/reference/authentication/revoke-self.mdx @@ -0,0 +1,31 @@ +--- +title: "Revoke Self" +description: "Revoke the authentication token used for the current request." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/flipt/openapi.yaml DELETE /auth/v1/self/revoke" +--- + + + +```bash cURL +curl --request DELETE \ + --url http://localhost:8080/auth/v1/self/revoke \ + --header 'Authorization: Bearer ' +``` + + + + + +```json Common (200) +{ + "nextUri": "" +} +``` + +```json OIDC (200) +{ + "nextUri": "https://idp.example.com/logout?..." +} +``` + + diff --git a/docs/v2/reference/branches/create-branch.mdx b/docs/v2/reference/branches/create-branch.mdx new file mode 100644 index 00000000..f6e833c3 --- /dev/null +++ b/docs/v2/reference/branches/create-branch.mdx @@ -0,0 +1,19 @@ +--- +title: "Create Branch" +description: "Create a new branch in an environment." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml POST /api/v2/environments/{environmentKey}/branches" +--- + + + +```bash cURL +curl --request POST \ + --url http://localhost:8080/api/v2/environments/{environmentKey}/branches \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --data '{ + "key": "" +}' +``` + + diff --git a/docs/v2/reference/branches/delete-branch.mdx b/docs/v2/reference/branches/delete-branch.mdx new file mode 100644 index 00000000..55d51016 --- /dev/null +++ b/docs/v2/reference/branches/delete-branch.mdx @@ -0,0 +1,14 @@ +--- +title: "Delete Branch" +description: "Delete a branch by key." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml DELETE /api/v2/environments/{environmentKey}/branches/{key}" +--- + + + +```bash cURL +curl --request DELETE \ + --url http://localhost:8080/api/v2/environments/{environmentKey}/branches/{key} +``` + + diff --git a/docs/v2/reference/branches/list-branches.mdx b/docs/v2/reference/branches/list-branches.mdx new file mode 100644 index 00000000..d9f09f07 --- /dev/null +++ b/docs/v2/reference/branches/list-branches.mdx @@ -0,0 +1,14 @@ +--- +title: "List Branches" +description: "List all branches in an environment." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml GET /api/v2/environments/{environmentKey}/branches" +--- + + + +```bash cURL +curl --url http://localhost:8080/api/v2/environments/{environmentKey}/branches \ + --header 'Accept: application/json' +``` + + diff --git a/docs/v2/reference/branches/list-changes.mdx b/docs/v2/reference/branches/list-changes.mdx new file mode 100644 index 00000000..d40367f6 --- /dev/null +++ b/docs/v2/reference/branches/list-changes.mdx @@ -0,0 +1,14 @@ +--- +title: "List Changes" +description: "List changes on a branch." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml GET /api/v2/environments/{environmentKey}/branches/{key}/changes" +--- + + + +```bash cURL +curl --url http://localhost:8080/api/v2/environments/{environmentKey}/branches/{key}/changes \ + --header 'Accept: application/json' +``` + + diff --git a/docs/v2/reference/branches/propose-branch.mdx b/docs/v2/reference/branches/propose-branch.mdx new file mode 100644 index 00000000..c29112d6 --- /dev/null +++ b/docs/v2/reference/branches/propose-branch.mdx @@ -0,0 +1,21 @@ +--- +title: "Propose Branch" +description: "Propose branch changes for review." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml POST /api/v2/environments/{environmentKey}/branches/{key}" +--- + + + +```bash cURL +curl --request POST \ + --url http://localhost:8080/api/v2/environments/{environmentKey}/branches/{key} \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --data '{ + "title": "", + "body": "<body>", + "draft": false +}' +``` + +</RequestExample> diff --git a/docs/v2/reference/environments/list-environments.mdx b/docs/v2/reference/environments/list-environments.mdx new file mode 100644 index 00000000..58aa4f3c --- /dev/null +++ b/docs/v2/reference/environments/list-environments.mdx @@ -0,0 +1,14 @@ +--- +title: "List Environments" +description: "List all environments." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml GET /api/v2/environments" +--- + +<RequestExample> + +```bash cURL +curl --url http://localhost:8080/api/v2/environments \ + --header 'Accept: application/json' +``` + +</RequestExample> diff --git a/docs/v2/reference/evaluation/batch-evaluation.mdx b/docs/v2/reference/evaluation/batch-evaluation.mdx new file mode 100644 index 00000000..8aa1714e --- /dev/null +++ b/docs/v2/reference/evaluation/batch-evaluation.mdx @@ -0,0 +1,26 @@ +--- +title: "Batch Evaluation" +description: "Evaluate multiple flags for an entity in a single request." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/flipt/openapi.yaml POST /evaluate/v1/batch" +--- + +<RequestExample> + +```bash cURL +curl --request POST \ + --url http://localhost:8080/evaluate/v1/batch \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --data '{ + "requests": [ + { + "context": {}, + "entityId": "<entityid>", + "flagKey": "<flagkey>", + "namespaceKey": "<namespacekey>" + } + ] +}' +``` + +</RequestExample> diff --git a/docs/v2/reference/evaluation/boolean-evaluation.mdx b/docs/v2/reference/evaluation/boolean-evaluation.mdx new file mode 100644 index 00000000..86fc6487 --- /dev/null +++ b/docs/v2/reference/evaluation/boolean-evaluation.mdx @@ -0,0 +1,22 @@ +--- +title: "Boolean Evaluation" +description: "Evaluate a boolean flag for an entity." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/flipt/openapi.yaml POST /evaluate/v1/boolean" +--- + +<RequestExample> + +```bash cURL +curl --request POST \ + --url http://localhost:8080/evaluate/v1/boolean \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --data '{ + "context": {}, + "entityId": "<entityid>", + "flagKey": "<flagkey>", + "namespaceKey": "<namespacekey>" +}' +``` + +</RequestExample> diff --git a/docs/v2/reference/evaluation/snapshot.mdx b/docs/v2/reference/evaluation/snapshot.mdx new file mode 100644 index 00000000..a2e3b7ab --- /dev/null +++ b/docs/v2/reference/evaluation/snapshot.mdx @@ -0,0 +1,14 @@ +--- +title: "Namespace Snapshot" +description: "Get a snapshot of all flag evaluation state for a namespace." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/evaluation/openapi.yaml GET /client/v2/environments/{environmentKey}/namespaces/{key}/snapshot" +--- + +<RequestExample> + +```bash cURL +curl --url http://localhost:8080/client/v2/environments/production/namespaces/default/snapshot \ + --header 'Accept: application/json' +``` + +</RequestExample> diff --git a/docs/v2/reference/evaluation/stream.mdx b/docs/v2/reference/evaluation/stream.mdx new file mode 100644 index 00000000..65b33293 --- /dev/null +++ b/docs/v2/reference/evaluation/stream.mdx @@ -0,0 +1,14 @@ +--- +title: "Namespace Stream" +description: "Stream snapshots of flag evaluation state for a namespace." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/evaluation/openapi.yaml GET /client/v2/environments/{environmentKey}/namespaces/{key}/stream" +--- + +<RequestExample> + +```bash cURL +curl --url http://localhost:8080/client/v2/environments/production/namespaces/default/stream \ + --header 'Accept: application/json' +``` + +</RequestExample> diff --git a/docs/v2/reference/evaluation/variant-evaluation.mdx b/docs/v2/reference/evaluation/variant-evaluation.mdx new file mode 100644 index 00000000..ca7b24d4 --- /dev/null +++ b/docs/v2/reference/evaluation/variant-evaluation.mdx @@ -0,0 +1,22 @@ +--- +title: "Variant Evaluation" +description: "Evaluate a variant flag for an entity." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/flipt/openapi.yaml POST /evaluate/v1/variant" +--- + +<RequestExample> + +```bash cURL +curl --request POST \ + --url http://localhost:8080/evaluate/v1/variant \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --data '{ + "context": {}, + "entityId": "<entityid>", + "flagKey": "<flagkey>", + "namespaceKey": "<namespacekey>" +}' +``` + +</RequestExample> diff --git a/docs/v2/reference/flags/create-flag.mdx b/docs/v2/reference/flags/create-flag.mdx new file mode 100644 index 00000000..fc1ba63e --- /dev/null +++ b/docs/v2/reference/flags/create-flag.mdx @@ -0,0 +1,25 @@ +--- +title: "Create Flag" +description: "Create a new flag in a namespace." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml POST /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources" +--- + +<RequestExample> + +```bash cURL +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.Flag", + "key": "<key>", + "name": "<name>", + "enabled": true + } +}' +``` + +</RequestExample> diff --git a/docs/v2/reference/flags/delete-flag.mdx b/docs/v2/reference/flags/delete-flag.mdx new file mode 100644 index 00000000..d92beaf0 --- /dev/null +++ b/docs/v2/reference/flags/delete-flag.mdx @@ -0,0 +1,15 @@ +--- +title: "Delete Flag" +description: "Delete a flag by key." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml DELETE /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources/{typeUrl}/{key}" +--- + +<RequestExample> + +```bash cURL +curl --request DELETE \ + --url http://localhost:8080/api/v2/environments/production/namespaces/default/resources/flipt.core.Flag/my-flag \ + --header 'Accept: application/json' +``` + +</RequestExample> diff --git a/docs/v2/reference/flags/get-flag.mdx b/docs/v2/reference/flags/get-flag.mdx new file mode 100644 index 00000000..3ddb1ec9 --- /dev/null +++ b/docs/v2/reference/flags/get-flag.mdx @@ -0,0 +1,14 @@ +--- +title: "Get Flag" +description: "Get a flag by key." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml GET /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources/{typeUrl}/{key}" +--- + +<RequestExample> + +```bash cURL +curl --url http://localhost:8080/api/v2/environments/production/namespaces/default/resources/flipt.core.Flag/my-flag \ + --header 'Accept: application/json' +``` + +</RequestExample> diff --git a/docs/v2/reference/flags/list-flags.mdx b/docs/v2/reference/flags/list-flags.mdx new file mode 100644 index 00000000..0703dfec --- /dev/null +++ b/docs/v2/reference/flags/list-flags.mdx @@ -0,0 +1,14 @@ +--- +title: "List Flags" +description: "List all flags in a namespace." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml GET /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources/{typeUrl}" +--- + +<RequestExample> + +```bash cURL +curl --url http://localhost:8080/api/v2/environments/production/namespaces/default/resources/flipt.core.Flag \ + --header 'Accept: application/json' +``` + +</RequestExample> diff --git a/docs/v2/reference/flags/update-flag.mdx b/docs/v2/reference/flags/update-flag.mdx new file mode 100644 index 00000000..acd33edb --- /dev/null +++ b/docs/v2/reference/flags/update-flag.mdx @@ -0,0 +1,25 @@ +--- +title: "Update Flag" +description: "Update an existing flag in a namespace." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml PUT /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources" +--- + +<RequestExample> + +```bash cURL +curl --request PUT \ + --url http://localhost:8080/api/v2/environments/production/namespaces/default/resources \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --data '{ + "key": "my-flag", + "payload": { + "@type": "flipt.core.Flag", + "key": "my-flag", + "name": "<name>", + "enabled": true + } +}' +``` + +</RequestExample> diff --git a/docs/v2/reference/namespaces/create-namespace.mdx b/docs/v2/reference/namespaces/create-namespace.mdx new file mode 100644 index 00000000..3b2ba965 --- /dev/null +++ b/docs/v2/reference/namespaces/create-namespace.mdx @@ -0,0 +1,20 @@ +--- +title: "Create Namespace" +description: "Create a new namespace in an environment." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml POST /api/v2/environments/{environmentKey}/namespaces" +--- + +<RequestExample> + +```bash cURL +curl --request POST \ + --url http://localhost:8080/api/v2/environments/{environmentKey}/namespaces \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --data '{ + "key": "<key>", + "name": "<name>" +}' +``` + +</RequestExample> diff --git a/docs/v2/reference/namespaces/delete-namespace.mdx b/docs/v2/reference/namespaces/delete-namespace.mdx new file mode 100644 index 00000000..090c78ed --- /dev/null +++ b/docs/v2/reference/namespaces/delete-namespace.mdx @@ -0,0 +1,14 @@ +--- +title: "Delete Namespace" +description: "Delete a namespace by key." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml DELETE /api/v2/environments/{environmentKey}/namespaces/{key}" +--- + +<RequestExample> + +```bash cURL +curl --request DELETE \ + --url http://localhost:8080/api/v2/environments/{environmentKey}/namespaces/{key} +``` + +</RequestExample> diff --git a/docs/v2/reference/namespaces/get-namespace.mdx b/docs/v2/reference/namespaces/get-namespace.mdx new file mode 100644 index 00000000..d34b90c5 --- /dev/null +++ b/docs/v2/reference/namespaces/get-namespace.mdx @@ -0,0 +1,14 @@ +--- +title: "Get Namespace" +description: "Get a namespace by key." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml GET /api/v2/environments/{environmentKey}/namespaces/{key}" +--- + +<RequestExample> + +```bash cURL +curl --url http://localhost:8080/api/v2/environments/{environmentKey}/namespaces/{key} \ + --header 'Accept: application/json' +``` + +</RequestExample> diff --git a/docs/v2/reference/namespaces/list-namespaces.mdx b/docs/v2/reference/namespaces/list-namespaces.mdx new file mode 100644 index 00000000..8c1f9615 --- /dev/null +++ b/docs/v2/reference/namespaces/list-namespaces.mdx @@ -0,0 +1,14 @@ +--- +title: "List Namespaces" +description: "List all namespaces in an environment." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml GET /api/v2/environments/{environmentKey}/namespaces" +--- + +<RequestExample> + +```bash cURL +curl --url http://localhost:8080/api/v2/environments/{environmentKey}/namespaces \ + --header 'Accept: application/json' +``` + +</RequestExample> diff --git a/docs/v2/reference/namespaces/update-namespace.mdx b/docs/v2/reference/namespaces/update-namespace.mdx new file mode 100644 index 00000000..b9566f76 --- /dev/null +++ b/docs/v2/reference/namespaces/update-namespace.mdx @@ -0,0 +1,20 @@ +--- +title: "Update Namespace" +description: "Update an existing namespace in an environment." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml PUT /api/v2/environments/{environmentKey}/namespaces" +--- + +<RequestExample> + +```bash cURL +curl --request PUT \ + --url http://localhost:8080/api/v2/environments/{environmentKey}/namespaces \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --data '{ + "key": "<key>", + "name": "<name>" +}' +``` + +</RequestExample> diff --git a/docs/v2/reference/openfeature/bulk-evaluation.mdx b/docs/v2/reference/openfeature/bulk-evaluation.mdx new file mode 100644 index 00000000..4bd989cb --- /dev/null +++ b/docs/v2/reference/openfeature/bulk-evaluation.mdx @@ -0,0 +1,23 @@ +--- +title: "Bulk Evaluation" +description: "Evaluate multiple flags via OFREP bulk operation." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/flipt/openapi.yaml POST /ofrep/v1/evaluate/flags" +--- + +<RequestExample> + +```bash cURL +curl --request POST \ + --url http://localhost:8080/ofrep/v1/evaluate/flags \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --header 'X-Flipt-Namespace: <namespaceKey>' \ + --data '{ + "context": { + "flags": ["flagKey1", "flagKey2", "flagKey3"], + "targetingKey": "targetingKey1" + } +}' +``` + +</RequestExample> diff --git a/docs/v2/reference/openfeature/flag-evaluation.mdx b/docs/v2/reference/openfeature/flag-evaluation.mdx new file mode 100644 index 00000000..405a38b9 --- /dev/null +++ b/docs/v2/reference/openfeature/flag-evaluation.mdx @@ -0,0 +1,22 @@ +--- +title: "Flag Evaluation" +description: "Evaluate a single flag via OFREP." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/flipt/openapi.yaml POST /ofrep/v1/evaluate/flags/{key}" +--- + +<RequestExample> + +```bash cURL +curl --request POST \ + --url http://localhost:8080/ofrep/v1/evaluate/flags/<flagKey> \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --header 'X-Flipt-Namespace: <namespaceKey>' \ + --data '{ + "context": { + "targetingKey": "targetingKey1" + } +}' +``` + +</RequestExample> diff --git a/docs/v2/reference/overview.mdx b/docs/v2/reference/overview.mdx index da51147d..8348159b 100644 --- a/docs/v2/reference/overview.mdx +++ b/docs/v2/reference/overview.mdx @@ -1,10 +1,10 @@ --- title: API Overview -description: Learn how to interact with the Flipt REST API to manage flags, segments, rules, and evaluate feature flags programmatically. +description: Learn how to interact with the Flipt REST API to manage environments, branches, namespaces, flags, and segments, and evaluate feature flags programmatically. --- -Flipt's API is the primary way to interact with Flipt Open Source outside of the UI. It's used to create, update, and delete entities such as namespaces, flags, segments, rules, and also to evaluate flags. +Flipt's API is the primary way to interact with Flipt outside of the UI. You can use it to manage environments, branches, namespaces, flags, and segments, and to evaluate flags. -The Flipt UI is completely backed by this same API. This means that anything that can be done in the Flipt UI can also be done via the REST API. +The Flipt UI is backed by this same API. Anything you can do in the UI you can also do via the REST API. -The latest version of the [management REST API](https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml) and [evaluation REST API](https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/evaluation/openapi.yaml) are documented using the OpenAPI v3 specification. +The [management REST API](https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml), [evaluation snapshot REST API](https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/evaluation/openapi.yaml), and [evaluation REST API](https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/flipt/openapi.yaml) are documented using the OpenAPI v3 specification. Server-side evaluation uses the same `/evaluate/v1` endpoints as Flipt v1. diff --git a/docs/v2/reference/segments/create-segment.mdx b/docs/v2/reference/segments/create-segment.mdx new file mode 100644 index 00000000..c6378414 --- /dev/null +++ b/docs/v2/reference/segments/create-segment.mdx @@ -0,0 +1,43 @@ +--- +title: "Create Segment" +description: "Create a new segment in a namespace." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml POST /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources" +--- + +<RequestExample> + +```bash cURL +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>" + } +}' +``` + +</RequestExample> + +<ResponseExample> + +```json 200 +{ + "resource": { + "namespaceKey": "default", + "key": "<key>", + "payload": { + "@type": "flipt.core.Segment", + "key": "<key>", + "name": "<name>" + } + }, + "revision": "<revision>" +} +``` + +</ResponseExample> diff --git a/docs/v2/reference/segments/delete-segment.mdx b/docs/v2/reference/segments/delete-segment.mdx new file mode 100644 index 00000000..ced52cf3 --- /dev/null +++ b/docs/v2/reference/segments/delete-segment.mdx @@ -0,0 +1,15 @@ +--- +title: "Delete Segment" +description: "Delete a segment by key." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml DELETE /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources/{typeUrl}/{key}" +--- + +<RequestExample> + +```bash cURL +curl --request DELETE \ + --url http://localhost:8080/api/v2/environments/production/namespaces/default/resources/flipt.core.Segment/my-segment \ + --header 'Accept: application/json' +``` + +</RequestExample> diff --git a/docs/v2/reference/segments/get-segment.mdx b/docs/v2/reference/segments/get-segment.mdx new file mode 100644 index 00000000..76e81bc3 --- /dev/null +++ b/docs/v2/reference/segments/get-segment.mdx @@ -0,0 +1,34 @@ +--- +title: "Get Segment" +description: "Get a segment by key." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml GET /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources/{typeUrl}/{key}" +--- + +<RequestExample> + +```bash cURL +curl --url http://localhost:8080/api/v2/environments/production/namespaces/default/resources/flipt.core.Segment/my-segment \ + --header 'Accept: application/json' +``` + +</RequestExample> + +<ResponseExample> + +```json 200 +{ + "resource": { + "namespaceKey": "default", + "key": "my-segment", + "payload": { + "@type": "flipt.core.Segment", + "key": "my-segment", + "name": "My segment", + "matchType": "ALL_MATCH_TYPE" + } + }, + "revision": "<revision>" +} +``` + +</ResponseExample> diff --git a/docs/v2/reference/segments/list-segments.mdx b/docs/v2/reference/segments/list-segments.mdx new file mode 100644 index 00000000..85fc5609 --- /dev/null +++ b/docs/v2/reference/segments/list-segments.mdx @@ -0,0 +1,36 @@ +--- +title: "List Segments" +description: "List all segments in a namespace." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml GET /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources/{typeUrl}" +--- + +<RequestExample> + +```bash cURL +curl --url http://localhost:8080/api/v2/environments/production/namespaces/default/resources/flipt.core.Segment \ + --header 'Accept: application/json' +``` + +</RequestExample> + +<ResponseExample> + +```json 200 +{ + "resources": [ + { + "namespaceKey": "default", + "key": "my-segment", + "payload": { + "@type": "flipt.core.Segment", + "key": "my-segment", + "name": "My segment", + "matchType": "ALL_MATCH_TYPE" + } + } + ], + "revision": "<revision>" +} +``` + +</ResponseExample> diff --git a/docs/v2/reference/segments/update-segment.mdx b/docs/v2/reference/segments/update-segment.mdx new file mode 100644 index 00000000..9065be67 --- /dev/null +++ b/docs/v2/reference/segments/update-segment.mdx @@ -0,0 +1,43 @@ +--- +title: "Update Segment" +description: "Update an existing segment in a namespace." +openapi: "https://raw.githubusercontent.com/flipt-io/flipt/refs/heads/v2/rpc/v2/environments/openapi.yaml PUT /api/v2/environments/{environmentKey}/namespaces/{namespaceKey}/resources" +--- + +<RequestExample> + +```bash cURL +curl --request PUT \ + --url http://localhost:8080/api/v2/environments/production/namespaces/default/resources \ + --header 'Content-Type: application/json' \ + --header 'Accept: application/json' \ + --data '{ + "key": "my-segment", + "payload": { + "@type": "flipt.core.Segment", + "key": "my-segment", + "name": "<name>" + } +}' +``` + +</RequestExample> + +<ResponseExample> + +```json 200 +{ + "resource": { + "namespaceKey": "default", + "key": "my-segment", + "payload": { + "@type": "flipt.core.Segment", + "key": "my-segment", + "name": "<name>" + } + }, + "revision": "<revision>" +} +``` + +</ResponseExample>