{"openapi":"3.1.0","info":{"title":"Superflag control-plane evaluation and advanced configuration API","version":"1.0.0","description":"Public Superflag HTTP API. Discovery documents at /openapi.json and /api/v1/contract do not require auth. Delivery and management routes require Authorization: Bearer with a cli_, admin_, sdk_, or pub_ credential. See https://superflag.sh/docs/api-reference/overview."},"servers":[{"url":"https://superflag.sh","description":"Production"}],"paths":{"/api/v1/config":{"get":{"operationId":"getServerConfig","description":"Frozen full legacy config for an environment sdk_ key. Client-visible projection is /api/v1/public-config.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Legacy config envelope: appId, env, version, doc, ttlSeconds. Frozen compatibility surface.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrozenConfigResponse"}}}},"304":{"description":"Authorization-scoped config is unchanged"},"401":{"description":"Missing, wrong-type, or revoked environment bearer. Legacy shape keeps string error plus code/message/resolution.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyConfigAuthError"}}}},"429":{"description":"Monthly config sync quota exceeded"},"503":{"description":"Config sync metering unavailable"}}}},"/api/v1/public-config":{"get":{"operationId":"getPublicConfig","description":"Frozen client-safe legacy config for an environment pub_ key. Server-only rules and overrides are omitted.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Legacy config envelope: appId, env, version, doc, ttlSeconds. Frozen compatibility surface.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FrozenConfigResponse"}}}},"304":{"description":"Authorization-scoped config is unchanged"},"401":{"description":"Missing, wrong-type, or revoked environment bearer. Legacy shape keeps string error plus code/message/resolution.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LegacyConfigAuthError"}}}},"429":{"description":"Monthly config sync quota exceeded"},"503":{"description":"Config sync metering unavailable"}}}},"/api/v1/contract":{"get":{"operationId":"getCapabilityContract","description":"Unauthenticated live capability contract for the control plane.","responses":{"200":{"description":"Machine-readable capability document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CapabilityContractResponse"}}}}}}},"/api/v1/openapi":{"get":{"operationId":"getOpenApiDocument","description":"Unauthenticated OpenAPI 3.1 document. Also published at /openapi.json.","responses":{"200":{"description":"OpenAPI 3.1 JSON document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiDocumentResponse"}}}}}}},"/openapi.json":{"get":{"operationId":"getRootOpenApiDocument","description":"Canonical unauthenticated OpenAPI 3.1 document for agents and clients.","responses":{"200":{"description":"OpenAPI 3.1 JSON document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OpenApiDocumentResponse"}}}}}}},"/api/v1/experiments/power-analysis":{"post":{"operationId":"analyzeExperimentPower","security":[{"BearerAuth":[]}],"description":"Pre-experiment fixed-horizon sample-size and duration planning. Sequential monitoring uses the returned N as its information horizon and does not change a running iteration's method. baselineId loads a versioned snapshot; an inline baseline that disagrees with that snapshot is rejected. Requires cli_ or admin_ and app ownership.","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentPowerAnalysisRequest"}}}},"responses":{"200":{"description":"Required units, duration, assumptions, sensitivity, snapshot source/freshness, and ready|unsupported|invalid reasons","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentPowerAnalysisResponse"}}}},"400":{"description":"Invalid power analysis request"},"401":{"description":"Missing or invalid bearer"},"403":{"description":"Caller cannot access this app"},"404":{"description":"Environment, experiment, or baseline snapshot not found"}}}},"/api/v1/experiments/{id}/baselines":{"get":{"operationId":"listExperimentBaselines","security":[{"BearerAuth":[]}],"description":"Versioned historical baselines for the experiment primary metric in this environment. Each snapshot retains source and freshness. Requires cli_ or admin_ and app ownership.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"env","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned baseline snapshots with source and freshness","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentBaselineListResponse"}}}},"400":{"description":"Invalid query or experiment has no primary metric"},"401":{"description":"Missing or invalid bearer"},"403":{"description":"Caller cannot access this app"},"404":{"description":"Experiment or environment not found"}}},"post":{"operationId":"createExperimentBaseline","security":[{"BearerAuth":[]}],"description":"Create a versioned historical baseline for the experiment primary metric. Source and freshness are retained. Idempotent replay requires the same semantic payload; a reused key with different numbers returns 409.","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentBaselineCreateRequest"}}}},"responses":{"201":{"description":"Created or identically replayed baseline snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentBaselineCreateResponse"}}}},"400":{"description":"Invalid baseline, inverted window, or metric does not match the experiment primary metric"},"401":{"description":"Missing or invalid bearer"},"403":{"description":"Caller cannot access this app"},"404":{"description":"Experiment, environment, or metric not found"},"409":{"description":"Idempotency key reused with a different request"}}}},"/api/v1/experiments/{id}/results":{"get":{"operationId":"getExperimentResult","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"env","in":"query","required":true,"schema":{"type":"string"}},{"name":"iterationId","in":"query","required":true,"schema":{"type":"string"}},{"name":"iterationRevision","in":"query","required":true,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Pinned aggregate, fixed-horizon inference, analysisDecision (not_ready|continue|evidence_qualified), health, freshness, and bounded diagnostics. Sequential evidence_qualified never drives automated rollout."},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Experiment iteration result not found"}},"description":"Get Experiment Result"}},"/api/v1/experiments/{id}/results/recompute":{"post":{"operationId":"recomputeExperimentResult","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["appId","env","iterationId","iterationRevision","analysisEngineVersion","idempotencyKey","confirm"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"iterationId":{"type":"string"},"iterationRevision":{"type":"integer","minimum":1},"analysisEngineVersion":{"type":"string","const":"descriptive-v1"},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"confirm":{"type":"boolean","const":true},"priorWatermark":{"type":"object","additionalProperties":false,"required":["receivedAt","eventId"],"properties":{"receivedAt":{"type":"integer","minimum":0},"eventId":{"type":"string"}}}}}}}},"responses":{"200":{"description":"Idempotent recompute run accepted or replayed"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Unsafe recovery, watermark mismatch, or raw-input gap"}},"description":"Recompute Experiment Result"}},"/api/v1/experiments/{id}/results/runs/{runId}":{"get":{"operationId":"getExperimentAggregationRun","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"runId","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"env","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Aggregation run state, cause, diagnostics, and remediation"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Aggregation run not found"}},"description":"Get Experiment Aggregation Run"}},"/api/v1/insights/query":{"post":{"operationId":"queryFeatureInsights","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["appId","env","from","to","grain","measures"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"grain":{"type":"string","enum":["hour","day"]},"dimensions":{"type":"array","maxItems":3,"items":{"type":"string"}},"measures":{"type":"array","minItems":1,"maxItems":10,"items":{"type":"string"}},"filters":{"type":"object","additionalProperties":false},"format":{"type":"string","enum":["json","csv","ndjson"],"default":"json"},"deadlineAt":{"type":"integer","minimum":1,"description":"Absolute Unix-ms execution deadline. Clamped to the versioned wall-clock budget. Distinct from scan and cardinality bounds."},"cursor":{"type":"string","maxLength":8192,"description":"Opaque server resume token (`ia1_<hex>`). Tenant, key fingerprint, and Convex scan state are stored server-side."}}}}}},"parameters":[{"name":"X-Superflag-Deadline","in":"header","required":false,"schema":{"type":"integer","minimum":1},"description":"Absolute Unix-ms deadline. Combined with body deadlineAt using the earlier instant."}],"responses":{"200":{"description":"Bounded aggregate insight rows with freshness, versions, approximation, query cost, and execution deadline metadata"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"408":{"description":"query_deadline_exceeded: page-boundary stop. error.metadata includes retryable, remediation, cursor, execution (deadline/elapsed/remaining/pages), partial (scan_incomplete, rowsAvailable=false; partial.scannedBuckets is cumulative, same as queryCost.totalScannedBuckets), and queryCost (scannedBuckets this request; resumedScannedBuckets prior; totalScannedBuckets cumulative). Rate quota is charged. No orphaned backend work."},"409":{"description":"insight_cursor_expired: the 15-minute resume TTL elapsed. Start a new query. Distinct from a stolen or mismatched cursor (400 validation_error)."},"429":{"description":"Query cost, cardinality, or per-authority rate limit"}},"description":"Query Feature Insights"}},"/api/v1/insights/events":{"post":{"operationId":"queryInsightEvents","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["appId","env","from","to","kinds"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"kinds":{"type":"array","minItems":1,"maxItems":4,"items":{"type":"string","enum":["decision","assignment","exposure","outcome"]}},"filters":{"type":"object","additionalProperties":false},"limit":{"type":"integer","minimum":1,"maximum":100,"default":100},"cursor":{"type":"string","maxLength":8192,"description":"Opaque server resume token (`ie1_<hex>`). Legacy unprefixed Convex cursors are accepted once for HAPPY-332, then wrapped into a key-bound ie1_ page (scannedEvents starts at 0). Responses never echo the raw Convex cursor. Expired tokens return 409 insight_cursor_expired."},"deadlineAt":{"type":"integer","minimum":1,"description":"Absolute Unix-ms execution deadline. Clamped to the versioned wall-clock budget. Distinct from scan and cardinality bounds."},"format":{"type":"string","enum":["json","csv","ndjson"],"default":"json"}}}}}},"parameters":[{"name":"X-Superflag-Deadline","in":"header","required":false,"schema":{"type":"integer","minimum":1},"description":"Absolute Unix-ms deadline. Combined with body deadlineAt using the earlier instant."}],"responses":{"200":{"description":"Redacted event page with opaque checkpoint, freshness, query cost, and execution deadline metadata"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"408":{"description":"query_deadline_exceeded: page-boundary stop before the next event page. error.metadata includes retryable, remediation, cursor (always a versioned ie1_ token; a legacy unprefixed Convex cursor is accepted once then wrapped into a key-bound page), execution, partial (partial.scannedEvents is cumulative, same as queryCost.totalScannedEvents), and queryCost (scannedEvents this request; resumedScannedEvents prior; totalScannedEvents cumulative). Rate quota is charged. No orphaned backend work."},"409":{"description":"insight_cursor_expired: the 15-minute resume TTL elapsed. Start a new query. Distinct from a stolen or mismatched cursor (400 validation_error)."},"429":{"description":"Per-authority event query rate limit"}},"description":"Query Insight Events"}},"/api/v1/config-versions":{"get":{"operationId":"listConfigVersions","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}}],"responses":{"200":{"description":"Retained configuration versions and current composite state","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigVersionListResponse"}}}},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"List Config Versions"}},"/api/v1/config-versions/{version}":{"get":{"operationId":"getConfigVersion","security":[{"BearerAuth":[]}],"parameters":[{"name":"version","in":"path","required":true,"schema":{"type":"integer","minimum":0}},{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Exact retained configuration snapshot","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigVersionResponse"}}}},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Get Config Version"}},"/api/v1/config-versions/diff":{"get":{"operationId":"diffConfigVersions","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"from","in":"query","required":true,"schema":{"type":"integer","minimum":0}},{"name":"to","in":"query","required":true,"schema":{"type":"integer","minimum":0}}],"responses":{"200":{"description":"Deterministic structured version diff: from/to rollback state, changes, dependencies, visibility","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigVersionDiffResponse"}}}},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Diff Config Versions"}},"/api/v1/rollbacks/plan":{"post":{"operationId":"planRollback","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollbackRequest"}}}},"responses":{"200":{"description":"Deterministic composite rollback plan"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Composite CAS conflict"}},"description":"Plan Rollback"}},"/api/v1/rollbacks/apply":{"post":{"operationId":"applyRollback","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RollbackApplyRequest"}}}},"responses":{"200":{"description":"Atomic audited rollback as new versions"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Plan, idempotency, or composite CAS conflict"}},"description":"Apply Rollback"}},"/api/v1/authority/propose":{"post":{"operationId":"proposeAuthority","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Immutable typed mutation proposal"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Missing propose capability"}},"description":"Propose Authority"}},"/api/v1/authority/approve":{"post":{"operationId":"approveAuthority","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Immutable approval evidence"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Self-approval or missing approve capability"}},"description":"Approve Authority"}},"/api/v1/authority/execute":{"post":{"operationId":"executeAuthority","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Canonical authority receipt"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Conflict, stale proposal, or readback mismatch"}},"description":"Execute Authority"}},"/api/v1/authority/readback":{"post":{"operationId":"readbackAuthority","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Canonical receipt and observation"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Readback Authority"}},"/api/v1/authority/tokens":{"post":{"operationId":"createAuthorityToken","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Scoped CLI capability token"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Create Authority Token"}},"/api/v1/metrics":{"get":{"operationId":"listMetrics","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Environment metric heads"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"List Metrics"},"post":{"operationId":"createMetric","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricCreateRequest"}}}},"responses":{"201":{"description":"Created metric revision"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Key or idempotency conflict"}},"description":"Create Metric"}},"/api/v1/metrics/{id}":{"get":{"operationId":"getMetric","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"revision","in":"query","required":false,"schema":{"type":"integer","minimum":1}}],"responses":{"200":{"description":"Metric head or exact immutable revision"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Metric revision not found"}},"description":"Get Metric"}},"/api/v1/metrics/{id}/revisions":{"get":{"operationId":"listMetricRevisions","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Complete immutable metric revision history"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"List Metric Revisions"},"post":{"operationId":"reviseMetric","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MetricReviseRequest"}}}},"responses":{"200":{"description":"Appended metric revision"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Metric revision CAS conflict"}},"description":"Revise Metric"}},"/api/v1/layers":{"get":{"operationId":"listLayers","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Environment allocation layers"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"List Layers"},"post":{"operationId":"createLayer","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LayerCreateRequest"}}}},"responses":{"200":{"description":"Dry-run plan; no mutation"},"201":{"description":"Created allocation layer"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Key or idempotency conflict"}},"description":"Create Layer"}},"/api/v1/layers/{id}":{"get":{"operationId":"getLayer","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Allocation layer"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Layer not found"}},"description":"Get Layer"},"patch":{"operationId":"updateLayer","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LayerUpdateRequest"}}}},"responses":{"200":{"description":"Updated allocation layer or dry-run plan"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Layer version CAS conflict"}},"description":"Update Layer"}},"/api/v1/holdouts":{"get":{"operationId":"listHoldouts","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Environment selected-feature holdouts"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"List Holdouts"},"post":{"operationId":"createHoldout","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HoldoutCreateRequest"}}}},"responses":{"200":{"description":"Dry-run plan; no mutation"},"201":{"description":"Created feature holdout"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Key or idempotency conflict"}},"description":"Create Holdout"}},"/api/v1/holdouts/{id}":{"get":{"operationId":"getHoldout","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Feature holdout"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Holdout not found"}},"description":"Get Holdout"},"patch":{"operationId":"updateHoldout","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/HoldoutUpdateRequest"}}}},"responses":{"200":{"description":"Updated feature holdout or dry-run plan"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Holdout version CAS conflict"}},"description":"Update Holdout"}},"/api/v1/experiments":{"get":{"operationId":"listExperiments","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"env","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Experiment definitions"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"List Experiments"},"post":{"operationId":"createExperiment","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentCreateRequest"}}}},"responses":{"201":{"description":"Created experiment"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Idempotency or key conflict"}},"description":"Create Experiment"}},"/api/v1/experiments/{id}":{"get":{"operationId":"getExperiment","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"env","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Experiment definition and current iteration"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Get Experiment"},"patch":{"operationId":"updateExperiment","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentMutationRequest"}}}},"responses":{"200":{"description":"Updated experiment"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"CAS conflict"}},"description":"Update Experiment"}},"/api/v1/experiments/{id}/transition":{"post":{"operationId":"transitionExperiment","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentMutationRequest"}}}},"responses":{"200":{"description":"Lifecycle transition"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Transition Experiment"}},"/api/v1/experiments/{id}/ramp":{"post":{"operationId":"rampExperiment","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentMutationRequest"}}}},"responses":{"200":{"description":"Assignment-preserving allocation ramp"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Ramp Experiment"}},"/api/v1/experiments/{id}/iterate":{"post":{"operationId":"iterateExperiment","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ExperimentMutationRequest"}}}},"responses":{"200":{"description":"Paused experiment re-salted into a new running population"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Iterate Experiment"}},"/api/v1/experiments/{id}/rollouts":{"post":{"operationId":"createRolloutPlan","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolloutPlanCreateRequest"}}}},"responses":{"200":{"description":"Dry-run rollout plan preview"},"201":{"description":"Created rollout plan in draft"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Idempotency or plan-id conflict"}},"description":"Create Rollout Plan"}},"/api/v1/experiments/{id}/rollouts/{planId}":{"get":{"operationId":"getRolloutPlan","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"planId","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"env","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Named rollout plan instance"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Get Rollout Plan"}},"/api/v1/experiments/{id}/rollouts/{planId}/transition":{"post":{"operationId":"transitionRolloutPlan","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolloutPlanMutationRequest"}}}},"responses":{"200":{"description":"CAS rollout plan lifecycle transition"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"planVersion CAS conflict"}},"description":"Transition Rollout Plan"}},"/api/v1/experiments/{id}/rollouts/{planId}/recommend":{"post":{"operationId":"recommendRolloutPlan","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolloutPlanMutationRequest"}}}},"responses":{"200":{"description":"Evaluate and optionally persist a recommendation. Persist requires confirm: true. Never mutates allocation."},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"planVersion CAS conflict"}},"description":"Recommend Rollout Plan"}},"/api/v1/experiments/{id}/rollouts/{planId}/approve":{"post":{"operationId":"approveRolloutPlan","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolloutPlanApproveRequest"}}}},"responses":{"200":{"description":"Approve recommend_pause or recommend_rollback. Rollback uses audited CAS restore. invalid_data/stale cannot approve."},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"CAS or recommendation digest conflict"}},"description":"Approve Rollout Plan"}},"/api/v1/events/batch":{"post":{"operationId":"ingestFeatureEvents","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryBatchRequest"}}}},"responses":{"200":{"description":"Ordered per-event ingestion results"},"400":{"description":"Invalid batch envelope"},"401":{"description":"Invalid environment credential"},"413":{"description":"Batch body too large"},"429":{"description":"Ordered partial results with retry guidance"},"503":{"description":"Retryable storage failure"}},"description":"Ingest Feature Events"}},"/api/v1/telemetry/exports":{"get":{"operationId":"listRawTelemetryExportDestinations","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"env","in":"query","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["active","paused","disabled"]}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Signed webhook export destinations"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"List Raw Telemetry Export Destinations"},"post":{"operationId":"createRawTelemetryExportDestination","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RawTelemetryExportCreateRequest"}}}},"responses":{"201":{"description":"Destination created with one-time signing secret"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Idempotency key reused with different semantics"}},"description":"Create Raw Telemetry Export Destination"}},"/api/v1/telemetry/exports/{id}":{"get":{"operationId":"getRawTelemetryExportDestination","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"env","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Destination and health diagnostics"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Get Raw Telemetry Export Destination"},"patch":{"operationId":"updateRawTelemetryExportDestination","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RawTelemetryExportPatchRequest"}}}},"responses":{"200":{"description":"Updated destination"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Destination version conflict"}},"description":"Update Raw Telemetry Export Destination"}},"/api/v1/telemetry/exports/{id}/rotate-secret":{"post":{"operationId":"rotateRawTelemetryExportSecret","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["appId","env","version"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"version":{"type":"integer","minimum":1}}}}}},"responses":{"200":{"description":"Rotated one-time signing secret"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Rotate Raw Telemetry Export Secret"}},"/api/v1/telemetry/exports/{id}/backfills":{"post":{"operationId":"createRawTelemetryExportBackfill","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["appId","env","from","idempotencyKey"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"from":{"type":"string","format":"date-time"},"to":{"type":"string","format":"date-time"},"idempotencyKey":{"type":"string","minLength":16}}}}}},"responses":{"202":{"description":"Bounded retention backfill scheduled"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Create Raw Telemetry Export Backfill"}},"/api/v1/telemetry/exports/{id}/deliveries":{"get":{"operationId":"listRawTelemetryExportDeliveries","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"env","in":"query","required":true,"schema":{"type":"string"}},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","delivering","delivered","failed","expired"]}},{"name":"from","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":100,"default":20}},{"name":"cursor","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Bounded delivery diagnostics"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"List Raw Telemetry Export Deliveries"}},"/api/v1/telemetry/exports/{id}/deliveries/{deliveryId}/retry":{"post":{"operationId":"retryRawTelemetryExportDelivery","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string"}},{"name":"deliveryId","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["appId","env"],"properties":{"appId":{"type":"string"},"env":{"type":"string"}}}}}},"responses":{"202":{"description":"Eligible retained delivery scheduled for retry"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Retry Raw Telemetry Export Delivery"}},"/api/v1/telemetry/erasures":{"post":{"operationId":"requestTelemetrySubjectErasure","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TelemetryErasureRequest"}}}},"responses":{"202":{"description":"Erasure scheduled with an opaque receipt"},"401":{"description":"Invalid management credential"},"403":{"description":"Credential does not own the app"},"503":{"description":"Telemetry identity service unavailable"}},"description":"Request Telemetry Subject Erasure"},"get":{"operationId":"getTelemetrySubjectErasure","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"env","in":"query","required":true,"schema":{"type":"string"}},{"name":"id","in":"query","required":true,"schema":{"type":"string"}}],"responses":{"200":{"description":"Non-identifying erasure status receipt"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Erasure receipt not found"}},"description":"Get Telemetry Subject Erasure"}},"/api/v1/changes":{"get":{"operationId":"listConfigurationAndExperimentChanges","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string"}},{"name":"id","in":"query","schema":{"type":"string"}},{"name":"env","in":"query","schema":{"type":"string"}},{"name":"operation","in":"query","schema":{"type":"string"}},{"name":"source","in":"query","schema":{"type":"string"}},{"name":"resourceType","in":"query","schema":{"type":"string"}},{"name":"resourceId","in":"query","schema":{"type":"string"}},{"name":"authorityType","in":"query","schema":{"type":"string"}},{"name":"userId","in":"query","schema":{"type":"string"}},{"name":"keyFingerprint","in":"query","schema":{"type":"string"}},{"name":"from","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"to","in":"query","schema":{"type":"string","format":"date-time"}},{"name":"limit","in":"query","schema":{"type":"integer","minimum":1,"maximum":200}}],"responses":{"200":{"description":"Filtered append-only change records"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"List Configuration And Experiment Changes"}},"/api/v1/advanced-config":{"get":{"operationId":"getAdvancedConfig","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","schema":{"type":"string"}},{"name":"env","in":"query","schema":{"type":"string"}}],"responses":{"200":{"description":"Versioned core configuration with TTL, privacy, and delivery","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvancedConfigResponse"}}}},"304":{"description":"Authorization-scoped config is unchanged"},"400":{"description":"appId and env must be provided together for management credentials","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing, invalid, or revoked credential"},"403":{"description":"Caller cannot access this app, or a management credential omitted appId/env","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Configuration not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Monthly environment sync quota exceeded"},"500":{"description":"Stored advanced configuration is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Config sync metering unavailable"}},"description":"Get Advanced Config"}},"/api/v1/advanced-config/impact":{"post":{"operationId":"previewAdvancedConfigurationImpact","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AdvancedImpactRequest"}}}},"responses":{"200":{"description":"Deterministic affected flags, dependencies, and visibility impact"},"400":{"description":"Invalid advanced resources"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Preview Advanced Configuration Impact"}},"/api/v1/advanced-config/inspect":{"post":{"operationId":"inspectAdvancedConfiguration","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigInspectionRequest"}}}},"responses":{"200":{"description":"Explicit-time evaluation, segment, dependency, impact, or simulation inspection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigInspectionResponse"}}}},"400":{"description":"Invalid strict inspection request"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Proposed config version conflict"},"413":{"description":"Inspection request exceeds 64 KiB"}},"description":"Inspect Advanced Configuration"}},"/api/v1/cleanup":{"post":{"operationId":"cleanupReadiness","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupRequest"}}}},"responses":{"200":{"description":"Inventory, reconcile, readiness, and staged cleanup plan","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CleanupResponse"}}}},"400":{"description":"Invalid cleanup request"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Forbidden"},"404":{"description":"Environment not found"},"413":{"description":"Cleanup request exceeds 256 KiB"}},"description":"Cleanup Readiness"}},"/api/v1/evaluate":{"post":{"operationId":"evaluateFlag","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoteEvaluationRequest"}}}},"responses":{"200":{"description":"Rich evaluation details with remote origin and fallback class","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RemoteEvaluationResponse"}}}},"400":{"description":"Invalid evaluation request or JSON body","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid bearer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"A server SDK key is required","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"405":{"description":"Wrong method. JSON includes code, message, resolution, and Allow."},"413":{"description":"Request body exceeds 64 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Stored configuration is invalid","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Evaluate Flag"}},"/api/v1/flags/bulk":{"patch":{"operationId":"atomicBulkApply","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkApplyRequest"}}}},"responses":{"200":{"description":"Atomic apply or idempotent replay with version, change id, and replay metadata","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BulkApplyResponse"}}}},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Version or idempotency conflict"}},"description":"Atomic Bulk Apply"}},"/api/ofrep/v1/evaluate/flags/{key}":{"post":{"operationId":"ofrepEvaluateFlag","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"parameters":[{"name":"key","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfrepEvaluationRequest"}}}},"responses":{"200":{"description":"OFREP evaluation success"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Ofrep Evaluate Flag"}},"/api/ofrep/v1/evaluate/flags":{"post":{"operationId":"ofrepEvaluateFlags","security":[{"BearerAuth":[]},{"ApiKeyAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OfrepEvaluationRequest"}}}},"responses":{"200":{"description":"OFREP bulk evaluation success"},"304":{"description":"Not modified"},"401":{"description":"Unauthorized bearer or API key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}},"description":"Ofrep Evaluate Flags"}},"/api":{"get":{"operationId":"getApiDiscovery","description":"Unauthenticated discovery index for the Superflag HTTP API.","responses":{"200":{"description":"Discovery links for docs, OpenAPI, and the CLI","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoveryIndexResponse"}}}}}}},"/api/v1":{"get":{"operationId":"getApiV1Discovery","description":"Unauthenticated v1 discovery index.","responses":{"200":{"description":"Versioned discovery links","content":{"application/json":{"schema":{"$ref":"#/components/schemas/DiscoveryIndexResponse"}}}}}}},"/api/v1/apps":{"get":{"operationId":"listApps","description":"List apps the caller can see. Requires a user-scoped cli_ token. Never returns plaintext secrets.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Strict app and environment DTOs","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppListResponse"}}}},"401":{"description":"Missing bearer or a non-cli_ credential. admin_/sdk_/pub_ cannot list apps.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createApp","description":"Create an app with default environments and keys. One-time secret delivery. Requires a caller-stable idempotency key.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateAppRequest"}}}},"responses":{"201":{"description":"Created app plus one-time environment and admin credentials. Identical idempotent retries can recover the same payload during the delivery window.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/AppCreateResponse"}}}},"400":{"description":"Invalid name, slug, or idempotency key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing bearer or a non-cli_ credential. Only an unscoped cli_ token can create apps.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Referenced app resources were not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Idempotency key reused with different semantics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"App quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/flags":{"get":{"operationId":"listFlags","description":"List legacy flags for one environment.","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Flag DTOs and the current config version","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagListResponse"}}}},"400":{"description":"Missing appId or env","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing bearer, or a credential that is not cli_/admin_. sdk_/pub_ cannot list flags.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Caller cannot access this app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Environment not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"upsertFlag","description":"Create, update, upsert, or toggle one legacy flag. New flags require type and value. Rollout and variants are mutually exclusive.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagPatchRequest"}}}},"responses":{"200":{"description":"Updated flag, version, and change id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagMutationResponse"}}}},"400":{"description":"Invalid flag patch","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing bearer, or a credential that is not cli_/admin_.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Caller cannot access this app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Flag or environment not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Concurrent flag mutation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Flag quota exceeded","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"delete":{"operationId":"deleteFlag","description":"Delete one legacy flag by key.","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"key","in":"query","required":true,"schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"Deleted flag version and change id","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FlagDeleteResponse"}}}},"400":{"description":"Missing appId, env, or key","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing bearer, or a credential that is not cli_/admin_.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Caller cannot access this app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Flag not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/keys":{"get":{"operationId":"listKeys","description":"List key metadata. List responses never contain plaintext secrets.","security":[{"BearerAuth":[]}],"parameters":[{"name":"appId","in":"query","required":true,"schema":{"type":"string","minLength":1,"maxLength":128}},{"name":"env","in":"query","required":false,"schema":{"type":"string","minLength":1,"maxLength":128}}],"responses":{"200":{"description":"Key DTOs without secrets","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyListResponse"}}}},"400":{"description":"Missing appId","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing bearer, or a credential that is not cli_/admin_. sdk_/pub_ cannot list keys.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Caller cannot access this app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Environment not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"post":{"operationId":"createKey","description":"Create an sdk_, pub_, or admin_ key. Requires a caller-stable idempotency key. The plaintext token is returned only in this one-time response.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CreateKeyRequest"}}}},"responses":{"201":{"description":"Created key metadata plus the one-time plaintext token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyCreateResponse"}}}},"400":{"description":"Invalid key request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing bearer, or a credential that is not cli_/admin_.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Caller cannot access this app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"App or environment not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Idempotency key reused with different semantics","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"patch":{"operationId":"revokeKey","description":"Revoke a key by immutable id. Irreversible.","security":[{"BearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokeKeyRequest"}}}},"responses":{"200":{"description":"Revocation timestamp","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyRevokeResponse"}}}},"400":{"description":"Invalid revoke request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing bearer, or a credential that is not cli_/admin_.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Caller cannot access this app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Key not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}},"/api/v1/cli-token":{"post":{"operationId":"authenticateCliPassword","security":[],"description":"Headless signup or login using the existing password provider. Returns a one-time revocable user-scoped cli_ token. Never log the body or response; save the token privately. No cookies or browser callback required.","requestBody":{"required":true,"content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"required":["flow","email","password"],"properties":{"flow":{"type":"string","enum":["signUp","signIn"]},"email":{"type":"string","format":"email","maxLength":254},"password":{"type":"string","minLength":8,"maxLength":256,"writeOnly":true}}}}}},"responses":{"200":{"description":"One-time CLI credential; Cache-Control: no-store","content":{"application/json":{"schema":{"type":"object","required":["apiVersion","token"],"properties":{"apiVersion":{"const":1},"token":{"type":"string","pattern":"^cli_"}}}}}},"400":{"description":"Invalid authentication request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Authentication failed","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Cross-origin request rejected","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"408":{"description":"Authentication timed out; try login after interrupted signup","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"413":{"description":"Body exceeds 4 KiB","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"429":{"description":"Authentication rate limited","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"503":{"description":"Authentication unavailable","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}},"get":{"operationId":"getCliUser","description":"CLI whoami. Requires a cli_ token. Errors use a string `error` field, not the management envelope.","security":[{"BearerAuth":[]}],"responses":{"200":{"description":"Authenticated user id and email","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CliUserResponse"}}}},"401":{"description":"Missing or invalid cli_ token","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CliTokenError"}}}},"403":{"description":"Wrong token type","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CliTokenError"}}}},"404":{"description":"User not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CliTokenError"}}}}}}},"/api/v1/experiments/{id}/recommendation":{"post":{"operationId":"recommendExperimentRollout","description":"Dry-run rollout recommendation for a pinned experiment iteration. Advisory only; does not mutate allocation.","security":[{"BearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolloutRecommendationRequest"}}}},"responses":{"200":{"description":"Typed dry-run recommendation","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RolloutRecommendationResponse"}}}},"400":{"description":"Invalid recommendation request","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"401":{"description":"Missing or invalid bearer","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"403":{"description":"Caller cannot access this app","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"404":{"description":"Experiment iteration result not found","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"409":{"description":"Compare-and-swap or aggregation conflict","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"422":{"description":"This experiment iteration cannot be aggregated","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}},"500":{"description":"Invalid recommendation projection","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiError"}}}}}}}},"components":{"securitySchemes":{"BearerAuth":{"type":"http","scheme":"bearer"},"ApiKeyAuth":{"type":"apiKey","in":"header","name":"X-API-Key"}},"schemas":{"MetricRevisionReference":{"type":"object","additionalProperties":false,"required":["key","revision"],"properties":{"key":{"type":"string","minLength":1,"maxLength":128},"revision":{"type":"integer","minimum":1}}},"MetricDefinition":{"type":"object","additionalProperties":false,"required":["schemaVersion","owner","eventKey","kind","visibility","randomizationUnit","desiredDirection","attributionWindowSeconds","filters"],"properties":{"schemaVersion":{"const":1},"name":{"type":"string","minLength":1,"maxLength":256},"description":{"type":"string","minLength":1,"maxLength":2000},"owner":{"type":"string","minLength":1,"maxLength":256},"eventKey":{"type":"string","minLength":1,"maxLength":128},"kind":{"enum":["conversion","count","sum","mean","ratio"]},"visibility":{"enum":["server","client"]},"randomizationUnit":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"const":"subject"}}},"desiredDirection":{"enum":["increase","decrease"]},"unit":{"type":"string","minLength":1,"maxLength":64},"attributionWindowSeconds":{"type":"integer","minimum":1,"maximum":604800},"filters":{"type":"array","maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["dimension","operator","values"],"properties":{"dimension":{"type":"string","minLength":1,"maxLength":128},"operator":{"enum":["eq","in"]},"values":{"type":"array","minItems":1,"maxItems":20,"items":{"type":["string","number","boolean"]}}}}},"numerator":{"$ref":"#/components/schemas/MetricRevisionReference"},"denominator":{"$ref":"#/components/schemas/MetricRevisionReference"}}},"MetricCreateRequest":{"type":"object","additionalProperties":false,"required":["appId","env","key","definition","idempotencyKey"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"key":{"type":"string"},"definition":{"$ref":"#/components/schemas/MetricDefinition"},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"source":{"enum":["cli","api","agent"],"default":"api"},"reason":{"type":"string","maxLength":1000},"dryRun":{"type":"boolean","default":false}}},"MetricReviseRequest":{"type":"object","additionalProperties":false,"required":["appId","env","metricRevision","definition","idempotencyKey"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"metricRevision":{"type":"integer","minimum":1},"definition":{"$ref":"#/components/schemas/MetricDefinition"},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"source":{"enum":["cli","api","agent"],"default":"api"},"reason":{"type":"string","maxLength":1000},"dryRun":{"type":"boolean","default":false}}},"RawTelemetryExportCreateRequest":{"type":"object","additionalProperties":false,"required":["appId","env","type","url","idempotencyKey"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"type":{"const":"signed_webhook"},"url":{"type":"string","format":"uri"},"filters":{"type":"object","additionalProperties":false},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128}}},"RawTelemetryExportPatchRequest":{"type":"object","additionalProperties":false,"required":["appId","env","version"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"version":{"type":"integer","minimum":1},"status":{"type":"string","enum":["active","paused","disabled"]},"url":{"type":"string","format":"uri"},"filters":{"type":"object","additionalProperties":false}}},"ExperimentMutationRequest":{"type":"object","additionalProperties":true,"required":["appId","env","experimentVersion","idempotencyKey"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"experimentVersion":{"type":"integer","minimum":1},"expectedConfigVersion":{"type":"integer","minimum":0},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"source":{"enum":["cli","api","agent"]},"reason":{"type":"string","maxLength":1000},"dryRun":{"type":"boolean"}}},"RolloutPlanCreateRequest":{"type":"object","additionalProperties":false,"required":["appId","env","experimentId","plan","idempotencyKey"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"experimentId":{"type":"string"},"plan":{"type":"object"},"iterationId":{"type":"string"},"iterationRevision":{"type":"integer","minimum":1},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"dryRun":{"type":"boolean"},"source":{"type":"string","enum":["cli","api","agent"]},"reason":{"type":"string"},"expectedConfigVersion":{"type":"integer","minimum":0}}},"RolloutPlanMutationRequest":{"type":"object","additionalProperties":false,"required":["appId","env","planVersion","idempotencyKey"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"planVersion":{"type":"integer","minimum":1},"transition":{"type":"string","enum":["start","pause","resume","complete"]},"confirm":{"type":"boolean","enum":[true]},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"dryRun":{"type":"boolean"},"source":{"type":"string","enum":["cli","api","agent"]},"reason":{"type":"string"},"expectedConfigVersion":{"type":"integer","minimum":0}}},"RolloutPlanApproveRequest":{"type":"object","additionalProperties":false,"required":["appId","env","planVersion","recommendationDigest","idempotencyKey"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"planVersion":{"type":"integer","minimum":1},"recommendationDigest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"},"confirm":{"type":"boolean","enum":[true]},"rollback":{"type":"object","additionalProperties":false,"required":["source","ifCurrent","planHash"],"properties":{"source":{"$ref":"#/components/schemas/RollbackState"},"ifCurrent":{"$ref":"#/components/schemas/RollbackState"},"planHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"dryRun":{"type":"boolean"},"source":{"type":"string","enum":["cli","api","agent"]},"reason":{"type":"string"},"expectedConfigVersion":{"type":"integer","minimum":0}}},"ExperimentPowerAnalysisRequest":{"type":"object","additionalProperties":false,"required":["appId","env","mde","eligiblePopulation","trafficRatePerDay"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"baseline":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind","rate"],"properties":{"kind":{"const":"conversion"},"rate":{"type":"number"}}},{"type":"object","additionalProperties":false,"required":["kind","mean","variance"],"properties":{"kind":{"const":"mean"},"mean":{"type":"number"},"variance":{"type":"number","minimum":0}}}]},"baselineId":{"type":"string"},"baselineVersion":{"type":"integer","minimum":1},"mde":{"type":"object","additionalProperties":false,"required":["kind","value"],"properties":{"kind":{"type":"string","enum":["absolute","relative"]},"value":{"type":"number"}}},"allocation":{"type":"array","minItems":2,"items":{"$ref":"#/components/schemas/WeightedVariation"}},"alpha":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1},"power":{"type":"number","exclusiveMinimum":0,"exclusiveMaximum":1},"eligiblePopulation":{"type":"number","exclusiveMinimum":0},"trafficRatePerDay":{"type":"number","exclusiveMinimum":0},"experimentId":{"type":"string"}}},"ExperimentPowerAnalysisResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","analysis"],"properties":{"apiVersion":{"const":1},"analysis":{"$ref":"#/components/schemas/ExperimentPowerAnalysis"}}},"ExperimentPowerAnalysis":{"type":"object","additionalProperties":false,"required":["schemaVersion","status","reasonCodes","baseline"],"properties":{"schemaVersion":{"const":1},"status":{"type":"string","enum":["ready","unsupported","invalid"]},"reasonCodes":{"type":"array","items":{"type":"string"}},"requiredUnits":{"type":"integer","minimum":0},"requiredExposures":{"type":"integer","minimum":0},"projectedDurationDays":{"type":["number","null"]},"assumptions":{"type":"array","items":{"type":"object"}},"sensitivity":{"type":"array","items":{"type":"object"}},"baseline":{"type":"object","additionalProperties":false,"required":["input","snapshot"],"properties":{"input":{"type":"object"},"snapshot":{"anyOf":[{"$ref":"#/components/schemas/ExperimentBaselineProvenance"},{"type":"null"}]}}}}},"ExperimentBaselineProvenance":{"type":"object","additionalProperties":false,"required":["id","version","source","freshness"],"properties":{"id":{"type":"string"},"version":{"type":"integer","minimum":1},"source":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"type":"string","enum":["manual","historical_aggregate"]},"note":{"type":"string"}}},"freshness":{"type":"object","additionalProperties":false,"required":["capturedAt"],"properties":{"capturedAt":{"type":"string","format":"date-time"},"observedThrough":{"type":"string","format":"date-time"}}}}},"ExperimentBaselineSnapshot":{"type":"object","additionalProperties":false,"required":["schemaVersion","id","version","metric","baseline","sampleSize","source","freshness","createdAt"],"properties":{"schemaVersion":{"const":1},"id":{"type":"string"},"version":{"type":"integer","minimum":1},"metric":{"$ref":"#/components/schemas/MetricRevisionReference"},"baseline":{"type":"object"},"sampleSize":{"type":"integer","minimum":0},"source":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"type":"string","enum":["manual","historical_aggregate"]},"note":{"type":"string"}}},"window":{"type":"object","additionalProperties":false,"required":["startedAt","endedAt"],"properties":{"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"}}},"freshness":{"type":"object","additionalProperties":false,"required":["capturedAt"],"properties":{"capturedAt":{"type":"string","format":"date-time"},"observedThrough":{"type":"string","format":"date-time"}}},"createdAt":{"type":"string","format":"date-time"}}},"ExperimentBaselineCreateRequest":{"type":"object","additionalProperties":false,"required":["appId","env","metric","baseline","sampleSize","source","idempotencyKey"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"metric":{"$ref":"#/components/schemas/MetricRevisionReference"},"baseline":{"type":"object"},"sampleSize":{"type":"integer","minimum":0},"source":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"type":"string","enum":["manual","historical_aggregate"]},"note":{"type":"string"}}},"window":{"type":"object","additionalProperties":false,"required":["startedAt","endedAt"],"properties":{"startedAt":{"type":"string","format":"date-time"},"endedAt":{"type":"string","format":"date-time"}}},"observedThrough":{"type":"string","format":"date-time"},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128}}},"ExperimentBaselineListResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","baselines"],"properties":{"apiVersion":{"const":1},"baselines":{"type":"array","items":{"$ref":"#/components/schemas/ExperimentBaselineSnapshot"}}}},"ExperimentBaselineCreateResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","snapshot","replayed"],"properties":{"apiVersion":{"const":1},"snapshot":{"$ref":"#/components/schemas/ExperimentBaselineSnapshot"},"replayed":{"type":"boolean"}}},"ExperimentAnalysisDecision":{"type":"object","additionalProperties":false,"required":["method","status","reasonCodes","qualification"],"properties":{"method":{"type":"string","enum":["fixed_horizon","sequential_obrien_fleming_v1"]},"engineVersion":{"type":"string"},"status":{"type":"string","enum":["not_ready","continue","evidence_qualified"]},"reasonCodes":{"type":"array","items":{"type":"string"}},"qualification":{"anyOf":[{"const":"pending_statistical_review"},{"type":"null"}]},"sequential":{"type":["object","null"]}}},"AllocationAssignmentUnit":{"oneOf":[{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"const":"targetingKey"}}},{"type":"object","additionalProperties":false,"required":["kind","attribute"],"properties":{"kind":{"const":"attribute"},"attribute":{"type":"string","minLength":1,"maxLength":128}}}]},"AllocationRange":{"type":"object","additionalProperties":false,"required":["start","end"],"properties":{"start":{"type":"integer","minimum":0,"maximum":99999},"end":{"type":"integer","minimum":1,"maximum":100000}}},"LayerCapacityClaim":{"type":"object","additionalProperties":false,"required":["experimentId","start","end"],"properties":{"experimentId":{"type":"string","minLength":1,"maxLength":128},"start":{"type":"integer","minimum":0,"maximum":99999},"end":{"type":"integer","minimum":1,"maximum":100000}}},"HoldoutSelectedSet":{"type":"object","additionalProperties":false,"required":["flagKeys","experimentIds"],"properties":{"flagKeys":{"type":"array","maxItems":64,"items":{"type":"string","minLength":1,"maxLength":128}},"experimentIds":{"type":"array","maxItems":64,"items":{"type":"string","minLength":1,"maxLength":128}}}},"ExperimentLayerReference":{"type":"object","additionalProperties":false,"required":["id","capacity","migration"],"properties":{"id":{"type":"string","minLength":1,"maxLength":128},"capacity":{"$ref":"#/components/schemas/AllocationRange"},"migration":{"enum":["frozen","reset"]}}},"LayerCreateRequest":{"type":"object","additionalProperties":false,"required":["appId","env","key","salt","assignmentUnit","idempotencyKey"],"properties":{"appId":{"type":"string","minLength":1,"maxLength":128},"env":{"type":"string","minLength":1,"maxLength":128},"key":{"type":"string","minLength":1,"maxLength":128},"salt":{"type":"string","minLength":1,"maxLength":128},"assignmentUnit":{"$ref":"#/components/schemas/AllocationAssignmentUnit"},"claims":{"type":"array","maxItems":64,"items":{"$ref":"#/components/schemas/LayerCapacityClaim"}},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"source":{"enum":["cli","api","agent"],"default":"api"},"reason":{"type":"string","maxLength":1000},"dryRun":{"type":"boolean","default":false}}},"LayerUpdateRequest":{"type":"object","additionalProperties":false,"required":["appId","env","layerVersion","patch","idempotencyKey"],"properties":{"appId":{"type":"string","minLength":1,"maxLength":128},"env":{"type":"string","minLength":1,"maxLength":128},"layerVersion":{"type":"integer","minimum":1},"patch":{"type":"object","additionalProperties":false,"properties":{"claims":{"type":"array","maxItems":64,"items":{"$ref":"#/components/schemas/LayerCapacityClaim"}}}},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"source":{"enum":["cli","api","agent"],"default":"api"},"reason":{"type":"string","maxLength":1000},"dryRun":{"type":"boolean","default":false}}},"HoldoutCreateRequest":{"type":"object","additionalProperties":false,"required":["appId","env","key","salt","assignmentUnit","allocation","selected","idempotencyKey"],"properties":{"appId":{"type":"string","minLength":1,"maxLength":128},"env":{"type":"string","minLength":1,"maxLength":128},"key":{"type":"string","minLength":1,"maxLength":128},"salt":{"type":"string","minLength":1,"maxLength":128},"assignmentUnit":{"$ref":"#/components/schemas/AllocationAssignmentUnit"},"allocation":{"type":"integer","minimum":1,"maximum":100000},"selected":{"$ref":"#/components/schemas/HoldoutSelectedSet"},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"source":{"enum":["cli","api","agent"],"default":"api"},"reason":{"type":"string","maxLength":1000},"dryRun":{"type":"boolean","default":false}}},"HoldoutUpdateRequest":{"type":"object","additionalProperties":false,"required":["appId","env","holdoutVersion","patch","idempotencyKey"],"properties":{"appId":{"type":"string","minLength":1,"maxLength":128},"env":{"type":"string","minLength":1,"maxLength":128},"holdoutVersion":{"type":"integer","minimum":1},"patch":{"type":"object","additionalProperties":false,"properties":{"allocation":{"type":"integer","minimum":1,"maximum":100000},"selected":{"$ref":"#/components/schemas/HoldoutSelectedSet"}}},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"source":{"enum":["cli","api","agent"],"default":"api"},"reason":{"type":"string","maxLength":1000},"dryRun":{"type":"boolean","default":false}}},"ExperimentCreateRequest":{"type":"object","additionalProperties":true,"required":["appId","env","key","hypothesis","owner","flagKey","audience","assignmentUnit","primaryMetric","intendedDurationDays","sampleTarget","allocation","idempotencyKey"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"key":{"type":"string"},"expectedConfigVersion":{"type":"integer","minimum":0},"hypothesis":{"type":"string"},"owner":{"type":"string"},"flagKey":{"type":"string"},"audience":{"type":"object"},"assignmentUnit":{"type":"object"},"primaryMetric":{"type":"object"},"intendedDurationDays":{"type":"integer","minimum":1},"sampleTarget":{"type":"integer","minimum":1},"analysisDesign":{"type":"object","additionalProperties":false,"required":["method"],"properties":{"method":{"type":"string","enum":["fixed_horizon","sequential_obrien_fleming_v1"]}}},"allocation":{"type":"array","minItems":2,"items":{"$ref":"#/components/schemas/WeightedVariation"}},"layer":{"$ref":"#/components/schemas/ExperimentLayerReference"},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"dryRun":{"type":"boolean"}}},"RollbackState":{"type":"object","additionalProperties":false,"required":["configVersion","experiments"],"properties":{"configVersion":{"type":"integer","minimum":0},"experiments":{"type":"array","maxItems":100,"items":{"type":"object","additionalProperties":false,"required":["id","experimentVersion"],"properties":{"id":{"type":"string"},"experimentVersion":{"type":"integer","minimum":1}}}}}},"ConfigVersionSummary":{"type":"object","additionalProperties":false,"required":["configVersion","createdAt","compositeAvailable","current"],"properties":{"configVersion":{"type":"integer","minimum":0},"createdAt":{"type":"string","format":"date-time"},"updatedBy":{"type":"string"},"note":{"type":"string"},"compositeAvailable":{"type":"boolean"},"current":{"type":"boolean"}}},"ExperimentVersionSummary":{"type":"object","additionalProperties":false,"required":["experimentVersion","createdAt","current"],"properties":{"experimentVersion":{"type":"integer","minimum":1},"createdAt":{"type":"string","format":"date-time"},"current":{"type":"boolean"}}},"ConfigVersionListResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","versions","current","experimentVersions"],"properties":{"apiVersion":{"const":1},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ConfigVersionSummary"}},"current":{"$ref":"#/components/schemas/RollbackState"},"experimentVersions":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["id","versions"],"properties":{"id":{"type":"string"},"versions":{"type":"array","items":{"$ref":"#/components/schemas/ExperimentVersionSummary"}}}}}}},"ConfigVersionResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","version"],"properties":{"apiVersion":{"const":1},"version":{"type":"object","additionalProperties":false,"required":["configVersion","envId","state","snapshot","snapshotHash","createdAt"],"properties":{"configVersion":{"type":"integer","minimum":0},"envId":{"type":"string"},"state":{"$ref":"#/components/schemas/RollbackState"},"snapshot":{"type":"object"},"snapshotHash":{"type":"string","pattern":"^[a-f0-9]{64}$"},"createdAt":{"type":"string","format":"date-time"}}}}},"RollbackRequest":{"type":"object","additionalProperties":false,"required":["appId","env","source","ifCurrent","idempotencyKey"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"source":{"$ref":"#/components/schemas/RollbackState"},"ifCurrent":{"$ref":"#/components/schemas/RollbackState"},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"sourceType":{"enum":["cli","api","agent"]},"reason":{"type":"string","maxLength":1000}}},"RollbackApplyRequest":{"type":"object","additionalProperties":false,"required":["appId","env","source","ifCurrent","idempotencyKey","planHash"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"source":{"$ref":"#/components/schemas/RollbackState"},"ifCurrent":{"$ref":"#/components/schemas/RollbackState"},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128},"sourceType":{"enum":["cli","api","agent"]},"reason":{"type":"string","maxLength":1000},"planHash":{"type":"string","pattern":"^[a-f0-9]{64}$"}}},"TelemetryErasureRequest":{"type":"object","additionalProperties":false,"required":["appId","env","namespace","subjectId"],"properties":{"appId":{"type":"string","minLength":1},"env":{"type":"string","minLength":1,"maxLength":63},"namespace":{"type":"string","minLength":1,"maxLength":96},"subjectId":{"type":"string","pattern":"^psn_[A-Za-z0-9_-]{16,96}$"}}},"TelemetryBatchRequest":{"type":"object","additionalProperties":false,"required":["schemaVersion","events"],"properties":{"schemaVersion":{"const":1},"events":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/FeatureEvent"}}}},"FeatureEvent":{"type":"object","additionalProperties":false,"required":["schemaVersion","id","kind","source","flagKey","variation","configVersion","reason","timestamp","sdk","subject"],"properties":{"schemaVersion":{"const":1},"id":{"type":"string","minLength":1,"maxLength":128},"kind":{"type":"string","enum":["decision","assignment","exposure","outcome"]},"source":{"type":"object","additionalProperties":false,"required":["app","environment"],"properties":{"app":{"type":"string","minLength":1,"maxLength":96},"environment":{"type":"string","minLength":1,"maxLength":96}}},"flagKey":{"type":"string"},"variation":{"type":"string"},"configVersion":{"type":"integer","minimum":0},"reason":{"type":"string","enum":["OFF","TARGETING_MATCH","SPLIT","FALLTHROUGH","HOLDBACK","PREREQUISITE_FAILED","SCHEDULED_OUT","DEFAULT"]},"timestamp":{"type":"string","format":"date-time"},"sdk":{"type":"object","additionalProperties":false,"required":["name","version","platform"],"properties":{"name":{"type":"string","minLength":1,"maxLength":96},"version":{"type":"string","minLength":1,"maxLength":96},"platform":{"type":"string","enum":["browser","node","react-native","expo","remote"]}}},"subject":{"type":"object","additionalProperties":false,"required":["id","namespace","revision","state"],"properties":{"id":{"type":"string","pattern":"^psn_[A-Za-z0-9_-]{16,96}$"},"namespace":{"type":"string","minLength":1,"maxLength":96},"revision":{"type":"integer","minimum":1},"state":{"type":"string","enum":["anonymous","authenticated"]}}},"experiment":{"type":"object","additionalProperties":false,"required":["experimentId","iterationId"],"properties":{"experimentId":{"type":"string","minLength":1,"maxLength":128},"iterationId":{"type":"string","minLength":1,"maxLength":128}}},"dimensions":{"type":"object","maxProperties":16,"additionalProperties":{"oneOf":[{"type":"string","maxLength":64},{"type":"number"},{"type":"boolean"}]}},"exposureId":{"type":"string"},"metric":{"type":"object","additionalProperties":false,"required":["key","revision"],"properties":{"key":{"type":"string","minLength":1,"maxLength":96},"revision":{"type":"integer","minimum":1}}},"value":{"oneOf":[{"type":"boolean"},{"type":"number"}]}},"allOf":[{"if":{"properties":{"kind":{"const":"assignment"}}},"then":{"required":["experiment"]}},{"if":{"properties":{"kind":{"const":"outcome"}}},"then":{"required":["exposureId","metric","value"]}}]},"EvaluationContext":{"type":"object","required":["targetingKey"],"properties":{"targetingKey":{"type":"string","minLength":1}},"additionalProperties":true},"RemoteEvaluationRequest":{"type":"object","required":["flagKey","context","defaultValue"],"properties":{"flagKey":{"type":"string","minLength":1},"context":{"type":"object","required":["targetingKey"],"properties":{"targetingKey":{"type":"string","minLength":1},"attributes":{"type":"object","additionalProperties":true}}},"defaultValue":{},"now":{"oneOf":[{"type":"string","format":"date-time"},{"type":"number"}]}}},"OfrepEvaluationRequest":{"type":"object","required":["context"],"properties":{"context":{"$ref":"#/components/schemas/EvaluationContext"}}},"BulkApplyRequest":{"type":"object","required":["appId","env","ifVersion","idempotencyKey"],"properties":{"appId":{"type":"string","minLength":1},"env":{"type":"string","minLength":1},"updates":{"type":"array","maxItems":500},"advancedConfig":{"$ref":"#/components/schemas/AdvancedConfigurationDocument"},"privacy":{"type":"object","properties":{"allowedContextAttributes":{"type":"array","items":{"type":"string"}}}},"ifVersion":{"type":"integer","minimum":0},"idempotencyKey":{"type":"string","minLength":16,"maxLength":128}}},"Schedule":{"type":"object","additionalProperties":false,"properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"}}},"WeightedVariation":{"type":"object","additionalProperties":false,"required":["variation","weight"],"properties":{"variation":{"type":"string","minLength":1},"weight":{"type":"integer","minimum":0,"maximum":100000}}},"Rollout":{"type":"object","additionalProperties":false,"required":["variations"],"properties":{"variations":{"type":"array","minItems":1,"items":{"$ref":"#/components/schemas/WeightedVariation"}},"bucketBy":{"type":"string","minLength":1},"salt":{"type":"string"}}},"Serve":{"oneOf":[{"type":"object","additionalProperties":false,"required":["variation"],"properties":{"variation":{"type":"string","minLength":1}}},{"type":"object","additionalProperties":false,"required":["rollout"],"properties":{"rollout":{"$ref":"#/components/schemas/Rollout"}}},{"type":"object","additionalProperties":false,"required":["progressive"],"properties":{"progressive":{"type":"object","additionalProperties":false,"required":["start","end","from","to"],"properties":{"start":{"type":"string","format":"date-time"},"end":{"type":"string","format":"date-time"},"from":{"$ref":"#/components/schemas/Rollout"},"to":{"$ref":"#/components/schemas/Rollout"}}}}}]},"TargetingExpression":{"type":"object","description":"Recursive all, any, not, match, segment, or flag targeting expression","required":["op"],"properties":{"op":{"type":"string","enum":["all","any","not","match","segment","flag"]},"expressions":{"type":"array","items":{"$ref":"#/components/schemas/TargetingExpression"}},"expression":{"$ref":"#/components/schemas/TargetingExpression"},"attribute":{"type":"string"},"operator":{"type":"string"},"value":{},"segment":{"type":"string"},"flag":{"type":"string"},"equals":{"type":"boolean"},"negate":{"type":"boolean"}}},"AdvancedFlagResource":{"type":"object","additionalProperties":false,"required":["type","description","tags","owner","lifecycle","enabled","variations","offVariation","fallthrough"],"properties":{"type":{"type":"string","enum":["boolean","string","number","object"]},"description":{"type":"string","minLength":1},"tags":{"type":"array","items":{"type":"string"}},"owner":{"type":"string","minLength":1},"lifecycle":{"type":"string","enum":["draft","active","deprecated","archived"]},"enabled":{"type":"boolean"},"variations":{"type":"object","additionalProperties":true},"offVariation":{"type":"string"},"fallthrough":{"$ref":"#/components/schemas/Serve"},"prerequisites":{"type":"array","items":{"type":"object"}},"rules":{"type":"array","items":{"type":"object","required":["id","when","serve"],"properties":{"id":{"type":"string"},"when":{"$ref":"#/components/schemas/TargetingExpression"},"serve":{"$ref":"#/components/schemas/Serve"},"schedule":{"$ref":"#/components/schemas/Schedule"},"unallocated":{"type":"string","enum":["continue","off"],"description":"Absent or continue keeps today's fallthrough. off serves the flag off variation when a valid bucket misses a rollout or progressive allocation."}}}},"schedule":{"$ref":"#/components/schemas/Schedule"},"visibility":{"type":"string","enum":["server","client"]},"metadata":{"type":"object","additionalProperties":true}}},"AdvancedSegmentResource":{"type":"object","additionalProperties":false,"properties":{"included":{"type":"array","items":{"type":"string"}},"excluded":{"type":"array","items":{"type":"string"}},"rules":{"type":"array","items":{"$ref":"#/components/schemas/TargetingExpression"}},"schedule":{"$ref":"#/components/schemas/Schedule"},"visibility":{"type":"string","enum":["server","client"]},"description":{"type":"string"}}},"AdvancedConfigurationDocument":{"type":"object","additionalProperties":false,"required":["schemaVersion","flags"],"properties":{"schemaVersion":{"const":1},"source":{"type":"object","required":["app","environment"],"properties":{"app":{"type":"string"},"environment":{"type":"string"}}},"configVersion":{"type":"integer","minimum":0},"flags":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AdvancedFlagResource"}},"segments":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/AdvancedSegmentResource"}},"metadata":{"type":"object","additionalProperties":true}}},"InspectionJsonValue":{"oneOf":[{"type":"null"},{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"$ref":"#/components/schemas/InspectionJsonValue"}},{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InspectionJsonValue"}}]},"InspectionFallback":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{"$ref":"#/components/schemas/InspectionJsonValue"}},{"type":"object","additionalProperties":{"$ref":"#/components/schemas/InspectionJsonValue"}}]},"InspectionContext":{"type":"object","additionalProperties":false,"required":["targetingKey"],"properties":{"targetingKey":{"type":"string","minLength":1,"maxLength":512},"attributes":{"type":"object","maxProperties":100,"propertyNames":{"minLength":1,"maxLength":128},"additionalProperties":{"$ref":"#/components/schemas/InspectionJsonValue"}}}},"InspectionResource":{"type":"object","additionalProperties":false,"required":["kind","key"],"properties":{"kind":{"enum":["flag","segment"]},"key":{"type":"string","minLength":1,"maxLength":256}}},"InspectionCurrentDocument":{"type":"object","additionalProperties":false,"required":["kind"],"properties":{"kind":{"const":"current"}}},"InspectionProposedDocument":{"type":"object","additionalProperties":false,"required":["kind","advancedConfig","ifVersion"],"properties":{"kind":{"const":"proposed"},"advancedConfig":{"$ref":"#/components/schemas/AdvancedConfigurationDocument"},"ifVersion":{"type":"integer","minimum":0}}},"InspectionDocument":{"oneOf":[{"$ref":"#/components/schemas/InspectionCurrentDocument"},{"$ref":"#/components/schemas/InspectionProposedDocument"}],"discriminator":{"propertyName":"kind"}},"InspectionRequestBase":{"type":"object","required":["schemaVersion","appId","env"],"properties":{"schemaVersion":{"const":1},"appId":{"type":"string","minLength":1,"maxLength":256},"env":{"type":"string","minLength":1,"maxLength":256}}},"ConfigInspectionExplainRequest":{"allOf":[{"$ref":"#/components/schemas/InspectionRequestBase"},{"type":"object","required":["operation","document","flagKey","context","fallback","now"],"properties":{"operation":{"const":"explain"},"document":{"$ref":"#/components/schemas/InspectionDocument"},"flagKey":{"type":"string","minLength":1,"maxLength":256},"context":{"$ref":"#/components/schemas/InspectionContext"},"fallback":{"$ref":"#/components/schemas/InspectionFallback"},"now":{"type":"string","format":"date-time"}}}],"unevaluatedProperties":false},"ConfigInspectionSegmentRequest":{"allOf":[{"$ref":"#/components/schemas/InspectionRequestBase"},{"type":"object","required":["operation","document","segmentId","context","now"],"properties":{"operation":{"const":"segment"},"document":{"$ref":"#/components/schemas/InspectionDocument"},"segmentId":{"type":"string","minLength":1,"maxLength":256},"context":{"$ref":"#/components/schemas/InspectionContext"},"now":{"type":"string","format":"date-time"}}}],"unevaluatedProperties":false},"InspectionPathsRequestBase":{"allOf":[{"$ref":"#/components/schemas/InspectionRequestBase"},{"type":"object","required":["document","resource"],"properties":{"document":{"$ref":"#/components/schemas/InspectionDocument"},"resource":{"$ref":"#/components/schemas/InspectionResource"}}}]},"ConfigInspectionDependenciesRequest":{"allOf":[{"$ref":"#/components/schemas/InspectionPathsRequestBase"},{"type":"object","required":["operation"],"properties":{"operation":{"const":"dependencies"}}}],"unevaluatedProperties":false},"ConfigInspectionImpactsRequest":{"allOf":[{"$ref":"#/components/schemas/InspectionPathsRequestBase"},{"type":"object","required":["operation"],"properties":{"operation":{"const":"impacts"}}}],"unevaluatedProperties":false},"InspectionScenario":{"type":"object","additionalProperties":false,"required":["id","flagKey","context","fallback","now"],"properties":{"id":{"type":"string","minLength":1,"maxLength":256},"flagKey":{"type":"string","minLength":1,"maxLength":256},"context":{"$ref":"#/components/schemas/InspectionContext"},"fallback":{"$ref":"#/components/schemas/InspectionFallback"},"now":{"type":"string","format":"date-time"}}},"ConfigInspectionSimulationRequest":{"allOf":[{"$ref":"#/components/schemas/InspectionRequestBase"},{"type":"object","required":["operation","proposal","scenarios"],"properties":{"operation":{"const":"simulate"},"proposal":{"type":"object","additionalProperties":false,"required":["advancedConfig","ifVersion"],"properties":{"advancedConfig":{"$ref":"#/components/schemas/AdvancedConfigurationDocument"},"ifVersion":{"type":"integer","minimum":0}}},"scenarios":{"type":"array","minItems":1,"maxItems":100,"items":{"$ref":"#/components/schemas/InspectionScenario"}}}}],"unevaluatedProperties":false},"ConfigInspectionRequest":{"oneOf":[{"$ref":"#/components/schemas/ConfigInspectionExplainRequest"},{"$ref":"#/components/schemas/ConfigInspectionSegmentRequest"},{"$ref":"#/components/schemas/ConfigInspectionDependenciesRequest"},{"$ref":"#/components/schemas/ConfigInspectionImpactsRequest"},{"$ref":"#/components/schemas/ConfigInspectionSimulationRequest"}],"discriminator":{"propertyName":"operation"}},"InspectionTarget":{"type":"object","additionalProperties":false,"required":["appId","env","currentVersion"],"properties":{"appId":{"type":"string"},"env":{"type":"string"},"currentVersion":{"type":"integer","minimum":0},"proposedVersion":{"type":"integer","minimum":1}}},"InspectionExplanation":{"type":"object","additionalProperties":false,"required":["schemaVersion","source","configVersion","flagKey","now","stages"],"properties":{"schemaVersion":{"const":1},"source":{"type":"object","additionalProperties":false,"required":["app","environment"],"properties":{"app":{"type":"string"},"environment":{"type":"string"}}},"configVersion":{"type":"integer","minimum":0},"flagKey":{"type":"string"},"now":{"type":"string","format":"date-time"},"stages":{"type":"array","minItems":4,"maxItems":4,"prefixItems":[{"type":"object","properties":{"stage":{"const":"eligibility"}},"required":["stage","eligible","reason","prerequisites"]},{"type":"object","properties":{"stage":{"const":"assignment"}},"required":["stage","attempted","serve"]},{"type":"object","properties":{"stage":{"const":"evaluation"},"details":{"type":"object"}},"required":["stage","details"]},{"type":"object","properties":{"stage":{"const":"exposure-candidate"}},"required":["stage","candidate","flagKey","configVersion","reason"]}]}}},"InspectionSegmentResult":{"type":"object","additionalProperties":false,"required":["segmentId","matched","now","segmentIds"],"properties":{"segmentId":{"type":"string"},"matched":{"type":"boolean"},"now":{"type":"string","format":"date-time"},"segmentIds":{"type":"array","items":{"type":"string"}},"error":{"const":"SEGMENT_NOT_FOUND"},"errorCode":{"type":"string"},"errorMessage":{"type":"string"}}},"InspectionPath":{"type":"object","additionalProperties":false,"required":["resources","relationships"],"properties":{"resources":{"type":"array","items":{"$ref":"#/components/schemas/InspectionResource"}},"relationships":{"type":"array","items":{"enum":["flag_prerequisite","flag_rule","flag_segment","segment_segment"]}}}},"InspectionSimulationResult":{"type":"object","additionalProperties":false,"required":["id","changed","before","after"],"properties":{"id":{"type":"string"},"changed":{"type":"boolean"},"before":{"$ref":"#/components/schemas/InspectionExplanation"},"after":{"$ref":"#/components/schemas/InspectionExplanation"}}},"InspectionResponseBase":{"type":"object","required":["apiVersion","inspectionVersion","target"],"properties":{"apiVersion":{"const":1},"inspectionVersion":{"const":1},"target":{"$ref":"#/components/schemas/InspectionTarget"}}},"ConfigInspectionExplainResponse":{"allOf":[{"$ref":"#/components/schemas/InspectionResponseBase"},{"type":"object","required":["operation","result"],"properties":{"operation":{"const":"explain"},"result":{"$ref":"#/components/schemas/InspectionExplanation"}}}],"unevaluatedProperties":false},"ConfigInspectionSegmentResponse":{"allOf":[{"$ref":"#/components/schemas/InspectionResponseBase"},{"type":"object","required":["operation","result"],"properties":{"operation":{"const":"segment"},"result":{"$ref":"#/components/schemas/InspectionSegmentResult"}}}],"unevaluatedProperties":false},"ConfigInspectionDependenciesResponse":{"allOf":[{"$ref":"#/components/schemas/InspectionResponseBase"},{"type":"object","required":["operation","result"],"properties":{"operation":{"const":"dependencies"},"result":{"type":"array","items":{"$ref":"#/components/schemas/InspectionPath"}}}}],"unevaluatedProperties":false},"ConfigInspectionImpactsResponse":{"allOf":[{"$ref":"#/components/schemas/InspectionResponseBase"},{"type":"object","required":["operation","result"],"properties":{"operation":{"const":"impacts"},"result":{"type":"array","items":{"$ref":"#/components/schemas/InspectionPath"}}}}],"unevaluatedProperties":false},"ConfigInspectionSimulationResponse":{"allOf":[{"$ref":"#/components/schemas/InspectionResponseBase"},{"type":"object","required":["operation","result"],"properties":{"operation":{"const":"simulate"},"result":{"type":"array","items":{"$ref":"#/components/schemas/InspectionSimulationResult"}}}}],"unevaluatedProperties":false},"ConfigInspectionResponse":{"oneOf":[{"$ref":"#/components/schemas/ConfigInspectionExplainResponse"},{"$ref":"#/components/schemas/ConfigInspectionSegmentResponse"},{"$ref":"#/components/schemas/ConfigInspectionDependenciesResponse"},{"$ref":"#/components/schemas/ConfigInspectionImpactsResponse"},{"$ref":"#/components/schemas/ConfigInspectionSimulationResponse"}],"discriminator":{"propertyName":"operation"}},"CleanupRequest":{"type":"object","additionalProperties":false,"required":["appId","environments"],"properties":{"operation":{"type":"string","enum":["inventory","reconcile","readiness","plan"]},"appId":{"type":"string","minLength":1,"maxLength":256},"environments":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"string","minLength":1,"maxLength":256}},"manifests":{"type":"array","items":{"$ref":"#/components/schemas/ConsumerManifest"}},"scans":{"type":"array","items":{"$ref":"#/components/schemas/RepositoryScan"}},"flagKeys":{"type":"array","items":{"type":"string","minLength":1,"maxLength":256}},"now":{"type":"string","format":"date-time"},"evidenceWindowMs":{"type":"integer","minimum":1,"maximum":7776000000}}},"ConsumerManifest":{"type":"object","additionalProperties":false,"required":["schemaVersion","kind","consumer","flags"],"properties":{"schemaVersion":{"const":1},"kind":{"const":"SuperflagConsumerManifest"},"consumer":{"type":"object","additionalProperties":false,"required":["package","repository"],"properties":{"package":{"type":"string"},"repository":{"type":"string"},"commit":{"type":"string"}}},"flags":{"type":"array","items":{"type":"object"}}}},"RepositoryScan":{"type":"object","additionalProperties":false,"required":["schemaVersion","kind","repository","commit","coverage","references","unsupported"],"properties":{"schemaVersion":{"const":1},"kind":{"const":"SuperflagRepositoryScan"},"repository":{"type":"string"},"commit":{"type":"string"},"coverage":{"enum":["complete","partial","unknown"]},"references":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["key","repository","commit","path","line","form"],"properties":{"key":{"type":"string"},"repository":{"type":"string"},"commit":{"type":"string"},"path":{"type":"string"},"line":{"type":"integer","minimum":1},"form":{"enum":["literal","generated"]}}}},"unsupported":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["repository","commit","path","line","reasonCode"],"properties":{"repository":{"type":"string"},"commit":{"type":"string"},"path":{"type":"string"},"line":{"type":"integer","minimum":1},"reasonCode":{"const":"dynamic_key_construction"}}}}}},"CleanupResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","report"],"properties":{"apiVersion":{"const":1},"report":{"$ref":"#/components/schemas/CleanupReport"}}},"CleanupReport":{"type":"object","additionalProperties":false,"required":["schemaVersion","kind","operation","target","now","evidenceWindow","repositories","flags","findings"],"properties":{"schemaVersion":{"const":1},"kind":{"const":"SuperflagCleanupReport"},"operation":{"enum":["inventory","reconcile","readiness","plan"]},"target":{"type":"object"},"now":{"type":"string","format":"date-time"},"evidenceWindow":{"type":"object"},"repositories":{"type":"array","items":{"type":"object"}},"flags":{"type":"array","items":{"type":"object"}},"findings":{"type":"array","items":{"type":"object"}}}},"AdvancedImpactRequest":{"type":"object","additionalProperties":false,"required":["appId","env","advancedConfig"],"properties":{"appId":{"type":"string","minLength":1},"env":{"type":"string","minLength":1},"advancedConfig":{"$ref":"#/components/schemas/AdvancedConfigurationDocument"}}},"ApiError":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"apiVersion":{"type":"integer","const":1},"code":{"type":"string"},"message":{"type":"string"},"resolution":{"type":"string"},"error":{"oneOf":[{"type":"string"},{"type":"object","required":["code","message"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"resolution":{"type":"string"},"retryable":{"type":"boolean"},"metadata":{"type":"object"}}}]}}},"IsoTimestamp":{"type":"string","format":"date-time"},"IdempotencyKey":{"type":"string","minLength":16,"maxLength":128,"pattern":"^[A-Za-z0-9._:-]+$"},"SecretDelivery":{"type":"object","additionalProperties":false,"required":["idempotencyKey","replayed","expiresAt"],"properties":{"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"},"replayed":{"type":"boolean"},"expiresAt":{"$ref":"#/components/schemas/IsoTimestamp"}}},"EnvironmentDto":{"type":"object","additionalProperties":false,"required":["id","appId","slug","createdAt"],"properties":{"id":{"type":"string","minLength":1},"appId":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"createdAt":{"$ref":"#/components/schemas/IsoTimestamp"}}},"AppDto":{"type":"object","additionalProperties":false,"required":["id","name","slug","createdAt","environments"],"properties":{"id":{"type":"string","minLength":1},"name":{"type":"string","minLength":1},"slug":{"type":"string","minLength":1},"createdAt":{"$ref":"#/components/schemas/IsoTimestamp"},"environments":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentDto"}}}},"FlagDto":{"type":"object","additionalProperties":false,"required":["key","type","value","createdAt","updatedAt"],"properties":{"key":{"type":"string","minLength":1},"type":{"enum":["bool","string","number","json"]},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{}},{"type":"object","additionalProperties":true}]},"rollout":{"type":"object","additionalProperties":false,"required":["percentage"],"properties":{"percentage":{"type":"number","minimum":0,"maximum":100}}},"variants":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["value","weight"],"properties":{"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{}},{"type":"object","additionalProperties":true}]},"weight":{"type":"number","minimum":0,"maximum":100},"name":{"type":"string","minLength":1}}}},"clientEnabled":{"type":"boolean"},"createdAt":{"$ref":"#/components/schemas/IsoTimestamp"},"updatedAt":{"$ref":"#/components/schemas/IsoTimestamp"}}},"KeyDto":{"type":"object","additionalProperties":false,"required":["id","appId","environmentId","environmentSlug","type","name","createdAt","revokedAt"],"properties":{"id":{"type":"string","minLength":1},"appId":{"type":"string","minLength":1},"environmentId":{"type":["string","null"]},"environmentSlug":{"type":["string","null"]},"type":{"enum":["sdk","pub","admin"]},"name":{"type":"string","minLength":1},"createdAt":{"$ref":"#/components/schemas/IsoTimestamp"},"revokedAt":{"oneOf":[{"$ref":"#/components/schemas/IsoTimestamp"},{"type":"null"}]}}},"KeyWithOneTimeToken":{"type":"object","additionalProperties":false,"required":["id","appId","environmentId","environmentSlug","type","name","createdAt","revokedAt","token"],"properties":{"id":{"type":"string","minLength":1},"appId":{"type":"string","minLength":1},"environmentId":{"type":["string","null"]},"environmentSlug":{"type":["string","null"]},"type":{"enum":["sdk","pub","admin"]},"name":{"type":"string","minLength":1},"createdAt":{"$ref":"#/components/schemas/IsoTimestamp"},"revokedAt":{"oneOf":[{"$ref":"#/components/schemas/IsoTimestamp"},{"type":"null"}]},"token":{"type":"string","minLength":1,"description":"Plaintext credential. Returned only on create/idempotent replay during the delivery window."}}},"CreateAppRequest":{"type":"object","additionalProperties":false,"required":["name","idempotencyKey"],"properties":{"name":{"type":"string","minLength":1,"maxLength":100},"slug":{"type":"string","minLength":1},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}}},"AppListResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","apps"],"properties":{"apiVersion":{"const":1},"apps":{"type":"array","items":{"$ref":"#/components/schemas/AppDto"}}}},"AppCreateResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","app","environments","keys","delivery"],"properties":{"apiVersion":{"const":1},"app":{"$ref":"#/components/schemas/AppDto"},"environments":{"type":"array","items":{"$ref":"#/components/schemas/EnvironmentDto"}},"keys":{"type":"array","items":{"$ref":"#/components/schemas/KeyWithOneTimeToken"}},"delivery":{"$ref":"#/components/schemas/SecretDelivery"},"message":{"type":"string"}}},"FlagListResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","flags","version"],"properties":{"apiVersion":{"const":1},"flags":{"type":"array","items":{"$ref":"#/components/schemas/FlagDto"}},"version":{"type":"integer","minimum":0}}},"FlagPatchRequest":{"type":"object","additionalProperties":false,"required":["appId","env","key"],"properties":{"appId":{"type":"string","minLength":1},"env":{"type":"string","minLength":1},"key":{"type":"string","minLength":1},"mode":{"enum":["create","update","upsert"],"default":"upsert"},"toggle":{"type":"boolean","default":false},"type":{"enum":["bool","string","number","json"]},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{}},{"type":"object","additionalProperties":true}]},"rollout":{"oneOf":[{"type":"object","additionalProperties":false,"required":["percentage"],"properties":{"percentage":{"type":"number","minimum":0,"maximum":100}}},{"type":"null"}]},"variants":{"oneOf":[{"type":"array","minItems":1,"items":{"type":"object","required":["value","weight"],"properties":{"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{}},{"type":"object","additionalProperties":true}]},"weight":{"type":"number","minimum":0,"maximum":100},"name":{"type":"string"}}}},{"type":"null"}]},"clientEnabled":{"type":["boolean","null"]}}},"FlagMutationResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","success","version","changeId","flag"],"properties":{"apiVersion":{"const":1},"success":{"const":true},"version":{"type":"integer","minimum":0},"changeId":{"type":"string","minLength":1},"flag":{"$ref":"#/components/schemas/FlagDto"}}},"FlagDeleteResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","success","version","changeId"],"properties":{"apiVersion":{"const":1},"success":{"const":true},"version":{"type":"integer","minimum":0},"changeId":{"type":"string","minLength":1}}},"KeyListResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","keys"],"properties":{"apiVersion":{"const":1},"keys":{"type":"array","items":{"$ref":"#/components/schemas/KeyDto"}}}},"CreateKeyRequest":{"type":"object","additionalProperties":false,"required":["appId","type","idempotencyKey"],"properties":{"appId":{"type":"string","minLength":1},"env":{"type":"string","minLength":1},"type":{"enum":["sdk","pub","admin"]},"name":{"type":"string","minLength":1,"maxLength":100},"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"}}},"KeyCreateResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","key","token","delivery"],"properties":{"apiVersion":{"const":1},"key":{"$ref":"#/components/schemas/KeyDto"},"token":{"type":"string","minLength":1,"description":"One-time plaintext credential. Identical idempotent retries can recover it only during the delivery window."},"delivery":{"$ref":"#/components/schemas/SecretDelivery"}}},"RevokeKeyRequest":{"type":"object","additionalProperties":false,"required":["id","revoke"],"properties":{"id":{"type":"string","minLength":1},"revoke":{"const":true}}},"KeyRevokeResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","success","revokedAt"],"properties":{"apiVersion":{"const":1},"success":{"const":true},"revokedAt":{"$ref":"#/components/schemas/IsoTimestamp"}}},"CliUserResponse":{"type":"object","additionalProperties":false,"required":["user"],"properties":{"user":{"type":"object","additionalProperties":false,"required":["id","email"],"properties":{"id":{"type":"string","minLength":1},"email":{"type":"string","minLength":1}}}}},"CliTokenError":{"type":"object","additionalProperties":false,"required":["error"],"properties":{"error":{"type":"string"}}},"DiscoveryIndexResponse":{"type":"object","additionalProperties":false,"required":["name","docs","openapi","contract","cli"],"properties":{"name":{"type":"string"},"docs":{"type":"string","format":"uri"},"openapi":{"const":"/openapi.json"},"contract":{"const":"/api/v1/contract"},"cli":{"const":"@superflag-sh/cli"},"apiVersion":{"const":1}}},"CapabilityContractResponse":{"type":"object","additionalProperties":false,"required":["contractVersion","managementApiVersion","config","bulkApply","changeJournal","experiments","metrics","insights","telemetry","authority","cleanup","evaluation","ofrep","management","artifacts"],"properties":{"contractVersion":{"const":1},"managementApiVersion":{"const":1},"config":{"type":"object","additionalProperties":true,"required":["advancedRoute","impactRoute","inspectionRoute","versionHistoryRoute","versionDiffRoute","rollbackPlanRoute","rollbackApplyRoute"],"properties":{"advancedRoute":{"const":"/api/v1/advanced-config"},"impactRoute":{"const":"/api/v1/advanced-config/impact"},"inspectionRoute":{"const":"/api/v1/advanced-config/inspect"},"versionHistoryRoute":{"const":"/api/v1/config-versions"},"versionDiffRoute":{"const":"/api/v1/config-versions/diff"},"rollbackPlanRoute":{"const":"/api/v1/rollbacks/plan"},"rollbackApplyRoute":{"const":"/api/v1/rollbacks/apply"}}},"bulkApply":{"type":"object","additionalProperties":true,"required":["route","method","atomic","compareAndSwap","idempotency"],"properties":{"route":{"const":"/api/v1/flags/bulk"},"method":{"const":"PATCH"},"atomic":{"const":true},"compareAndSwap":{"type":"object","additionalProperties":true,"required":["supported","requiredField"],"properties":{"supported":{"const":true},"requiredField":{"const":"ifVersion"}}},"idempotency":{"type":"object","additionalProperties":true,"required":["supported","requiredField","callerProvided","replayMetadata"],"properties":{"supported":{"const":true},"requiredField":{"const":"idempotencyKey"},"callerProvided":{"const":true},"replayMetadata":{"const":true}}}}},"changeJournal":{"type":"object","additionalProperties":true,"required":["route"],"properties":{"route":{"const":"/api/v1/changes"}}},"experiments":{"type":"object","additionalProperties":true,"required":["collectionRoute","itemRoute","transitionRoute","rampRoute","iterateRoute","recommendationRoute","resultRoute","recomputeRoute","runRoute","compareAndSwap","idempotency"],"properties":{"collectionRoute":{"const":"/api/v1/experiments"},"itemRoute":{"const":"/api/v1/experiments/{id}"},"transitionRoute":{"const":"/api/v1/experiments/{id}/transition"},"rampRoute":{"const":"/api/v1/experiments/{id}/ramp"},"iterateRoute":{"const":"/api/v1/experiments/{id}/iterate"},"recommendationRoute":{"const":"/api/v1/experiments/{id}/recommendation"},"resultRoute":{"const":"/api/v1/experiments/{id}/results"},"recomputeRoute":{"const":"/api/v1/experiments/{id}/results/recompute"},"runRoute":{"const":"/api/v1/experiments/{id}/results/runs/{runId}"},"compareAndSwap":{"type":"object","additionalProperties":true,"required":["requiredField"],"properties":{"requiredField":{"const":"experimentVersion"}}},"idempotency":{"type":"object","additionalProperties":true,"required":["callerProvided"],"properties":{"callerProvided":{"const":true}}}}},"metrics":{"type":"object","additionalProperties":true,"required":["collectionRoute","itemRoute","revisionsRoute"],"properties":{"collectionRoute":{"const":"/api/v1/metrics"},"itemRoute":{"const":"/api/v1/metrics/{id}"},"revisionsRoute":{"const":"/api/v1/metrics/{id}/revisions"}}},"insights":{"type":"object","additionalProperties":true,"required":["aggregateRoute","eventRoute","auth"],"properties":{"aggregateRoute":{"const":"/api/v1/insights/query"},"eventRoute":{"const":"/api/v1/insights/events"},"auth":{"type":"array","items":{"enum":["cli_bearer","admin_bearer"]}}}},"telemetry":{"type":"object","additionalProperties":true,"required":["route","auth","erasure","rawExport"],"properties":{"route":{"const":"/api/v1/events/batch"},"auth":{"type":"array","items":{"enum":["sdk_bearer","pub_bearer"]}},"erasure":{"type":"object","additionalProperties":true,"required":["route","auth"],"properties":{"route":{"const":"/api/v1/telemetry/erasures"},"auth":{"type":"array","items":{"enum":["cli_bearer","admin_bearer"]}}}},"rawExport":{"type":"object","additionalProperties":true,"required":["collectionRoute","itemRoute","rotateSecretRoute","backfillRoute","deliveriesRoute","retryRoute","auth"],"properties":{"collectionRoute":{"const":"/api/v1/telemetry/exports"},"itemRoute":{"const":"/api/v1/telemetry/exports/{id}"},"rotateSecretRoute":{"const":"/api/v1/telemetry/exports/{id}/rotate-secret"},"backfillRoute":{"const":"/api/v1/telemetry/exports/{id}/backfills"},"deliveriesRoute":{"const":"/api/v1/telemetry/exports/{id}/deliveries"},"retryRoute":{"const":"/api/v1/telemetry/exports/{id}/deliveries/{deliveryId}/retry"},"auth":{"type":"array","items":{"enum":["cli_bearer","admin_bearer"]}}}}}},"authority":{"type":"object","additionalProperties":true,"required":["proposeRoute","approveRoute","executeRoute","readbackRoute","tokenRoute"],"properties":{"proposeRoute":{"const":"/api/v1/authority/propose"},"approveRoute":{"const":"/api/v1/authority/approve"},"executeRoute":{"const":"/api/v1/authority/execute"},"readbackRoute":{"const":"/api/v1/authority/readback"},"tokenRoute":{"const":"/api/v1/authority/tokens"}}},"cleanup":{"type":"object","additionalProperties":true,"required":["route","auth"],"properties":{"route":{"const":"/api/v1/cleanup"},"auth":{"type":"array","items":{"enum":["cli_bearer","admin_bearer"]}}}},"evaluation":{"type":"object","additionalProperties":true,"required":["remoteRoute","auth"],"properties":{"remoteRoute":{"const":"/api/v1/evaluate"},"auth":{"type":"array","items":{"const":"sdk_bearer"}}}},"ofrep":{"type":"object","additionalProperties":true,"required":["singleRoute","bulkRoute","auth"],"properties":{"singleRoute":{"const":"/api/ofrep/v1/evaluate/flags/{key}"},"bulkRoute":{"const":"/api/ofrep/v1/evaluate/flags"},"auth":{"type":"array","items":{"enum":["bearer","x-api-key"]}}}},"management":{"type":"object","additionalProperties":false,"required":["appsRoute","flagsRoute","keysRoute","cliTokenRoute","discoveryRoutes"],"properties":{"appsRoute":{"const":"/api/v1/apps"},"flagsRoute":{"const":"/api/v1/flags"},"keysRoute":{"const":"/api/v1/keys"},"cliTokenRoute":{"const":"/api/v1/cli-token"},"discoveryRoutes":{"type":"array","prefixItems":[{"const":"/api"},{"const":"/api/v1"}],"minItems":2,"maxItems":2}}},"artifacts":{"type":"object","additionalProperties":false,"required":["openapi","openapiJson","contract","discovery"],"properties":{"openapi":{"const":"/api/v1/openapi"},"openapiJson":{"const":"/openapi.json"},"contract":{"const":"/api/v1/contract"},"discovery":{"type":"array","prefixItems":[{"const":"/api"},{"const":"/api/v1"}],"minItems":2,"maxItems":2}}}}},"ConfigVersionChange":{"type":"object","additionalProperties":false,"required":["op","path"],"properties":{"op":{"enum":["add","remove","replace"]},"path":{"type":"string","pattern":"^/"},"before":{},"after":{}}},"ConfigVersionDependencyResource":{"type":"object","additionalProperties":false,"required":["type","id"],"properties":{"type":{"enum":["flag","segment","experiment"]},"id":{"type":"string","minLength":1}}},"ConfigVersionDependency":{"type":"object","additionalProperties":false,"required":["from","to","kind"],"properties":{"from":{"$ref":"#/components/schemas/ConfigVersionDependencyResource"},"to":{"$ref":"#/components/schemas/ConfigVersionDependencyResource"},"kind":{"enum":["flag_prerequisite","flag_rule","flag_segment","segment_segment","assignment","audience"]},"path":{"type":"string","minLength":1}}},"ConfigVersionDiff":{"type":"object","additionalProperties":false,"required":["from","to","changes","dependencies","visibilityImpact"],"properties":{"from":{"$ref":"#/components/schemas/RollbackState"},"to":{"$ref":"#/components/schemas/RollbackState"},"changes":{"type":"array","maxItems":5000,"items":{"$ref":"#/components/schemas/ConfigVersionChange"}},"dependencies":{"type":"array","items":{"$ref":"#/components/schemas/ConfigVersionDependency"}},"visibilityImpact":{"type":"object","additionalProperties":false,"required":["added","removed"],"properties":{"added":{"type":"array","items":{"type":"string"}},"removed":{"type":"array","items":{"type":"string"}}}}}},"ConfigVersionDiffResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","diff"],"properties":{"apiVersion":{"const":1},"diff":{"$ref":"#/components/schemas/ConfigVersionDiff"}}},"BulkApplyReplay":{"type":"object","additionalProperties":false,"required":["idempotencyKey","requestHash","replayed","versionBefore","versionAfter"],"properties":{"idempotencyKey":{"$ref":"#/components/schemas/IdempotencyKey"},"requestHash":{"type":"string","minLength":1},"replayed":{"type":"boolean"},"versionBefore":{"type":"integer","minimum":0},"versionAfter":{"type":"integer","minimum":0}}},"BulkApplyResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","success","updated","version","replay","changeId"],"properties":{"apiVersion":{"const":1},"success":{"const":true},"updated":{"type":"integer","minimum":0},"version":{"type":"integer","minimum":0},"replay":{"$ref":"#/components/schemas/BulkApplyReplay"},"changeId":{"type":"string","minLength":1}}},"OpenApiDocumentResponse":{"type":"object","additionalProperties":true,"required":["openapi","info","paths"],"properties":{"openapi":{"const":"3.1.0"},"info":{"type":"object"},"paths":{"type":"object"}}},"LegacyFlagResource":{"type":"object","additionalProperties":true,"required":["type","value"],"properties":{"type":{"enum":["bool","string","number","json"]},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{}},{"type":"object","additionalProperties":true}]},"rollout":{"type":"object","properties":{"percentage":{"type":"number","minimum":0,"maximum":100}}},"variants":{"type":"array","items":{"type":"object"}},"clientEnabled":{"type":"boolean"}}},"LegacyFlagDocument":{"type":"object","additionalProperties":false,"required":["flags","overrides","rules"],"properties":{"flags":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/LegacyFlagResource"}},"overrides":{"type":"object","additionalProperties":true},"rules":{"type":"object","additionalProperties":true}}},"FrozenConfigResponse":{"type":"object","additionalProperties":false,"required":["appId","env","version","doc","ttlSeconds"],"properties":{"appId":{"type":"string","minLength":1},"env":{"type":"string","minLength":1},"version":{"type":"integer","minimum":0},"doc":{"$ref":"#/components/schemas/LegacyFlagDocument"},"ttlSeconds":{"type":"integer","minimum":0}}},"LegacyConfigAuthError":{"type":"object","additionalProperties":false,"required":["code","message","resolution","error"],"properties":{"code":{"type":"string"},"message":{"type":"string"},"resolution":{"type":"string"},"error":{"type":"string"}}},"AdvancedConfigResponse":{"type":"object","additionalProperties":false,"required":["schemaVersion","config","privacy","delivery","ttlSeconds","migration"],"properties":{"schemaVersion":{"const":1},"config":{"$ref":"#/components/schemas/AdvancedConfigurationDocument"},"privacy":{"type":"object","additionalProperties":false,"required":["allowedContextAttributes"],"properties":{"allowedContextAttributes":{"type":"array","items":{"type":"string"}}}},"delivery":{"enum":["server","client","management"]},"ttlSeconds":{"type":"integer","minimum":0},"migration":{"type":"object","additionalProperties":false,"required":["legacyComposed","storedAdvancedConfig"],"properties":{"legacyComposed":{"const":true},"storedAdvancedConfig":{"type":"boolean"}}}}},"EvaluationDetails":{"type":"object","additionalProperties":false,"required":["flagKey","source","configVersion","value","reason","segmentIds","prerequisites","timestamp"],"properties":{"flagKey":{"type":"string"},"source":{"type":"object","additionalProperties":false,"required":["app","environment"],"properties":{"app":{"type":"string"},"environment":{"type":"string"}}},"configVersion":{"type":"integer","minimum":0},"value":{"oneOf":[{"type":"string"},{"type":"number"},{"type":"boolean"},{"type":"array","items":{}},{"type":"object","additionalProperties":true}]},"variation":{"type":"string"},"reason":{"enum":["OFF","TARGETING_MATCH","SPLIT","FALLTHROUGH","HOLDBACK","PREREQUISITE_FAILED","SCHEDULED_OUT","DEFAULT"]},"errorCode":{"enum":["FLAG_NOT_FOUND","TYPE_MISMATCH","INVALID_CONTEXT","INVALID_CONFIG","CYCLE_DETECTED","EVALUATION_ERROR"]},"errorMessage":{"type":"string"},"ruleId":{"type":"string"},"segmentIds":{"type":"array","items":{"type":"string"}},"prerequisites":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["flagKey","satisfied","reason"],"properties":{"flagKey":{"type":"string"},"variation":{"type":"string"},"satisfied":{"type":"boolean"},"reason":{"enum":["OFF","TARGETING_MATCH","SPLIT","FALLTHROUGH","HOLDBACK","PREREQUISITE_FAILED","SCHEDULED_OUT","DEFAULT"]}}}},"ruleFlags":{"type":"array","items":{"type":"object","additionalProperties":false,"required":["flagKey","equals","matched","reason"],"properties":{"flagKey":{"type":"string"},"equals":{"type":"boolean"},"value":{"type":"boolean"},"matched":{"type":"boolean"},"reason":{"type":"string"},"errorCode":{"type":"string"}}}},"timestamp":{"type":"string","format":"date-time"},"metadata":{"type":"object","additionalProperties":true}}},"RemoteEvaluationResponse":{"type":"object","additionalProperties":false,"required":["schemaVersion","details","evaluationOrigin","fallbackClass","privacy"],"properties":{"schemaVersion":{"const":1},"details":{"$ref":"#/components/schemas/EvaluationDetails"},"evaluationOrigin":{"const":"remote"},"fallbackClass":{"enum":["none","flag_not_found","type_mismatch","invalid_context","invalid_config","cycle_detected","evaluation_error","config_unavailable","unknown"]},"privacy":{"type":"object","additionalProperties":false,"required":["acceptedAttributes"],"properties":{"acceptedAttributes":{"type":"array","items":{"type":"string"}}}}}},"RolloutPlan":{"type":"object","additionalProperties":false,"required":["schemaVersion","id","revision","steps","minimumStepDurationMs","minimumSamplePerVariation","cooldownMs","maximumFreshnessMs","failSafe","metricPolicy"],"properties":{"schemaVersion":{"const":1},"id":{"type":"string","minLength":1,"maxLength":128},"revision":{"type":"integer","minimum":1},"steps":{"type":"array","minItems":1,"maxItems":20,"items":{"type":"object","additionalProperties":false,"required":["id","allocationBasisPoints"],"properties":{"id":{"type":"string"},"allocationBasisPoints":{"type":"integer","minimum":0,"maximum":100000}}}},"minimumStepDurationMs":{"type":"integer","minimum":1},"minimumSamplePerVariation":{"type":"integer","minimum":1},"cooldownMs":{"type":"integer","minimum":0},"maximumFreshnessMs":{"type":"integer","minimum":1},"failSafe":{"const":"hold"},"metricPolicy":{"type":"object","additionalProperties":false,"required":["metricKey","metricRevision","variation","harmfulDirection","pauseThreshold","rollbackThreshold"],"properties":{"metricKey":{"type":"string"},"metricRevision":{"type":"integer","minimum":1},"variation":{"type":"string"},"harmfulDirection":{"enum":["increase","decrease"]},"pauseThreshold":{"type":"number","exclusiveMinimum":0},"rollbackThreshold":{"type":"number","exclusiveMinimum":0}}}}},"RolloutRecommendationRequest":{"type":"object","additionalProperties":false,"required":["appId","env","iterationId","iterationRevision","plan","currentStepId","stepStartedAt","dryRun"],"properties":{"appId":{"type":"string","minLength":1,"maxLength":128},"env":{"type":"string","minLength":1,"maxLength":128},"iterationId":{"type":"string","minLength":1,"maxLength":128},"iterationRevision":{"type":"integer","minimum":1},"plan":{"$ref":"#/components/schemas/RolloutPlan"},"currentStepId":{"type":"string","minLength":1,"maxLength":128},"stepStartedAt":{"type":"string","format":"date-time"},"lastRecommendationAt":{"type":"string","format":"date-time"},"dryRun":{"const":true}}},"RolloutRecommendation":{"type":"object","additionalProperties":false,"required":["schemaVersion","engineVersion","dryRun","action","reasonCode","remediationCode","target","plan","evidence"],"properties":{"schemaVersion":{"const":1},"engineVersion":{"const":"metric-guardrail-v1"},"dryRun":{"const":true},"action":{"enum":["continue","hold","recommend_pause","recommend_rollback","invalid_data"]},"reasonCode":{"enum":["ANALYSIS_INVALID","ANCESTRY_MISMATCH","COOLDOWN_ACTIVE","HEALTH_WARNING","METRIC_REGRESSION_PAUSE","METRIC_REGRESSION_ROLLBACK","NO_REGRESSION","PLAN_STEP_UNKNOWN","RESULT_NOT_READY","RESULT_STALE","SAMPLE_BELOW_MINIMUM","STEP_DURATION_BELOW_MINIMUM"]},"remediationCode":{"type":"string","pattern":"^[a-z][a-z0-9_]*$"},"target":{"type":"object","additionalProperties":false,"required":["appId","env","experimentId","iterationId","iterationRevision"],"properties":{"appId":{"type":"string","minLength":1,"maxLength":128},"env":{"type":"string","minLength":1,"maxLength":128},"experimentId":{"type":"string","minLength":1,"maxLength":128},"iterationId":{"type":"string","minLength":1,"maxLength":128},"iterationRevision":{"type":"integer","minimum":1}}},"plan":{"type":"object","additionalProperties":false,"required":["id","revision","stepId","digest"],"properties":{"id":{"type":"string","minLength":1,"maxLength":128},"revision":{"type":"integer","minimum":1},"stepId":{"type":"string","minLength":1,"maxLength":128},"digest":{"type":"string","pattern":"^sha256:[a-f0-9]{64}$"}}},"evidence":{"type":"object","additionalProperties":false,"required":["evaluatedAt","guards","watermark","freshnessMs","analysis","metric","configVersion","queryCost"],"properties":{"evaluatedAt":{"type":"string","format":"date-time"},"guards":{"type":"object","additionalProperties":false,"required":["stepStartedAt","lastRecommendationAt"],"properties":{"stepStartedAt":{"type":"string","format":"date-time"},"lastRecommendationAt":{"oneOf":[{"type":"string","format":"date-time"},{"type":"null"}]}}},"watermark":{"oneOf":[{"type":"object","additionalProperties":false,"required":["receivedAt","eventId","capturedAt"],"properties":{"receivedAt":{"type":"integer","minimum":0},"eventId":{"type":"string","minLength":1,"maxLength":128},"capturedAt":{"type":"integer","minimum":0}}},{"type":"null"}]},"freshnessMs":{"type":["number","null"],"minimum":0},"analysis":{"type":"object","additionalProperties":false,"required":["aggregationSchemaVersion","aggregationEngineVersion","inferenceSchemaVersion","inferenceEngineVersion","healthStatus","readinessStatus","reasonCodes"],"properties":{"aggregationSchemaVersion":{"oneOf":[{"const":1},{"type":"null"}]},"aggregationEngineVersion":{"oneOf":[{"const":"descriptive-v1"},{"type":"null"}]},"inferenceSchemaVersion":{"oneOf":[{"const":1},{"type":"null"}]},"inferenceEngineVersion":{"oneOf":[{"const":"fixed-horizon-v1"},{"type":"null"}]},"healthStatus":{"oneOf":[{"enum":["healthy","warning","invalid"]},{"type":"null"}]},"readinessStatus":{"oneOf":[{"enum":["ready","collecting","invalid"]},{"type":"null"}]},"reasonCodes":{"type":"array","maxItems":10,"items":{"type":"string"}}}},"metric":{"type":"object","additionalProperties":false,"required":["key","revision","definitionHash","baselineVariation","variation","sampleSize","absoluteEffect","harm"],"properties":{"key":{"type":"string","minLength":1,"maxLength":128},"revision":{"type":"integer","minimum":1},"definitionHash":{"oneOf":[{"type":"string","minLength":1,"maxLength":256},{"type":"null"}]},"baselineVariation":{"oneOf":[{"type":"string","minLength":1,"maxLength":128},{"type":"null"}]},"variation":{"type":"string","minLength":1,"maxLength":128},"sampleSize":{"oneOf":[{"type":"object","additionalProperties":false,"required":["baseline","variation"],"properties":{"baseline":{"type":"integer","minimum":0},"variation":{"type":"integer","minimum":0}}},{"type":"null"}]},"absoluteEffect":{"type":["number","null"]},"harm":{"type":["number","null"]}}},"configVersion":{"type":"object","additionalProperties":false,"required":["result","current"],"properties":{"result":{"type":["integer","null"],"minimum":1},"current":{"type":["integer","null"],"minimum":1}}},"queryCost":{"type":"object","additionalProperties":false,"required":["resultCellsRead","maximumResultCells"],"properties":{"resultCellsRead":{"type":"integer","minimum":0,"maximum":400},"maximumResultCells":{"const":400}}}}}}},"RolloutRecommendationResponse":{"type":"object","additionalProperties":false,"required":["apiVersion","recommendation"],"properties":{"apiVersion":{"const":1},"recommendation":{"$ref":"#/components/schemas/RolloutRecommendation"}}}}}}