{"openapi":"3.1.0","info":{"title":"Flagon API","version":"0.1.0","description":"The Flagon control plane. Everything the product does that needs to be live is an endpoint here; the console and marketing site render screens and call this API.\n\n## Authentication\n\nTwo credentials, never interchangeable:\n\n- **Access token** (`flagon_oat_...`) authenticates the **management API** under `/v1`. Send it as `Authorization: Bearer <token>`.\n- **SDK key** (`flagon_sdk_...`), scoped to one environment, authenticates **OFREP evaluation** under `/ofrep`.\n\n## Conventions\n\nEvery response is JSON, success and failure alike. A failure carries the `Error` envelope (a `message`, the `status`, and, on a 422, a per-field `errors` map). Management writes are rate limited; a `429` returns `Retry-After` and `RateLimit-*` headers.","contact":{"name":"Flagon","url":"https://flagon.io"}},"externalDocs":{"description":"Guides, concepts, and quickstarts","url":"https://flagon.io/docs"},"servers":[{"url":"https://api.flagon.io","description":"This deployment"}],"tags":[{"name":"OFREP evaluation","description":"Evaluate flags with an SDK key over the OpenFeature Remote Evaluation Protocol (single and bulk)."},{"name":"Flags","description":"Create and configure flags and their per-environment state."},{"name":"Variants","description":"The values a flag can serve."},{"name":"Targeting rules","description":"Per-environment rules that serve a variant to a matched audience."},{"name":"Segments","description":"Reusable, named audiences referenced by targeting rules."},{"name":"Entities","description":"Known targeting subjects and their attributes."},{"name":"Environments","description":"The stages a flag is configured across."},{"name":"SDK keys","description":"Per-environment keys that authenticate OFREP evaluation."},{"name":"Members","description":"People in an organization."},{"name":"Waitlist","description":"Public early-access intake."},{"name":"Meta"},{"name":"Identity"}],"paths":{"/ofrep/v1/evaluate/flags/{key}":{"post":{"summary":"Evaluate a flag","description":"Evaluate one flag for the supplied evaluation context. Authenticated by an SDK key, which pins the organization and environment.","tags":["OFREP evaluation"],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."}],"security":[{"sdkKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"context":{"type":"object","properties":{"targetingKey":{"type":"string"}},"additionalProperties":{}}}}}}},"responses":{"200":{"description":"The evaluation result.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EvaluationResponse"}}}},"400":{"description":"The request body could not be parsed, the context was invalid, or the flag's configuration could not resolve.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"A valid SDK key is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"The flag is not configured in this environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many evaluations; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/ofrep/v1/evaluate/flags":{"post":{"summary":"Evaluate all flags","description":"Evaluate every flag configured in the SDK key's environment for the supplied context. Each entry is a success object or a per-flag failure object, so one misconfigured flag never fails the call.","tags":["OFREP evaluation"],"security":[{"sdkKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"context":{"type":"object","properties":{"targetingKey":{"type":"string"}},"additionalProperties":{}}}}}}},"responses":{"200":{"description":"The evaluation results. The response carries an ETag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkEvaluationResponse"}}}},"304":{"description":"The configuration is unchanged since the ETag in the If-None-Match request header, so the previous results still hold. No body is returned."},"400":{"description":"The request body could not be parsed, or the context was invalid.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"A valid SDK key is required.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many evaluations; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/healthz":{"get":{"summary":"Health check","description":"Liveness probe. Returns the current server time; never touches the database.","tags":["Meta"],"responses":{"200":{"description":"The service is up.","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","const":"ok"},"version":{"type":"string"},"time":{"type":"string","description":"ISO-8601 server time."}},"required":["status","version","time"],"additionalProperties":false}}}}}}},"/v1/waitlist":{"post":{"summary":"Join the waitlist","description":"Record an email address for early access. Submitting the same address again is a no-op success.","tags":["Waitlist"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string","maxLength":320,"format":"email","pattern":"^(?!\\.)(?!.*\\.\\.)([A-Za-z0-9_'+\\-\\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"}},"required":["email"]}}}},"responses":{"200":{"description":"The address is on the list.","content":{"application/json":{"schema":{"type":"object","properties":{"accepted":{"type":"boolean"}},"required":["accepted"],"additionalProperties":false}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many submissions from this source; retry later.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/me":{"get":{"summary":"Identify the caller","description":"Resolve the authenticated identity for this request. Send a personal or organization access token as `Authorization: Bearer <token>`, or call from a browser that holds a valid Flagon session cookie. Returns 401 when neither is present or valid.","tags":["Identity"],"responses":{"200":{"description":"The authenticated identity.","content":{"application/json":{"schema":{"anyOf":[{"type":"object","properties":{"kind":{"type":"string","const":"user"},"via":{"type":"string","enum":["token","cookie"]},"user":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"username":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","email","username"],"additionalProperties":false}},"required":["kind","via","user"],"additionalProperties":false},{"type":"object","properties":{"kind":{"type":"string","const":"organization"},"via":{"type":"string","const":"token"},"organization":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"slug":{"type":"string"},"plan":{"type":"string"}},"required":["id","name","slug","plan"],"additionalProperties":false}},"required":["kind","via","organization"],"additionalProperties":false}]}}}},"401":{"description":"No valid token or session was supplied.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/flags/{key}/environments/{envKey}/rules":{"post":{"summary":"Create a targeting rule","description":"Append a targeting rule to a flag's environment. Rules serve in priority order (lowest first).","tags":["Targeting rules"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."},{"name":"envKey","in":"path","required":true,"schema":{"type":"string"},"description":"The environment key (e.g. production, preview, development)."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"conditions":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def0"}},"serve":{"anyOf":[{"type":"object","properties":{"variant":{"type":"string","minLength":1}},"required":["variant"]},{"type":"object","properties":{"rollout":{"minItems":1,"maxItems":64,"type":"array","items":{"type":"object","properties":{"variant":{"type":"string","minLength":1},"weight":{"type":"number","minimum":0,"maximum":1000000}},"required":["variant","weight"]}},"bucketBy":{"type":"string","minLength":1,"maxLength":200}},"required":["rollout"]}]},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"required":["serve"]}}}},"responses":{"201":{"description":"The rule was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleResponse"}}}},"404":{"description":"No such flag or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The flag is archived; restore it before editing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation, or references an unknown variant or segment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Replace all targeting rules","description":"Replace the environment's entire ordered rule set in one atomic transaction, recorded as a single revision.","tags":["Targeting rules"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."},{"name":"envKey","in":"path","required":true,"schema":{"type":"string"},"description":"The environment key (e.g. production, preview, development)."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"rules":{"maxItems":200,"type":"array","items":{"type":"object","properties":{"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"conditions":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def2"}},"serve":{"anyOf":[{"type":"object","properties":{"variant":{"type":"string","minLength":1}},"required":["variant"]},{"type":"object","properties":{"rollout":{"minItems":1,"maxItems":64,"type":"array","items":{"type":"object","properties":{"variant":{"type":"string","minLength":1},"weight":{"type":"number","minimum":0,"maximum":1000000}},"required":["variant","weight"]}},"bucketBy":{"type":"string","minLength":1,"maxLength":200}},"required":["rollout"]}]}},"required":["serve"]}}},"required":["rules"]}}}},"responses":{"200":{"description":"The replaced rule set.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleListResponse"}}}},"404":{"description":"No such flag or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The flag is archived; restore it before editing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation, or references an unknown variant or segment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List targeting rules","description":"List the flag's targeting rules for an environment, in priority order.","tags":["Targeting rules"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."},{"name":"envKey","in":"path","required":true,"schema":{"type":"string"},"description":"The environment key (e.g. production, preview, development)."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The environment's targeting rules.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleListResponse"}}}},"404":{"description":"No such flag or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/flags/{key}/environments/{envKey}/rules/{ruleId}":{"patch":{"summary":"Update a rule","description":"Edit a single targeting rule's description, conditions, serve, or priority.","tags":["Targeting rules"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."},{"name":"envKey","in":"path","required":true,"schema":{"type":"string"},"description":"The environment key (e.g. production, preview, development)."},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string"},"description":"The targeting rule id."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"description":{"anyOf":[{"type":"string","maxLength":500},{"type":"null"}]},"conditions":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def4"}},"serve":{"anyOf":[{"type":"object","properties":{"variant":{"type":"string","minLength":1}},"required":["variant"]},{"type":"object","properties":{"rollout":{"minItems":1,"maxItems":64,"type":"array","items":{"type":"object","properties":{"variant":{"type":"string","minLength":1},"weight":{"type":"number","minimum":0,"maximum":1000000}},"required":["variant","weight"]}},"bucketBy":{"type":"string","minLength":1,"maxLength":200}},"required":["rollout"]}]},"priority":{"type":"integer","minimum":0,"maximum":9007199254740991}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RuleResponse"}}}},"404":{"description":"No such flag, environment, or rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The flag is archived; restore it before editing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation, or references an unknown variant or segment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a rule","description":"Remove a single targeting rule from a flag's environment.","tags":["Targeting rules"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."},{"name":"envKey","in":"path","required":true,"schema":{"type":"string"},"description":"The environment key (e.g. production, preview, development)."},{"name":"ruleId","in":"path","required":true,"schema":{"type":"string"},"description":"The targeting rule id."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The rule was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAck"}}}},"404":{"description":"No such flag, environment, or rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The flag is archived; restore it before editing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/flags/{key}/environments/{envKey}/rules/reorder":{"post":{"summary":"Reorder rules","description":"Set the priority order of the environment's rules from an ordered list of rule ids.","tags":["Targeting rules"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."},{"name":"envKey","in":"path","required":true,"schema":{"type":"string"},"description":"The environment key (e.g. production, preview, development)."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"ruleIds":{"maxItems":200,"type":"array","items":{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"}}},"required":["ruleIds"]}}}},"responses":{"200":{"description":"The rules were reordered.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAck"}}}},"404":{"description":"No such flag or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The flag is archived; restore it before editing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/flags/{key}/variants":{"post":{"summary":"Create a variant","description":"Add a variant to a multivariate flag. Boolean flags have fixed on/off variants and reject this.","tags":["Variants"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{},"label":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["value"]}}}},"responses":{"201":{"description":"The variant was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantResponse"}}}},"404":{"description":"No flag with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The flag is archived; restore it before editing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/flags/{key}/variants/{variantKey}":{"patch":{"summary":"Update a variant","description":"Edit a variant's value or label.","tags":["Variants"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."},{"name":"variantKey","in":"path","required":true,"schema":{"type":"string"},"description":"The variant key (e.g. variant-1)."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"value":{},"label":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated variant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VariantResponse"}}}},"404":{"description":"No such flag or variant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The flag is archived; restore it before editing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a variant","description":"Remove a variant. Rejected while a default, off value, or targeting rule still references it.","tags":["Variants"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."},{"name":"variantKey","in":"path","required":true,"schema":{"type":"string"},"description":"The variant key (e.g. variant-1)."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The variant was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAck"}}}},"404":{"description":"No such flag or variant.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The flag is archived, or the variant is still referenced by a default, off value, or targeting rule.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/flags":{"post":{"summary":"Create a flag","description":"Create a flag. Flags are created disabled in every environment; enable them per environment afterwards.","tags":["Flags"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"slug":{"type":"string","minLength":1,"maxLength":63,"pattern":"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"type":{"default":"boolean","type":"string","enum":["boolean","string","number","json"]},"variants":{"maxItems":64,"type":"array","items":{"type":"object","properties":{"value":{},"label":{"anyOf":[{"type":"string","maxLength":120},{"type":"null"}]}},"required":["value"]}},"tags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}}},"required":["slug"]}}}},"responses":{"201":{"description":"The flag was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagResponse"},"example":{"flag":{"id":"b3f1c2e4-5a6b-4c8d-9e0f-1a2b3c4d5e6f","key":"new-checkout","name":"new-checkout","description":"Roll out the redesigned checkout flow.","type":"boolean","permanent":false,"tags":["checkout","growth"],"maintainerUserId":null,"createdByUserId":"a1b2c3d4-e5f6-4a8b-9c0d-1e2f3a4b5c6d","archivedAt":null,"createdAt":"2026-07-29T12:00:00.000Z","updatedAt":"2026-07-29T12:00:00.000Z"}}}}},"409":{"description":"A flag with that key already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List flags","description":"List every flag in the organization with its per-environment configuration.","tags":["Flags"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The organization's flags.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagListResponse"}}}}}}},"/v1/orgs/{org}/flags/{key}":{"get":{"summary":"Get a flag","tags":["Flags"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The flag and its configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagDetailResponse"}}}},"404":{"description":"No flag with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a flag","description":"Edit flag metadata: name, description, maintainer, permanence, and tags.","tags":["Flags"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"maintainerUserId":{"anyOf":[{"type":"string","format":"uuid","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"},{"type":"null"}]},"permanent":{"type":"boolean"},"tags":{"maxItems":50,"type":"array","items":{"type":"string","minLength":1,"maxLength":50}}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated flag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagResponse"}}}},"404":{"description":"No flag with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a flag","description":"Permanently delete a flag. Evaluation of the key stops, so remove all references first.","tags":["Flags"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The flag was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAck"}}}},"404":{"description":"No flag with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/flags/{key}/usage":{"get":{"summary":"Get flag usage","description":"Evaluation counts and recency for the flag, per environment.","tags":["Flags"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Usage summary for the flag.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagUsageResponse"}}}},"404":{"description":"No flag with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/flags/{key}/archive":{"post":{"summary":"Archive a flag","description":"Retire a flag. It disappears from the active list but keeps evaluating, so existing clients never break.","tags":["Flags"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The flag was archived.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagResponse"}}}},"404":{"description":"No flag with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/flags/{key}/restore":{"post":{"summary":"Restore a flag","description":"Return an archived flag to the active list so its configuration can be edited again.","tags":["Flags"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The flag was restored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagResponse"}}}},"404":{"description":"No flag with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/flags/{key}/environments/{envKey}":{"patch":{"summary":"Configure a flag in an environment","description":"Set the on/off state, the default variant or rollout, and the off variant for a flag in one environment.","tags":["Flags"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The flag key."},{"name":"envKey","in":"path","required":true,"schema":{"type":"string"},"description":"The environment key (e.g. production, preview, development)."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"defaultVariantKey":{"type":"string"},"offVariantKey":{"type":"string"},"defaultServe":{"anyOf":[{"type":"object","properties":{"variant":{"type":"string","minLength":1}},"required":["variant"]},{"type":"object","properties":{"rollout":{"minItems":1,"maxItems":64,"type":"array","items":{"type":"object","properties":{"variant":{"type":"string","minLength":1},"weight":{"type":"number","minimum":0,"maximum":1000000}},"required":["variant","weight"]}},"bucketBy":{"type":"string","minLength":1,"maxLength":200}},"required":["rollout"]}]}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated environment configuration.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAck"}}}},"404":{"description":"No such flag or environment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"The flag is archived; restore it before editing.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/sdk-keys":{"post":{"summary":"Mint an SDK key","description":"Create an SDK key for one environment. The plaintext token is returned once at creation and never again.","tags":["SDK keys"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":120},"environment":{"type":"string","minLength":1}},"required":["name","environment"]}}}},"responses":{"201":{"description":"The SDK key, including its plaintext token (returned once).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkKeyCreatedResponse"}}}},"404":{"description":"No environment with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List SDK keys","description":"List the organization's SDK keys as masked metadata. The secret is never returned.","tags":["SDK keys"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The organization's SDK keys (masked).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SdkKeyListResponse"}}}}}}},"/v1/orgs/{org}/sdk-keys/{id}/revoke":{"post":{"summary":"Revoke an SDK key","description":"Revoke an SDK key so it can no longer be used to evaluate flags.","tags":["SDK keys"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"id","in":"path","required":true,"schema":{"type":"string"},"description":"The SDK key id."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The SDK key was revoked.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAck"}}}},"404":{"description":"No SDK key with that id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/segments":{"post":{"summary":"Create a segment","description":"Create a reusable targeting segment: a named group of conditions that rules can reference.","tags":["Segments"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":63,"pattern":"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"},"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"conditions":{"default":[],"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def6"}}},"required":["key","name"]}}}},"responses":{"201":{"description":"The segment was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentResponse"}}}},"409":{"description":"A segment with that key already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List segments","description":"List every segment in the organization.","tags":["Segments"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The organization's segments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentListResponse"}}}}}}},"/v1/orgs/{org}/segments/{key}":{"get":{"summary":"Get a segment","tags":["Segments"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The segment key."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The segment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentResponse"}}}},"404":{"description":"No segment with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"patch":{"summary":"Update a segment","description":"Edit a segment's name, description, or conditions.","tags":["Segments"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The segment key."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200},"description":{"anyOf":[{"type":"string","maxLength":2000},{"type":"null"}]},"conditions":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def8"}}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated segment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SegmentResponse"}}}},"404":{"description":"No segment with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete a segment","description":"Permanently delete a segment.","tags":["Segments"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The segment key."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The segment was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAck"}}}},"404":{"description":"No segment with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/entities":{"post":{"summary":"Create an entity","description":"Define a targeting entity (e.g. user, team) and its typed attributes that rules and segments reference.","tags":["Entities"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":63,"pattern":"^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$"},"label":{"type":"string","minLength":1,"maxLength":200},"attributes":{"default":[],"maxItems":100,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":120},"dataType":{"default":"string","type":"string","enum":["string","number","boolean"]},"labels":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},{"type":"null"}]}},"required":["key"]}}},"required":["key","label"]}}}},"responses":{"201":{"description":"The entity was created.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityResponse"}}}},"409":{"description":"An entity with that key already exists.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"get":{"summary":"List entities","description":"List every entity in the organization with its attributes.","tags":["Entities"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The organization's entities.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityListResponse"}}}}}}},"/v1/orgs/{org}/entities/{key}":{"patch":{"summary":"Update an entity","description":"Edit an entity's label or replace its attribute set.","tags":["Entities"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The entity key."}],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","properties":{"label":{"type":"string","minLength":1,"maxLength":200},"attributes":{"maxItems":100,"type":"array","items":{"type":"object","properties":{"key":{"type":"string","minLength":1,"maxLength":120},"dataType":{"default":"string","type":"string","enum":["string","number","boolean"]},"labels":{"anyOf":[{"maxItems":200,"type":"array","items":{"type":"string","maxLength":120}},{"type":"null"}]}},"required":["key"]}}},"additionalProperties":false}}}},"responses":{"200":{"description":"The updated entity.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntityResponse"}}}},"404":{"description":"No entity with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"422":{"description":"The submitted data failed validation.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"delete":{"summary":"Delete an entity","description":"Permanently delete an entity and its attributes.","tags":["Entities"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."},{"name":"key","in":"path","required":true,"schema":{"type":"string"},"description":"The entity key."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The entity was deleted.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DeleteAck"}}}},"404":{"description":"No entity with that key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"Too many management writes; retry after the Retry-After delay.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/orgs/{org}/environments":{"get":{"summary":"List environments","description":"List the organization's environments (Production, Preview, Development), seeded on first read.","tags":["Environments"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The organization's environments.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EnvironmentListResponse"}}}}}}},"/v1/orgs/{org}/members":{"get":{"summary":"List members","description":"List the organization's members with their name, email, and role.","tags":["Members"],"parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"},"description":"The organization slug."}],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The organization's members.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/MemberListResponse"}}}}}}}},"components":{"schemas":{"Error":{"type":"object","properties":{"message":{"type":"string","description":"A human-readable explanation of the failure."},"status":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991,"description":"The HTTP status code, repeated in the body."},"errors":{"description":"Per-field validation messages, present only on a 422.","type":"object","propertyNames":{"type":"string"},"additionalProperties":{"type":"array","items":{"type":"string"}}}},"required":["message","status"],"additionalProperties":false},"EvaluationResponse":{"type":"object","properties":{"key":{"type":"string"},"value":{"description":"The resolved flag value; any JSON type."},"reason":{"type":"string"},"variant":{"type":"string"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["key","value","reason","metadata"],"additionalProperties":false},"BulkEvaluationResponse":{"type":"object","properties":{"flags":{"type":"array","items":{"anyOf":[{"type":"object","properties":{"key":{"type":"string"},"value":{"description":"The resolved flag value; any JSON type."},"reason":{"type":"string"},"variant":{"type":"string"},"metadata":{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{}}},"required":["key","value","reason","metadata"],"additionalProperties":false},{"type":"object","properties":{"key":{"type":"string"},"errorCode":{"type":"string"},"errorDetails":{"type":"string"}},"required":["key","errorCode"],"additionalProperties":false}]}}},"required":["flags"],"additionalProperties":false},"Rule":{"type":"object","properties":{"id":{"type":"string"},"priority":{"type":"number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{},"serve":{},"createdAt":{"type":"string","description":"ISO 8601 timestamp"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","priority","description","conditions","serve","createdAt","updatedAt"],"additionalProperties":false},"RuleResponse":{"type":"object","properties":{"rule":{"type":"object","properties":{"id":{"type":"string"},"priority":{"type":"number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{},"serve":{},"createdAt":{"type":"string","description":"ISO 8601 timestamp"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","priority","description","conditions","serve","createdAt","updatedAt"],"additionalProperties":false}},"required":["rule"],"additionalProperties":false},"RuleListResponse":{"type":"object","properties":{"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"priority":{"type":"number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{},"serve":{},"createdAt":{"type":"string","description":"ISO 8601 timestamp"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","priority","description","conditions","serve","createdAt","updatedAt"],"additionalProperties":false}}},"required":["rules"],"additionalProperties":false},"Variant":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"value":{},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"number"}},"required":["id","key","value","label","sortOrder"],"additionalProperties":false},"VariantResponse":{"type":"object","properties":{"variant":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"value":{},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"number"}},"required":["id","key","value","label","sortOrder"],"additionalProperties":false}},"required":["variant"],"additionalProperties":false},"Flag":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["boolean","string","number","json"]},"permanent":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"maintainerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"createdAt":{"type":"string","description":"ISO 8601 timestamp"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","key","name","description","type","permanent","tags","maintainerUserId","createdByUserId","archivedAt","createdAt","updatedAt"],"additionalProperties":false},"FlagResponse":{"type":"object","properties":{"flag":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["boolean","string","number","json"]},"permanent":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"maintainerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"createdAt":{"type":"string","description":"ISO 8601 timestamp"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","key","name","description","type","permanent","tags","maintainerUserId","createdByUserId","archivedAt","createdAt","updatedAt"],"additionalProperties":false}},"required":["flag"],"additionalProperties":false},"DeleteAck":{"type":"object","properties":{"ok":{"type":"boolean"}},"required":["ok"],"additionalProperties":false},"FlagListResponse":{"type":"object","properties":{"flags":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["boolean","string","number","json"]},"permanent":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"maintainerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"createdAt":{"type":"string","description":"ISO 8601 timestamp"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp"},"value":{},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"maintainerName":{"anyOf":[{"type":"string"},{"type":"null"}]},"usage":{"anyOf":[{"type":"object","properties":{"total":{"type":"number"},"checksPerHour":{"type":"number"},"lastSeenAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"series":{"type":"array","items":{"type":"number"}}},"required":["total","checksPerHour","lastSeenAt","series"],"additionalProperties":false},{"type":"null"}]}},"required":["id","key","name","description","type","permanent","tags","maintainerUserId","createdByUserId","archivedAt","createdAt","updatedAt","value","createdByName","maintainerName","usage"],"additionalProperties":false}}},"required":["flags"],"additionalProperties":false},"FlagDetailResponse":{"type":"object","properties":{"flag":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"type":"string","enum":["boolean","string","number","json"]},"permanent":{"type":"boolean"},"tags":{"type":"array","items":{"type":"string"}},"maintainerUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdByUserId":{"anyOf":[{"type":"string"},{"type":"null"}]},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"createdAt":{"type":"string","description":"ISO 8601 timestamp"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp"},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"maintainerName":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","key","name","description","type","permanent","tags","maintainerUserId","createdByUserId","archivedAt","createdAt","updatedAt","createdByName","maintainerName"],"additionalProperties":false},"revisions":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"action":{"type":"string"},"summary":{"anyOf":[{"type":"string"},{"type":"null"}]},"changes":{"type":"array","items":{"type":"string"}},"userName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","action","summary","changes","userName","createdAt"],"additionalProperties":false}},"variants":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"value":{},"label":{"anyOf":[{"type":"string"},{"type":"null"}]},"sortOrder":{"type":"number"}},"required":["id","key","value","label","sortOrder"],"additionalProperties":false}},"environments":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"enabled":{"type":"boolean"},"defaultVariantKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"defaultServe":{},"offVariantKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"priority":{"type":"number"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{},"serve":{}},"required":["id","priority","description","conditions","serve"],"additionalProperties":false}}},"required":["key","name","enabled","defaultVariantKey","defaultServe","offVariantKey","rules"],"additionalProperties":false}}},"required":["flag","revisions","variants","environments"],"additionalProperties":false},"FlagUsageResponse":{"type":"object","properties":{"usage":{"type":"object","properties":{"total":{"type":"number"},"lastSeenAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"environments":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"total":{"type":"number"},"lastSeenAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"variants":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"count":{"type":"number"}},"required":["key","count"],"additionalProperties":false}},"series":{"type":"array","items":{"type":"object","properties":{"day":{"type":"string"},"count":{"type":"number"}},"required":["day","count"],"additionalProperties":false}}},"required":["key","name","total","lastSeenAt","variants","series"],"additionalProperties":false}}},"required":["total","lastSeenAt","environments"],"additionalProperties":false}},"required":["usage"],"additionalProperties":false},"SdkKey":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"environmentKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"prefix":{"type":"string"},"lastFour":{"type":"string"},"masked":{"type":"string"},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"revokedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"createdAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","name","environmentKey","prefix","lastFour","masked","lastUsedAt","revokedAt","createdAt"],"additionalProperties":false},"SdkKeyCreatedResponse":{"type":"object","properties":{"key":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"environmentKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"prefix":{"type":"string"},"lastFour":{"type":"string"},"masked":{"type":"string"},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"revokedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"createdAt":{"type":"string","description":"ISO 8601 timestamp"},"token":{"type":"string","description":"The plaintext SDK key, returned only once at creation."}},"required":["id","name","environmentKey","prefix","lastFour","masked","lastUsedAt","revokedAt","createdAt","token"],"additionalProperties":false}},"required":["key"],"additionalProperties":false},"SdkKeyListResponse":{"type":"object","properties":{"keys":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"environmentKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"prefix":{"type":"string"},"lastFour":{"type":"string"},"masked":{"type":"string"},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"revokedAt":{"anyOf":[{"type":"string"},{"type":"null"}],"description":"ISO 8601 timestamp"},"createdAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","name","environmentKey","prefix","lastFour","masked","lastUsedAt","revokedAt","createdAt"],"additionalProperties":false}}},"required":["keys"],"additionalProperties":false},"Segment":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{},"createdAt":{"type":"string","description":"ISO 8601 timestamp"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","key","name","description","conditions","createdAt","updatedAt"],"additionalProperties":false},"SegmentResponse":{"type":"object","properties":{"segment":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{},"createdAt":{"type":"string","description":"ISO 8601 timestamp"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","key","name","description","conditions","createdAt","updatedAt"],"additionalProperties":false}},"required":["segment"],"additionalProperties":false},"SegmentListResponse":{"type":"object","properties":{"segments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"description":{"anyOf":[{"type":"string"},{"type":"null"}]},"conditions":{},"createdAt":{"type":"string","description":"ISO 8601 timestamp"},"updatedAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","key","name","description","conditions","createdAt","updatedAt"],"additionalProperties":false}}},"required":["segments"],"additionalProperties":false},"Entity":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"attributes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"dataType":{"type":"string"},"labels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["key","dataType","labels"],"additionalProperties":false}},"createdAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","key","label","attributes","createdAt"],"additionalProperties":false},"EntityResponse":{"type":"object","properties":{"entity":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"attributes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"dataType":{"type":"string"},"labels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["key","dataType","labels"],"additionalProperties":false}},"createdAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","key","label","attributes","createdAt"],"additionalProperties":false}},"required":["entity"],"additionalProperties":false},"EntityListResponse":{"type":"object","properties":{"entities":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"label":{"type":"string"},"attributes":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"dataType":{"type":"string"},"labels":{"anyOf":[{"type":"array","items":{"type":"string"}},{"type":"null"}]}},"required":["key","dataType","labels"],"additionalProperties":false}},"createdAt":{"type":"string","description":"ISO 8601 timestamp"}},"required":["id","key","label","attributes","createdAt"],"additionalProperties":false}}},"required":["entities"],"additionalProperties":false},"Environment":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"sortOrder":{"type":"number"}},"required":["id","key","name","sortOrder"],"additionalProperties":false},"EnvironmentListResponse":{"type":"object","properties":{"environments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"sortOrder":{"type":"number"}},"required":["id","key","name","sortOrder"],"additionalProperties":false}}},"required":["environments"],"additionalProperties":false},"Member":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"}},"required":["userId","name","email","role"],"additionalProperties":false},"MemberListResponse":{"type":"object","properties":{"members":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"},"email":{"type":"string"},"role":{"type":"string"}},"required":["userId","name","email","role"],"additionalProperties":false}}},"required":["members"],"additionalProperties":false},"Def0":{"anyOf":[{"type":"object","properties":{"attribute":{"type":"string","minLength":1,"maxLength":200},"op":{"type":"string","enum":["eq","neq","in","nin","contains","not_contains","starts_with","ends_with","gt","gte","lt","lte","exists","not_exists","before","after","semver_eq","semver_gt","semver_ge","semver_lt","semver_le"]},"values":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Def1"}}},"required":["attribute","op"]},{"type":"object","properties":{"segment":{"type":"string","minLength":1,"maxLength":200}},"required":["segment"]},{"type":"object","properties":{"all":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def0"}}},"required":["all"]},{"type":"object","properties":{"any":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def0"}}},"required":["any"]}]},"Def1":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/Def1"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/Def1"}}]},"Def2":{"anyOf":[{"type":"object","properties":{"attribute":{"type":"string","minLength":1,"maxLength":200},"op":{"type":"string","enum":["eq","neq","in","nin","contains","not_contains","starts_with","ends_with","gt","gte","lt","lte","exists","not_exists","before","after","semver_eq","semver_gt","semver_ge","semver_lt","semver_le"]},"values":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Def3"}}},"required":["attribute","op"]},{"type":"object","properties":{"segment":{"type":"string","minLength":1,"maxLength":200}},"required":["segment"]},{"type":"object","properties":{"all":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def2"}}},"required":["all"]},{"type":"object","properties":{"any":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def2"}}},"required":["any"]}]},"Def3":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/Def3"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/Def3"}}]},"Def4":{"anyOf":[{"type":"object","properties":{"attribute":{"type":"string","minLength":1,"maxLength":200},"op":{"type":"string","enum":["eq","neq","in","nin","contains","not_contains","starts_with","ends_with","gt","gte","lt","lte","exists","not_exists","before","after","semver_eq","semver_gt","semver_ge","semver_lt","semver_le"]},"values":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Def5"}}},"required":["attribute","op"]},{"type":"object","properties":{"segment":{"type":"string","minLength":1,"maxLength":200}},"required":["segment"]},{"type":"object","properties":{"all":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def4"}}},"required":["all"]},{"type":"object","properties":{"any":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def4"}}},"required":["any"]}]},"Def5":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/Def5"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/Def5"}}]},"Def6":{"anyOf":[{"type":"object","properties":{"attribute":{"type":"string","minLength":1,"maxLength":200},"op":{"type":"string","enum":["eq","neq","in","nin","contains","not_contains","starts_with","ends_with","gt","gte","lt","lte","exists","not_exists","before","after","semver_eq","semver_gt","semver_ge","semver_lt","semver_le"]},"values":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Def7"}}},"required":["attribute","op"]},{"type":"object","properties":{"segment":{"type":"string","minLength":1,"maxLength":200}},"required":["segment"]},{"type":"object","properties":{"all":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def6"}}},"required":["all"]},{"type":"object","properties":{"any":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def6"}}},"required":["any"]}]},"Def7":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/Def7"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/Def7"}}]},"Def8":{"anyOf":[{"type":"object","properties":{"attribute":{"type":"string","minLength":1,"maxLength":200},"op":{"type":"string","enum":["eq","neq","in","nin","contains","not_contains","starts_with","ends_with","gt","gte","lt","lte","exists","not_exists","before","after","semver_eq","semver_gt","semver_ge","semver_lt","semver_le"]},"values":{"maxItems":200,"type":"array","items":{"$ref":"#/components/schemas/Def9"}}},"required":["attribute","op"]},{"type":"object","properties":{"segment":{"type":"string","minLength":1,"maxLength":200}},"required":["segment"]},{"type":"object","properties":{"all":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def8"}}},"required":["all"]},{"type":"object","properties":{"any":{"maxItems":50,"type":"array","items":{"$ref":"#/components/schemas/Def8"}}},"required":["any"]}]},"Def9":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"null"},{"type":"array","items":{"$ref":"#/components/schemas/Def9"}},{"type":"object","propertyNames":{"type":"string"},"additionalProperties":{"$ref":"#/components/schemas/Def9"}}]}},"securitySchemes":{"sdkKeyAuth":{"type":"http","scheme":"bearer","description":"A Flagon SDK key (`flagon_sdk_...`), scoped to one environment, for OFREP evaluation. Send it as `Authorization: Bearer <key>`."},"bearerAuth":{"type":"http","scheme":"bearer","description":"A Flagon access token (`flagon_oat_...`) for the management API. Send it as `Authorization: Bearer <token>`."}}}}