{"openapi":"3.1.0","info":{"title":"Slydog management API","version":"1","description":"Everything the Slydog admin UI does, as REST.\n\n**Signing in.** People sign in with GitHub or Google at `/api/auth/sign-in/social`; the session\ncookie then works here, and so does the session token as `Authorization: Bearer …`. A session acts\nin every organization you belong to, with your role (owner, admin, editor or viewer) in each.\nFor CI and scripts, send an API token instead: `Authorization: Bearer sly_tok_…`. A token belongs to\none organization and carries a role.\n\n**Errors.** Every error has the same JSON body, `{ \"status\": 404, \"code\": \"NOT_FOUND\", \"message\": \"…\" }`.\nSwitch on `code`. Invalid rules answer `422 INVALID_RULES` with a `problems` list, and the same problems as\n`issues`, each with the `path` to its field (such as `[\"rules\", 0, \"clauses\", 1, \"values\"]`).\nProtected environments answer `428 CONFIRMATION_REQUIRED` until the change includes `\"confirm\": true`.\nChanges that send `\"expectedVersion\"` answer `409 CONFLICT` when someone else changed the same thing first.\n\n**Approvals.** An organization can require a second person to approve changes to protected\nenvironments. Those changes then answer `202` with a change request; approve it with\n`POST /api/v1/orgs/{org}/requests/{id}/approve`.\n\n**Pagination.** Lists that can grow take `?offset=0&limit=50` (limit at most 200)\nand answer `{ data, offset, limit, hasMore }`. Members, invites and API tokens are paged this way;\na flag's full list and an environment's segments are not (each is read whole by apps, so it's\nbounded by what one ruleset holds), and apps and environments are bounded by the plan. The audit log also answers `next`: pass it as\n`?cursor=` for pages that don't shift while new entries arrive.\n\nThis document is also served as JSON at [/api/v1/openapi.json](/api/v1/openapi.json)."},"paths":{"/api/v1/sign-in":{"get":{"tags":["Sign-in"],"operationId":"signIn.options","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"providers":{"type":"array","items":{"type":"string","enum":["github","google"]}},"mode":{"type":"string","enum":["hosted","self-hosted"]},"signUp":{"type":"string","enum":["open","first-owner","invite-only"]},"connectorSignIn":{"type":"boolean"}},"required":["enabled","providers","mode","signUp"],"additionalProperties":false}}}}},"description":"Needs no credential, so a sign-in page can show the right buttons and say whether signing in makes an account. Sign in with `POST /api/auth/sign-in/social`; when it fails, Better Auth sends the browser back to the page that started it (or its `errorCallbackURL`) with `?error=<code>&error_description=…`. Codes to expect: `SIGN_UP_CLOSED` (Slydog's own: sign-up is invite-only, or this install waits for the owner named in `OWNER_EMAIL`; the description says which), `access_denied` (the person cancelled at GitHub or Google), `state_mismatch` or `please_restart_the_process` (the sign-in expired or was started in another browser: start again), `email_not_found` and `email_not_verified` (the provider gave no verified email), `account_not_linked` (that email already has an account through the other provider), `unable_to_get_user_info`, `invalid_code`, `no_code`, `unable_to_create_user` and `internal_server_error` (try again).","summary":"Whether sign-in is on, and with which providers"}},"/api/v1/origin":{"get":{"tags":["Sign-in"],"operationId":"signIn.origin","parameters":[],"security":[],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"trusted":{"type":"boolean"}},"required":["trusted"],"additionalProperties":false}}}}},"description":"Needs no credential, and any origin can read the answer, so an admin UI on an address missing from `TRUSTED_ORIGINS` can say so instead of looking like the server is down. Reports only on the request's own `Origin` header.","summary":"Whether the calling page's origin is trusted"}},"/api/v1/me":{"get":{"tags":["You"],"operationId":"me.get","parameters":[],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"actor":{"type":"string"},"user":{"anyOf":[{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","email","name","image"],"additionalProperties":false},{"type":"null"}]},"organizations":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["id","slug","name","role"],"additionalProperties":false}},"billing":{"type":"boolean"}},"required":["actor","user","organizations","billing"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}}},"summary":"Who you are, and the organizations you can act in"}},"/api/v1/me/notifications":{"get":{"tags":["You"],"operationId":"me.notifications","parameters":[],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"key":{"anyOf":[{"type":"string","enum":["approvals","flag_lifecycle"]},{"type":"string"}]},"name":{"type":"string"},"description":{"type":"string"},"enabled":{"type":"boolean"},"notifications":{"type":"array","items":{"type":"object","properties":{"key":{"anyOf":[{"type":"string","enum":["approval_requested","approval_decided","flag_review_due","flag_unused"]},{"type":"string"}]},"description":{"type":"string"}},"required":["key","description"],"additionalProperties":false}}},"required":["key","name","description","enabled","notifications"],"additionalProperties":false}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}}},"description":"Emails come in groups you turn on or off together, such as `approvals`: `approval_requested` (someone asked for a change you could approve) and `approval_decided` (a change you asked for was approved or rejected). Needs a signed-in person; an API token has no settings (403).","summary":"List the emails Slydog can send you, by group, and which you get"}},"/api/v1/me/notifications/{group}":{"put":{"tags":["You"],"operationId":"me.updateNotifications","parameters":[{"name":"group","in":"path","schema":{"anyOf":[{"type":"string","enum":["approvals","flag_lifecycle"]},{"type":"string"}]},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"anyOf":[{"type":"string","enum":["approvals","flag_lifecycle"]},{"type":"string"}]},"name":{"type":"string"},"description":{"type":"string"},"enabled":{"type":"boolean"},"notifications":{"type":"array","items":{"type":"object","properties":{"key":{"anyOf":[{"type":"string","enum":["approval_requested","approval_decided","flag_review_due","flag_unused"]},{"type":"string"}]},"description":{"type":"string"}},"required":["key","description"],"additionalProperties":false}}},"required":["key","name","description","enabled","notifications"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Turn a group of emails on or off for yourself","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"}},"required":["enabled"],"additionalProperties":false}}},"required":true}}},"/api/v1/me/apps":{"get":{"tags":["You"],"operationId":"me.apps","parameters":[],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"clientId":{"type":"string"},"name":{"type":"string"},"hosts":{"type":"array","items":{"type":"string"}},"connectedAt":{"type":"string"},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"organizations":{"type":"array","items":{"type":"object","properties":{"slug":{"type":"string"},"name":{"type":"string"},"canChange":{"type":"boolean"}},"required":["slug","name","canChange"],"additionalProperties":false}}},"required":["clientId","name","hosts","connectedAt","lastUsedAt"],"additionalProperties":false}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}}},"description":"Apps such as Claude that you allowed to act as you through the MCP connector, most recently allowed first. Only yours: nobody sees anyone else's. Needs a signed-in person; an API token has none (403).","summary":"List the apps you've connected to your account"}},"/api/v1/me/apps/{clientId}":{"delete":{"tags":["You"],"operationId":"me.disconnectApp","parameters":[{"name":"clientId","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"204":{"description":"<No Content>"},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Takes the app's access away at once: its next request is refused, and it has to ask you again to reconnect. Every organization you belong to records it in its audit log. 404 for an app that isn't yours.","summary":"Disconnect an app from your account"}},"/api/v1/me/apps/{clientId}/orgs/{org}":{"delete":{"tags":["You"],"operationId":"me.disconnectAppFrom","parameters":[{"name":"clientId","in":"path","schema":{"type":"string"},"required":true},{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"204":{"description":"<No Content>"},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"The app keeps its other organizations; its next request there is refused. Taking its last one away disconnects it. That organization records it in its audit log. 404 for an app you didn't allow there.","summary":"Stop an app acting in one of your organizations"}},"/api/v1/orgs":{"get":{"tags":["Organizations"],"operationId":"organizations.list","parameters":[],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["id","slug","name","role"],"additionalProperties":false}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}}},"summary":"List your organizations, with your role in each"}},"/api/v1/orgs/{org}":{"get":{"tags":["Organizations"],"operationId":"organizations.get","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"requireApproval":{"type":"boolean"},"killSwitchSkipsApproval":{"type":"boolean"},"staleAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"connectedAppsCanChange":{"type":"boolean"}},"required":["id","slug","name","role","requireApproval","killSwitchSkipsApproval","staleAfterDays"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Get an organization, its settings, and your role in it"},"patch":{"tags":["Organizations"],"operationId":"organizations.update","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"requireApproval":{"type":"boolean"},"killSwitchSkipsApproval":{"type":"boolean"},"staleAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"connectedAppsCanChange":{"type":"boolean"}},"required":["id","slug","name","role","requireApproval","killSwitchSkipsApproval","staleAfterDays"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"ALREADY_EXISTS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ALREADY_EXISTS"}}}},"429":{"description":"RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RATE_LIMITED"}}}}},"description":"Owners can rename the organization: `name`, and `slug`, after which links with the old slug stop working (the response has the new one). The old slug stays reserved for the organization for 7 days, and the slug can change at most 3 times in 30 days (429 `RATE_LIMITED` past that; the name can still change). `requireApproval` makes changes to protected environments wait for a second person; only owners change it, and it needs sign-in on, since an API token can't approve. `killSwitchSkipsApproval` (on by default) lets switching a flag off apply at once even then; admins and owners change it. `staleAfterDays` (7 to 365, 30 by default) is how many days a flag can go without any app evaluating it before it's stale (`not_evaluated`); admins and owners change it too. `connectedAppsCanChange` lets apps connected through the MCP connector (Claude) change things here, within the person's role; off, they can only read. It's off for new organizations; admins and owners change it.","summary":"Change an organization's settings","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","minLength":1,"maxLength":100},"slug":{"type":"string","minLength":1,"maxLength":64,"description":"A new slug: lowercase letters, digits and '-', starting and ending with a letter or digit, up to 48 characters. The current slug, sent back unchanged, is always accepted."},"requireApproval":{"type":"boolean"},"killSwitchSkipsApproval":{"type":"boolean"},"staleAfterDays":{"type":"integer","minimum":7,"maximum":365},"connectedAppsCanChange":{"type":"boolean"}},"additionalProperties":false}}},"required":true}},"delete":{"tags":["Members"],"operationId":"members.deleteOrganization","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"204":{"description":"<No Content>"},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Owners only. Deletes everything in it: apps, flags, keys, tokens, members, invites and its audit log. Its SDK keys and API tokens stop working at once. Send the organization's name as `confirmName`.","summary":"Delete the organization","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"confirmName":{"type":"string"}},"required":["confirmName"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/usage":{"get":{"tags":["Organizations"],"operationId":"organizations.usage","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"month":{"type":"string"},"mau":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]},"allowed":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]},"overLimit":{"anyOf":[{"type":"object","properties":{"state":{"type":"string","enum":["grace","readOnly"]},"since":{"type":"string"},"mau":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]},"earlierMonthsOver":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]},"graceDays":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]},"graceEndsAt":{"type":"string"}},"required":["state","since","mau","earlierMonthsOver","graceDays","graceEndsAt"],"additionalProperties":false},{"type":"null"}]},"plan":{"type":"string"}},"required":["month","mau","allowed","overLimit","plan"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Against its plan's (`allowed`, null for unlimited). After two months in a row over, `overLimit` says when the grace window ends (`graceEndsAt`) and whether that's passed: then the organization is read-only (`402 PLAN_LIMIT_REACHED`, limit `mau`) until a month ends back under, or it moves to a plan without the limit. Flags keep evaluating either way.","summary":"Get an organization's monthly active users this month"}},"/api/v1/orgs/{org}/apps":{"get":{"tags":["Apps"],"operationId":"apps.list","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"contextKinds":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false}},"createdAt":{"type":"string"}},"required":["id","key","name","contextKinds","createdAt"],"additionalProperties":false}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"List apps"},"post":{"tags":["Apps"],"operationId":"apps.create","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"app":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"contextKinds":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false}},"createdAt":{"type":"string"}},"required":["id","key","name","contextKinds","createdAt"],"additionalProperties":false},"environments":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"protected":{"type":"boolean"},"clonedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"rulesVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","key","name","protected","clonedFrom","expiresAt","rulesVersion"],"additionalProperties":false}}},"required":["app","environments"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"ALREADY_EXISTS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ALREADY_EXISTS"}}}}},"summary":"Create an app, with local, development and production environments","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"name":{"type":"string"},"contextKinds":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false}}},"required":["key","name"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/apps/{app}":{"get":{"tags":["Apps"],"operationId":"apps.get","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"contextKinds":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false}},"createdAt":{"type":"string"}},"required":["id","key","name","contextKinds","createdAt"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Get an app"},"patch":{"tags":["Apps"],"operationId":"apps.update","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"contextKinds":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false}},"createdAt":{"type":"string"}},"required":["id","key","name","contextKinds","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Rename an app, or change the kinds of context its flags target","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","minLength":1,"maxLength":100},"contextKinds":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"name":{"type":"string"}},"required":["key","name"],"additionalProperties":false}}},"additionalProperties":false}}},"required":true}},"delete":{"tags":["Apps"],"operationId":"apps.delete","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"confirm","in":"query","schema":{"type":"string","enum":["true","false"]},"required":false}],"security":[{"bearer":[]}],"responses":{"204":{"description":"<No Content>"},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Deletes the app with its environments, flags, segments and SDK keys; providers using its keys stop getting rules. Needs `?confirm=true`, and is refused while any environment is protected: turn protection off first. The audit log keeps its history.","summary":"Delete an app"}},"/api/v1/orgs/{org}/apps/{app}/environments":{"get":{"tags":["Environments"],"operationId":"environments.list","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"protected":{"type":"boolean"},"clonedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"rulesVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","key","name","protected","clonedFrom","expiresAt","rulesVersion"],"additionalProperties":false}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"List an app's environments"}},"/api/v1/orgs/{org}/apps/{app}/environments/{env}":{"put":{"tags":["Environments"],"operationId":"environments.put","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"env","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"environment":{"type":"object","properties":{"id":{"type":"string"},"key":{"type":"string"},"name":{"type":"string"},"protected":{"type":"boolean"},"clonedFrom":{"anyOf":[{"type":"string"},{"type":"null"}]},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"rulesVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["id","key","name","protected","clonedFrom","expiresAt","rulesVersion"],"additionalProperties":false},"created":{"type":"boolean"},"serverKey":{"anyOf":[{"type":"string"},{"type":"null"}]},"clientKey":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["environment","created","serverKey","clientKey"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"ALREADY_EXISTS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ALREADY_EXISTS"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Safe to call again with the same key (CI retries): the environment is kept. A new environment gets a server and client key. Calling again for one with `ttlSeconds` returns a new pair, which expires with the environment; for one without, the keys are null. Changing an existing protected environment needs `\"confirm\": true`. With `clonedFrom`, flags and segments start as copies of that environment's. With `ttlSeconds`, it's deleted when it expires, in case CI never cleans up; sending it again for an existing environment sets a new expiry from now, so a preview environment that CI puts on every run lives as long as its pull request is active; `\"expires\": false` removes the expiry. Protected environments never expire. With `\"createOnly\": true`, an existing environment is left alone and the call returns 409 ALREADY_EXISTS; with `\"updateOnly\": true`, a missing one isn't created and the call returns 404 NOT_FOUND.","summary":"Create an environment, such as one per pull request","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"clonedFrom":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"ttlSeconds":{"type":"integer","minimum":60,"maximum":7776000},"expires":{"type":"boolean","enum":[false]},"protected":{"type":"boolean"},"confirm":{"type":"boolean"},"createOnly":{"type":"boolean"},"updateOnly":{"type":"boolean"}},"additionalProperties":false}}},"required":true}},"delete":{"tags":["Environments"],"operationId":"environments.delete","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"env","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"204":{"description":"<No Content>"},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Delete an environment and its keys"}},"/api/v1/orgs/{org}/apps/{app}/flags":{"get":{"tags":["Flags"],"operationId":"flags.list","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"archived","in":"query","schema":{"type":"string","enum":["true","false"]},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["boolean","string","number","json"]},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key","value"],"additionalProperties":false}},"offVariation":{"type":"string"},"clientAvailable":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lifecycle":{"type":"string","enum":["active","permanent","ready_for_cleanup"]},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"reviewAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"staleReason":{"anyOf":[{"type":"string","enum":["review_overdue","ready_for_cleanup","not_evaluated"]},{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"environment":{"type":"string"},"enabled":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"variation":{"type":"string"}},"required":["contextKind","values","variation"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","clauses","serve"],"additionalProperties":false}},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string"},"updatedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["environment","enabled","targets","rules","fallthrough","version","updatedAt","updatedBy","updatedByName","lastEvaluatedAt"],"additionalProperties":false}},"usage":{"type":"object","properties":{"staleAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claimable":{"type":"boolean"}},"required":["staleAfterDays","claimable"],"additionalProperties":false}},"required":["key","name","description","type","variations","offVariation","clientAvailable","version","archivedAt","lifecycle","owner","reviewAt","staleReason","lastEvaluatedAt","createdAt","environments","usage"],"additionalProperties":false}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Archived flags are left out; `?archived=true` lists only those.","summary":"List flags with their settings in every environment"},"post":{"tags":["Flags"],"operationId":"flags.create","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["boolean","string","number","json"]},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key","value"],"additionalProperties":false}},"offVariation":{"type":"string"},"clientAvailable":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lifecycle":{"type":"string","enum":["active","permanent","ready_for_cleanup"]},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"reviewAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"staleReason":{"anyOf":[{"type":"string","enum":["review_overdue","ready_for_cleanup","not_evaluated"]},{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"environment":{"type":"string"},"enabled":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"variation":{"type":"string"}},"required":["contextKind","values","variation"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","clauses","serve"],"additionalProperties":false}},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string"},"updatedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["environment","enabled","targets","rules","fallthrough","version","updatedAt","updatedBy","updatedByName","lastEvaluatedAt"],"additionalProperties":false}},"usage":{"type":"object","properties":{"staleAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claimable":{"type":"boolean"}},"required":["staleAfterDays","claimable"],"additionalProperties":false}},"required":["key","name","description","type","variations","offVariation","clientAvailable","version","archivedAt","lifecycle","owner","reviewAt","staleReason","lastEvaluatedAt","createdAt","environments","usage"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"ALREADY_EXISTS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ALREADY_EXISTS"}}}},"422":{"description":"INVALID_RULES","content":{"application/json":{"schema":{"$ref":"#/components/schemas/INVALID_RULES"}}}}},"summary":"Create a flag; it starts off in every environment","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","description":"letters, digits, '-', '_' or '.', up to 64 characters"},"name":{"type":"string","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","minLength":1,"maxLength":100},"description":{"type":"string"},"type":{"type":"string","enum":["boolean","string","number","json"]},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key","value"],"additionalProperties":false}},"offVariation":{"type":"string"},"clientAvailable":{"type":"boolean"},"lifecycle":{"type":"string","enum":["active","permanent","ready_for_cleanup"]},"ownerId":{"anyOf":[{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},{"type":"null"}]},"reviewAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["key","name","type","variations"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/apps/{app}/flag-summaries":{"get":{"tags":["Flags"],"operationId":"flags.summaries","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"offset","in":"query","schema":{"type":"string"},"required":false},{"name":"limit","in":"query","schema":{"type":"string"},"required":false},{"name":"q","in":"query","schema":{"type":"string","maxLength":100},"required":false},{"name":"archived","in":"query","schema":{"type":"string","enum":["true","false"]},"required":false},{"name":"stale","in":"query","schema":{"type":"string","enum":["true","false"]},"required":false},{"name":"owner","in":"query","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":false},{"name":"type","in":"query","schema":{"type":"string","enum":["boolean","string","number","json"]},"required":false},{"name":"clientAvailable","in":"query","schema":{"type":"string","enum":["true","false"]},"required":false},{"name":"env","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":false},{"name":"state","in":"query","schema":{"type":"string","enum":["on","off","changed","differs"]},"required":false},{"name":"sort","in":"query","schema":{"type":"string","enum":["key","name","created","updated","evaluated"]},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"type":{"type":"string","enum":["boolean","string","number","json"]},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key","value"],"additionalProperties":false}},"offVariation":{"type":"string"},"clientAvailable":{"type":"boolean"},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lifecycle":{"type":"string","enum":["active","permanent","ready_for_cleanup"]},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"reviewAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"staleReason":{"anyOf":[{"type":"string","enum":["review_overdue","ready_for_cleanup","not_evaluated"]},{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"environment":{"type":"string"},"enabled":{"type":"boolean"},"targets":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"rules":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string"},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["environment","enabled","targets","rules","fallthrough","version","updatedAt","lastEvaluatedAt"],"additionalProperties":false}}},"required":["key","name","type","variations","offVariation","clientAvailable","archivedAt","lifecycle","owner","reviewAt","staleReason","lastEvaluatedAt","createdAt","environments"],"additionalProperties":false}},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"usage":{"type":"object","properties":{"staleAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claimable":{"type":"boolean"}},"required":["staleAfterDays","claimable"],"additionalProperties":false}},"required":["data","offset","limit","hasMore","total","usage"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"For apps with many flags: each flag's on/off state, default rule and number of targets and rules in every environment, with `total` matching the filters. Sorted by key unless `sort` says otherwise. `q` searches keys, names and descriptions; `type`, `clientAvailable`, `stale`, `owner` and, in an environment (`env`), `state` narrow it further. Archived flags are left out unless `?archived=true`, which lists only those. Each flag and each of its environments has `lastEvaluatedAt`, and `usage` says whether flags no app evaluates can be called stale in this app yet.","summary":"List flags in pages, with counts instead of targets and rules"}},"/api/v1/orgs/{org}/apps/{app}/flag-stats":{"get":{"tags":["Flags"],"operationId":"flags.stats","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"flags":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archived":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"changedThisWeek":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"firstBoolean":{"anyOf":[{"type":"string"},{"type":"null"}]},"environments":{"type":"array","items":{"type":"object","properties":{"environment":{"type":"string"},"on":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["environment","on"],"additionalProperties":false}}},"required":["flags","archived","changedThisWeek","firstBoolean","environments"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Live and archived flags, how many changed in the last 7 days, and how many are on in each environment.","summary":"Count an app's flags without listing them"}},"/api/v1/orgs/{org}/apps/{app}/flags/{flag}":{"get":{"tags":["Flags"],"operationId":"flags.get","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"flag","in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","description":"letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["boolean","string","number","json"]},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key","value"],"additionalProperties":false}},"offVariation":{"type":"string"},"clientAvailable":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lifecycle":{"type":"string","enum":["active","permanent","ready_for_cleanup"]},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"reviewAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"staleReason":{"anyOf":[{"type":"string","enum":["review_overdue","ready_for_cleanup","not_evaluated"]},{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"environment":{"type":"string"},"enabled":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"variation":{"type":"string"}},"required":["contextKind","values","variation"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","clauses","serve"],"additionalProperties":false}},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string"},"updatedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["environment","enabled","targets","rules","fallthrough","version","updatedAt","updatedBy","updatedByName","lastEvaluatedAt"],"additionalProperties":false}},"usage":{"type":"object","properties":{"staleAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claimable":{"type":"boolean"}},"required":["staleAfterDays","claimable"],"additionalProperties":false}},"required":["key","name","description","type","variations","offVariation","clientAvailable","version","archivedAt","lifecycle","owner","reviewAt","staleReason","lastEvaluatedAt","createdAt","environments","usage"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Get a flag with its settings in every environment"},"patch":{"tags":["Flags"],"operationId":"flags.updateDetails","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"flag","in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","description":"letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["boolean","string","number","json"]},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key","value"],"additionalProperties":false}},"offVariation":{"type":"string"},"clientAvailable":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lifecycle":{"type":"string","enum":["active","permanent","ready_for_cleanup"]},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"reviewAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"staleReason":{"anyOf":[{"type":"string","enum":["review_overdue","ready_for_cleanup","not_evaluated"]},{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"environment":{"type":"string"},"enabled":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"variation":{"type":"string"}},"required":["contextKind","values","variation"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","clauses","serve"],"additionalProperties":false}},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string"},"updatedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["environment","enabled","targets","rules","fallthrough","version","updatedAt","updatedBy","updatedByName","lastEvaluatedAt"],"additionalProperties":false}},"usage":{"type":"object","properties":{"staleAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claimable":{"type":"boolean"}},"required":["staleAfterDays","claimable"],"additionalProperties":false}},"required":["key","name","description","type","variations","offVariation","clientAvailable","version","archivedAt","lifecycle","owner","reviewAt","staleReason","lastEvaluatedAt","createdAt","environments","usage"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFLICT"}}}},"422":{"description":"INVALID_RULES","content":{"application/json":{"schema":{"$ref":"#/components/schemas/INVALID_RULES"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Editors can change the name and description. Variations, the off variation and `clientAvailable` change every environment, so they need an admin, and `\"confirm\": true` when any environment is protected. A variation still served anywhere can't be removed: 422 INVALID_RULES says where. Send the flag's `version` as `\"expectedVersion\"` to get 409 CONFLICT instead of overwriting a change made since.","summary":"Change a flag's name, description, variations or availability to clients","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","minLength":1,"maxLength":100},"description":{"type":"string"},"clientAvailable":{"type":"boolean"},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key","value"],"additionalProperties":false}},"offVariation":{"type":"string"},"lifecycle":{"type":"string","enum":["active","permanent","ready_for_cleanup"]},"ownerId":{"anyOf":[{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},{"type":"null"}]},"reviewAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"confirm":{"type":"boolean"},"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"additionalProperties":false}}},"required":true}},"delete":{"tags":["Flags"],"operationId":"flags.delete","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"flag","in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","description":"letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"204":{"description":"<No Content>"},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Only archived flags can be deleted; archive it first. This can't be undone.","summary":"Delete an archived flag"}},"/api/v1/orgs/{org}/apps/{app}/flags/{flag}/archive":{"post":{"tags":["Flags"],"operationId":"flags.archive","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"flag","in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","description":"letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["boolean","string","number","json"]},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key","value"],"additionalProperties":false}},"offVariation":{"type":"string"},"clientAvailable":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lifecycle":{"type":"string","enum":["active","permanent","ready_for_cleanup"]},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"reviewAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"staleReason":{"anyOf":[{"type":"string","enum":["review_overdue","ready_for_cleanup","not_evaluated"]},{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"environment":{"type":"string"},"enabled":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"variation":{"type":"string"}},"required":["contextKind","values","variation"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","clauses","serve"],"additionalProperties":false}},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string"},"updatedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["environment","enabled","targets","rules","fallthrough","version","updatedAt","updatedBy","updatedByName","lastEvaluatedAt"],"additionalProperties":false}},"usage":{"type":"object","properties":{"staleAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claimable":{"type":"boolean"}},"required":["staleAfterDays","claimable"],"additionalProperties":false}},"required":["key","name","description","type","variations","offVariation","clientAvailable","version","archivedAt","lifecycle","owner","reviewAt","staleReason","lastEvaluatedAt","createdAt","environments","usage"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"An archived flag is left out of every environment's rules, so apps still asking for it get their code default. Its settings are kept, and can't be changed (400 VALIDATION_FAILED) until you restore it. Needs `\"confirm\": true` when any environment is protected.","summary":"Archive a flag","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean"}},"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/apps/{app}/flags/{flag}/restore":{"post":{"tags":["Flags"],"operationId":"flags.restore","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"flag","in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","description":"letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["boolean","string","number","json"]},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key","value"],"additionalProperties":false}},"offVariation":{"type":"string"},"clientAvailable":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lifecycle":{"type":"string","enum":["active","permanent","ready_for_cleanup"]},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"reviewAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"staleReason":{"anyOf":[{"type":"string","enum":["review_overdue","ready_for_cleanup","not_evaluated"]},{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"environment":{"type":"string"},"enabled":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"variation":{"type":"string"}},"required":["contextKind","values","variation"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","clauses","serve"],"additionalProperties":false}},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string"},"updatedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["environment","enabled","targets","rules","fallthrough","version","updatedAt","updatedBy","updatedByName","lastEvaluatedAt"],"additionalProperties":false}},"usage":{"type":"object","properties":{"staleAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claimable":{"type":"boolean"}},"required":["staleAfterDays","claimable"],"additionalProperties":false}},"required":["key","name","description","type","variations","offVariation","clientAvailable","version","archivedAt","lifecycle","owner","reviewAt","staleReason","lastEvaluatedAt","createdAt","environments","usage"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"It's served again with the settings it had. Needs `\"confirm\": true` when any environment is protected.","summary":"Restore an archived flag","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean"}},"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/apps/{app}/flags/{flag}/environments/{env}":{"patch":{"tags":["Flags"],"operationId":"flags.update","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"env","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"flag","in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","description":"letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"type":{"type":"string","enum":["boolean","string","number","json"]},"variations":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"value":{}},"required":["key","value"],"additionalProperties":false}},"offVariation":{"type":"string"},"clientAvailable":{"type":"boolean"},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"archivedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lifecycle":{"type":"string","enum":["active","permanent","ready_for_cleanup"]},"owner":{"anyOf":[{"type":"object","properties":{"userId":{"type":"string"},"name":{"type":"string"}},"required":["userId","name"],"additionalProperties":false},{"type":"null"}]},"reviewAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"staleReason":{"anyOf":[{"type":"string","enum":["review_overdue","ready_for_cleanup","not_evaluated"]},{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"environments":{"type":"array","items":{"type":"object","properties":{"environment":{"type":"string"},"enabled":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"variation":{"type":"string"}},"required":["contextKind","values","variation"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","clauses","serve"],"additionalProperties":false}},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string"},"updatedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastEvaluatedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["environment","enabled","targets","rules","fallthrough","version","updatedAt","updatedBy","updatedByName","lastEvaluatedAt"],"additionalProperties":false}},"usage":{"type":"object","properties":{"staleAfterDays":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"claimable":{"type":"boolean"}},"required":["staleAfterDays","claimable"],"additionalProperties":false}},"required":["key","name","description","type","variations","offVariation","clientAvailable","version","archivedAt","lifecycle","owner","reviewAt","staleReason","lastEvaluatedAt","createdAt","environments","usage"],"additionalProperties":false}}}},"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFLICT"}}}},"422":{"description":"INVALID_RULES","content":{"application/json":{"schema":{"$ref":"#/components/schemas/INVALID_RULES"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Turn it on or off, or change targets, rules or the default rule. Switching a flag off is `{ \"enabled\": false }`. Protected environments (production) also need `\"confirm\": true`. Send the `version` you read as `\"expectedVersion\"` to get 409 CONFLICT instead of overwriting a change someone made since. When the organization requires approval, a change to a protected environment answers 202 with the change request instead, and nothing reaches apps until someone else approves it. Switching a flag off applies at once unless the organization turned `killSwitchSkipsApproval` off.","summary":"Change a flag in one environment","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"enabled":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"variation":{"type":"string"}},"required":["contextKind","values","variation"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","clauses","serve"],"additionalProperties":false}},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]},"confirm":{"type":"boolean"},"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/apps/{app}/flags/{flag}/copy":{"post":{"tags":["Flags"],"operationId":"flags.copy","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"flag","in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","description":"letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"before":{"type":"object","properties":{"enabled":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"variation":{"type":"string"}},"required":["contextKind","values","variation"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","clauses","serve"],"additionalProperties":false}},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["enabled","targets","rules","fallthrough"],"additionalProperties":false},"after":{"type":"object","properties":{"enabled":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"variation":{"type":"string"}},"required":["contextKind","values","variation"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","clauses","serve"],"additionalProperties":false}},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["enabled","targets","rules","fallthrough"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"changed":{"type":"boolean"},"applied":{"type":"boolean"},"problems":{"type":"array","items":{"type":"string"}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["before","after","version","changed","applied","problems","issues"],"additionalProperties":false}}}},"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFLICT"}}}},"422":{"description":"INVALID_RULES","content":{"application/json":{"schema":{"$ref":"#/components/schemas/INVALID_RULES"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Copies targets, rules and the default rule, such as from staging to production; whether the flag is on stays as it is. First send `\"dryRun\": true` to see `before` and `after` without saving. Then send the `version` it returned as `\"expectedVersion\"`: if the target changed in between, nothing is saved and the answer is 409 CONFLICT. Copying into a protected environment needs `\"confirm\": true`. Rules that can't work in the target, such as ones using a segment it doesn't have, come back as `problems` with a dry run, and answer 422 INVALID_RULES when saving. When the organization requires approval, a change to a protected environment answers 202 with the change request instead, and nothing reaches apps until someone else approves it.","summary":"Copy a flag's rules from one environment to another","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"to":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"dryRun":{"type":"boolean"},"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"confirm":{"type":"boolean"}},"required":["from","to"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/apps/{app}/environments/{env}/segments":{"get":{"tags":["Segments"],"operationId":"segments.list","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"env","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"included":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["contextKind","values"],"additionalProperties":false}},"excluded":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["contextKind","values"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}}},"required":["id","clauses"],"additionalProperties":false}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string"},"updatedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"usedBy":{"type":"array","items":{"type":"object","properties":{"flag":{"type":"string"},"rules":{"type":"array","items":{"type":"string"}}},"required":["flag","rules"],"additionalProperties":false}}},"required":["key","name","description","included","excluded","rules","version","updatedAt","updatedBy","updatedByName","usedBy"],"additionalProperties":false}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"List an environment's segments"}},"/api/v1/orgs/{org}/apps/{app}/environments/{env}/segments/{segment}":{"put":{"tags":["Segments"],"operationId":"segments.put","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"env","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"segment","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"key":{"type":"string"},"name":{"type":"string"},"description":{"type":"string"},"included":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["contextKind","values"],"additionalProperties":false}},"excluded":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["contextKind","values"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}}},"required":["id","clauses"],"additionalProperties":false}},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"updatedAt":{"type":"string"},"updatedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"updatedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"usedBy":{"type":"array","items":{"type":"object","properties":{"flag":{"type":"string"},"rules":{"type":"array","items":{"type":"string"}}},"required":["flag","rules"],"additionalProperties":false}}},"required":["key","name","description","included","excluded","rules","version","updatedAt","updatedBy","updatedByName","usedBy"],"additionalProperties":false}}}},"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFLICT"}}}},"422":{"description":"INVALID_RULES","content":{"application/json":{"schema":{"$ref":"#/components/schemas/INVALID_RULES"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Protected environments need `\"confirm\": true`. When the organization requires approval, a change to a protected environment answers 202 with the change request instead, and nothing reaches apps until someone else approves it.","summary":"Create or replace a segment","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string","pattern":"^\\S[\\s\\S]*\\S$|^\\S$|^$","minLength":1,"maxLength":100},"description":{"type":"string"},"included":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["contextKind","values"],"additionalProperties":false}},"excluded":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["contextKind","values"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}}},"required":["id","clauses"],"additionalProperties":false}},"confirm":{"type":"boolean"},"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["name"],"additionalProperties":false}}},"required":true}},"delete":{"tags":["Segments"],"operationId":"segments.delete","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"env","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"segment","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"confirm","in":"query","schema":{"type":"string","enum":["true","false"]},"required":false}],"security":[{"bearer":[]}],"responses":{"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}}}},"204":{"description":"<No Content>"},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFLICT"}}}},"422":{"description":"INVALID_RULES","content":{"application/json":{"schema":{"$ref":"#/components/schemas/INVALID_RULES"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Refused with 422 INVALID_RULES while a flag's rules in this environment still use it (archived flags too); `problems` names each flag and rule. Protected environments need `?confirm=true`. When the organization requires approval, a change to a protected environment answers 202 with the change request instead, and nothing reaches apps until someone else approves it.","summary":"Delete a segment"}},"/api/v1/orgs/{org}/apps/{app}/segments/{segment}/copy":{"post":{"tags":["Segments"],"operationId":"segments.copy","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"segment","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"before":{"anyOf":[{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"included":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["contextKind","values"],"additionalProperties":false}},"excluded":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["contextKind","values"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}}},"required":["id","clauses"],"additionalProperties":false}}},"required":["name","description","included","excluded","rules"],"additionalProperties":false},{"type":"null"}]},"after":{"type":"object","properties":{"name":{"type":"string"},"description":{"type":"string"},"included":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["contextKind","values"],"additionalProperties":false}},"excluded":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}}},"required":["contextKind","values"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}}},"required":["id","clauses"],"additionalProperties":false}}},"required":["name","description","included","excluded","rules"],"additionalProperties":false},"version":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"changed":{"type":"boolean"},"applied":{"type":"boolean"},"problems":{"type":"array","items":{"type":"string"}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["before","after","version","changed","applied","problems","issues"],"additionalProperties":false}}}},"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFLICT"}}}},"422":{"description":"INVALID_RULES","content":{"application/json":{"schema":{"$ref":"#/components/schemas/INVALID_RULES"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Creates or replaces the segment in `to` with the one in `from`, such as before copying a flag rule that uses it. Works like copying a flag: send `\"dryRun\": true` first to see `before` (null when `to` doesn't have it) and `after`, then send its `version` as `\"expectedVersion\"` (0 when it didn't exist) to get 409 CONFLICT if the target changed in between. Copying into a protected environment needs `\"confirm\": true`. When the organization requires approval, a change to a protected environment answers 202 with the change request instead, and nothing reaches apps until someone else approves it.","summary":"Copy a segment from one environment to another","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"from":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"to":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"dryRun":{"type":"boolean"},"expectedVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"confirm":{"type":"boolean"}},"required":["from","to"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/apps/{app}/environments/{env}/keys":{"get":{"tags":["SDK keys"],"operationId":"sdkKeys.list","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"env","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"expired","in":"query","schema":{"type":"string","enum":["true","false"]},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["server","client"]},"hint":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","hint","createdAt","expiresAt","lastUsedAt"],"additionalProperties":false}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Keys that stopped working are left out unless you send `?expired=true`. A key still in its grace period is listed, with its `expiresAt`.","summary":"List an environment's SDK keys"},"post":{"tags":["SDK keys"],"operationId":"sdkKeys.create","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"env","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["server","client"]},"hint":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"key":{"type":"string"}},"required":["id","kind","hint","createdAt","expiresAt","lastUsedAt","key"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Make an SDK key; the key is shown this once","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"kind":{"type":"string","enum":["server","client"]}},"required":["kind"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/apps/{app}/environments/{env}/keys/{key}":{"delete":{"tags":["SDK keys"],"operationId":"sdkKeys.expire","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"env","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"key","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true},{"name":"inSeconds","in":"query","schema":{"type":"string"},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["server","client"]},"hint":{"type":"string"},"createdAt":{"type":"string"},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","kind","hint","createdAt","expiresAt","lastUsedAt"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"To rotate a key without downtime: make a new one, move apps to it, then expire the old one, optionally after a grace period.","summary":"Expire an SDK key"}},"/api/v1/orgs/{org}/tokens":{"get":{"tags":["API tokens"],"operationId":"tokens.list","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"offset","in":"query","schema":{"type":"string"},"required":false},{"name":"limit","in":"query","schema":{"type":"string"},"required":false},{"name":"expired","in":"query","schema":{"type":"string","enum":["true","false"]},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"hint":{"type":"string"},"createdBy":{"type":"string"},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["id","name","role","hint","createdBy","createdByName","createdAt","expiresAt","lastUsedAt"],"additionalProperties":false}},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasMore":{"type":"boolean"}},"required":["data","offset","limit","hasMore"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Expired tokens are left out unless you send `?expired=true`.","summary":"List API tokens"},"post":{"tags":["API tokens"],"operationId":"tokens.create","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"hint":{"type":"string"},"createdBy":{"type":"string"},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"expiresAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"token":{"type":"string"}},"required":["id","name","role","hint","createdBy","createdByName","createdAt","expiresAt","lastUsedAt","token"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Make an API token; the token is shown this once","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"expiresInDays":{"type":"integer","minimum":1,"maximum":3650}},"required":["name","role"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/tokens/{id}":{"delete":{"tags":["API tokens"],"operationId":"tokens.revoke","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"204":{"description":"<No Content>"},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Revoke an API token"}},"/api/v1/orgs/{org}/requests":{"get":{"tags":["Change requests"],"operationId":"requests.list","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"offset","in":"query","schema":{"type":"string"},"required":false},{"name":"limit","in":"query","schema":{"type":"string"},"required":false},{"name":"status","in":"query","schema":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"required":false},{"name":"app","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":false},{"name":"environment","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":false},{"name":"resourceType","in":"query","schema":{"type":"string","enum":["flag","segment"]},"required":false},{"name":"resourceKey","in":"query","schema":{"type":"string"},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data","offset","limit","hasMore","total"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"List change requests, newest first"}},"/api/v1/orgs/{org}/requests/{id}":{"get":{"tags":["Change requests"],"operationId":"requests.get","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Get a change request"}},"/api/v1/orgs/{org}/requests/{id}/approve":{"post":{"tags":["Change requests"],"operationId":"requests.approve","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN | CANNOT_APPROVE","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FORBIDDEN"},{"$ref":"#/components/schemas/CANNOT_APPROVE"}]}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"STALE_REQUEST | REQUEST_DECIDED","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/STALE_REQUEST"},{"$ref":"#/components/schemas/REQUEST_DECIDED"}]}}}},"422":{"description":"INVALID_RULES","content":{"application/json":{"schema":{"$ref":"#/components/schemas/INVALID_RULES"}}}}},"description":"Needs a signed-in person other than whoever asked, with a role that could make the change themselves; an API token can't approve (403 CANNOT_APPROVE). If the flag or segment changed since the request was made, nothing is saved and the answer is 409 STALE_REQUEST: whoever asked asks again.","summary":"Approve a change request, applying the change"}},"/api/v1/orgs/{org}/requests/{id}/reject":{"post":{"tags":["Change requests"],"operationId":"requests.reject","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN | CANNOT_APPROVE","content":{"application/json":{"schema":{"anyOf":[{"$ref":"#/components/schemas/FORBIDDEN"},{"$ref":"#/components/schemas/CANNOT_APPROVE"}]}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"REQUEST_DECIDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/REQUEST_DECIDED"}}}}},"summary":"Reject a change request, with an optional reason","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"reason":{"type":"string","maxLength":500}},"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/requests/{id}/cancel":{"post":{"tags":["Change requests"],"operationId":"requests.cancel","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"REQUEST_DECIDED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/REQUEST_DECIDED"}}}}},"summary":"Cancel your own change request"}},"/api/v1/orgs/{org}/apps/{app}/flags/{flag}/environments/{env}/schedules":{"post":{"tags":["Scheduled changes"],"operationId":"schedules.create","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"env","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"flag","in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","description":"letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"change":{},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingFor":{"anyOf":[{"type":"string"},{"type":"null"}]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","change","applyAt","status","requestedBy","requestedByName","approvedBy","approvedByName","error","attempts","waitingFor","appliedAt","createdAt"],"additionalProperties":false}}}},"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFLICT"}}}},"422":{"description":"INVALID_RULES","content":{"application/json":{"schema":{"$ref":"#/components/schemas/INVALID_RULES"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Applies the change at `applyAt` (at most a year ahead, the earliest being the next minute's tick), as you, over the flag's rules as they are then. Protected environments also need `\"confirm\": true`. When the organization requires approval for a change to a protected environment, this answers 202 with a change request instead; once someone else approves it, the change is scheduled. A scheduled change is applied once, however many servers run, and you can pause, resume or cancel it until then. A flag has at most 20 waiting in an environment.","summary":"Schedule a change to a flag in one environment","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"change":{"type":"object","properties":{"enabled":{"type":"boolean"},"targets":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"values":{"type":"array","items":{"type":"string"}},"variation":{"type":"string"}},"required":["contextKind","values","variation"],"additionalProperties":false}},"rules":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"clauses":{"type":"array","items":{"type":"object","properties":{"contextKind":{"type":"string"},"attribute":{"type":"string"},"op":{"type":"string","enum":["in","startsWith","endsWith","contains","matches","lessThan","lessThanOrEqual","greaterThan","greaterThanOrEqual","segmentMatch"]},"values":{"type":"array"},"negate":{"type":"boolean"}},"required":["contextKind","attribute","op","values"],"additionalProperties":false}},"serve":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"required":["id","clauses","serve"],"additionalProperties":false}},"fallthrough":{"anyOf":[{"type":"object","properties":{"variation":{"type":"string"}},"required":["variation"],"additionalProperties":false},{"type":"object","properties":{"rollout":{"type":"object","properties":{"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"object","properties":{"variation":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["variation","weight"],"additionalProperties":false}}},"required":["contextKind","variations"],"additionalProperties":false}},"required":["rollout"],"additionalProperties":false}]}},"additionalProperties":false},"applyAt":{"type":"string"},"confirm":{"type":"boolean"}},"required":["change","applyAt"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/scheduled-changes":{"get":{"tags":["Scheduled changes"],"operationId":"schedules.list","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"offset","in":"query","schema":{"type":"string"},"required":false},{"name":"limit","in":"query","schema":{"type":"string"},"required":false},{"name":"status","in":"query","schema":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"required":false},{"name":"app","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":false},{"name":"environment","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":false},{"name":"flag","in":"query","schema":{"type":"string"},"required":false},{"name":"order","in":"query","schema":{"type":"string","enum":["asc","desc"]},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"change":{},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingFor":{"anyOf":[{"type":"string"},{"type":"null"}]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","change","applyAt","status","requestedBy","requestedByName","approvedBy","approvedByName","error","attempts","waitingFor","appliedAt","createdAt"],"additionalProperties":false}},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data","offset","limit","hasMore","total"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"List scheduled changes, soonest first"}},"/api/v1/orgs/{org}/scheduled-changes/{id}":{"get":{"tags":["Scheduled changes"],"operationId":"schedules.get","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"change":{},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingFor":{"anyOf":[{"type":"string"},{"type":"null"}]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","change","applyAt","status","requestedBy","requestedByName","approvedBy","approvedByName","error","attempts","waitingFor","appliedAt","createdAt"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Get a scheduled change"}},"/api/v1/orgs/{org}/scheduled-changes/{id}/pause":{"post":{"tags":["Scheduled changes"],"operationId":"schedules.pause","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"change":{},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingFor":{"anyOf":[{"type":"string"},{"type":"null"}]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","change","applyAt","status","requestedBy","requestedByName","approvedBy","approvedByName","error","attempts","waitingFor","appliedAt","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"It's held, and not applied, until resumed or cancelled.","summary":"Pause a scheduled change"}},"/api/v1/orgs/{org}/scheduled-changes/{id}/resume":{"post":{"tags":["Scheduled changes"],"operationId":"schedules.resume","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"change":{},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingFor":{"anyOf":[{"type":"string"},{"type":"null"}]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","change","applyAt","status","requestedBy","requestedByName","approvedBy","approvedByName","error","attempts","waitingFor","appliedAt","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Re-arms a change, so a protected environment (production) needs `\"confirm\": true`, as scheduling it did. Refused (400) when its time has passed while it was paused: cancel it and schedule again.","summary":"Resume a paused scheduled change","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean"}},"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/scheduled-changes/{id}/cancel":{"post":{"tags":["Scheduled changes"],"operationId":"schedules.cancel","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"change":{},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]},"attempts":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"waitingFor":{"anyOf":[{"type":"string"},{"type":"null"}]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","change","applyAt","status","requestedBy","requestedByName","approvedBy","approvedByName","error","attempts","waitingFor","appliedAt","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Cancel a scheduled change that hasn't been applied"}},"/api/v1/orgs/{org}/apps/{app}/flags/{flag}/environments/{env}/ramps":{"post":{"tags":["Ramps"],"operationId":"ramps.create","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"app","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"env","in":"path","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":true},{"name":"flag","in":"path","schema":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9._-]{0,63}$","description":"letters, digits, '-', '_' or '.', up to 64 characters"},"required":true}],"security":[{"bearer":[]}],"responses":{"201":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"rule":{"anyOf":[{"type":"string"},{"type":"null"}]},"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"string"}},"ramp":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","cancelled","failed"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"stepsApplied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"share":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["step","weight","applyAt","status","appliedAt","error"],"additionalProperties":false}},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","rule","contextKind","variations","ramp","status","reason","stepsApplied","share","steps","requestedBy","requestedByName","approvedBy","approvedByName","createdAt"],"additionalProperties":false}}}},"202":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"kind":{"type":"string","enum":["flag_rules","segment_save","segment_delete"]},"resourceType":{"type":"string","enum":["flag","segment"]},"resourceKey":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"action":{"type":"string"},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"baseVersion":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"stale":{"type":"boolean"},"status":{"type":"string","enum":["pending","approved","rejected","cancelled"]},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"requestedByPerson":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"decidedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"applyAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"ramp":{"anyOf":[{},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","kind","resourceType","resourceKey","app","environment","action","before","after","baseVersion","stale","status","requestedBy","requestedByName","requestedByPerson","decidedBy","decidedByName","decidedAt","reason","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"CONFLICT","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFLICT"}}}},"422":{"description":"INVALID_RULES","content":{"application/json":{"schema":{"$ref":"#/components/schemas/INVALID_RULES"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Each step sets the rollout's two variations to the step's weight and the rest, at the step's time, as you. Users already on the climbing variation stay on it: the variations keep their order and the context kind stays the same. A step changes only that rollout, and only while it's what the ramp last set; if someone changes it, turns the flag off or deletes the rule, the ramp pauses and says why. One ramp at a time per flag per environment. Protected environments also need `\"confirm\": true`; when the organization requires approval there, this answers 202 with a change request for the whole ramp, and approving it starts the ramp. Approved after its first step's time, it starts then, and every step moves on by as long, so the gaps between them stay as planned.","summary":"Start a ramp: a rollout that climbs on a timetable","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"rule":{"type":"string"},"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"string"}},"ramp":{"type":"string"},"steps":{"type":"array","items":{"type":"object","properties":{"applyAt":{"type":"string"},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["applyAt","weight"],"additionalProperties":false}},"confirm":{"type":"boolean"}},"required":["contextKind","variations","ramp","steps"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/ramps":{"get":{"tags":["Ramps"],"operationId":"ramps.list","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"offset","in":"query","schema":{"type":"string"},"required":false},{"name":"limit","in":"query","schema":{"type":"string"},"required":false},{"name":"status","in":"query","schema":{"type":"string","enum":["active","paused","completed","cancelled","failed"]},"required":false},{"name":"app","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":false},{"name":"environment","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":false},{"name":"flag","in":"query","schema":{"type":"string"},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"rule":{"anyOf":[{"type":"string"},{"type":"null"}]},"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"string"}},"ramp":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","cancelled","failed"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"stepsApplied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"share":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["step","weight","applyAt","status","appliedAt","error"],"additionalProperties":false}},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","rule","contextKind","variations","ramp","status","reason","stepsApplied","share","steps","requestedBy","requestedByName","approvedBy","approvedByName","createdAt"],"additionalProperties":false}},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data","offset","limit","hasMore","total"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"List ramps, newest first"}},"/api/v1/orgs/{org}/ramps/{id}":{"get":{"tags":["Ramps"],"operationId":"ramps.get","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"rule":{"anyOf":[{"type":"string"},{"type":"null"}]},"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"string"}},"ramp":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","cancelled","failed"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"stepsApplied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"share":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["step","weight","applyAt","status","appliedAt","error"],"additionalProperties":false}},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","rule","contextKind","variations","ramp","status","reason","stepsApplied","share","steps","requestedBy","requestedByName","approvedBy","approvedByName","createdAt"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Get a ramp and its steps"}},"/api/v1/orgs/{org}/ramps/{id}/pause":{"post":{"tags":["Ramps"],"operationId":"ramps.pause","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"rule":{"anyOf":[{"type":"string"},{"type":"null"}]},"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"string"}},"ramp":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","cancelled","failed"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"stepsApplied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"share":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["step","weight","applyAt","status","appliedAt","error"],"additionalProperties":false}},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","rule","contextKind","variations","ramp","status","reason","stepsApplied","share","steps","requestedBy","requestedByName","approvedBy","approvedByName","createdAt"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Pause a ramp: no more steps until it's resumed (one that isn't going is returned as it is)"}},"/api/v1/orgs/{org}/ramps/{id}/resume":{"post":{"tags":["Ramps"],"operationId":"ramps.resume","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"rule":{"anyOf":[{"type":"string"},{"type":"null"}]},"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"string"}},"ramp":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","cancelled","failed"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"stepsApplied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"share":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["step","weight","applyAt","status","appliedAt","error"],"additionalProperties":false}},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","rule","contextKind","variations","ramp","status","reason","stepsApplied","share","steps","requestedBy","requestedByName","approvedBy","approvedByName","createdAt"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"428":{"description":"CONFIRMATION_REQUIRED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CONFIRMATION_REQUIRED"}}}}},"description":"Goes on from the rollout as it is now: steps at or below its current share are skipped, and the rest move on by as long as the ramp was paused. Refused while the rollout no longer has the ramp's shape (other variations, order or context kind) or the flag is off. A ramp not paused is returned as it is. Protected environments need `\"confirm\": true`.","summary":"Resume a paused ramp","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"confirm":{"type":"boolean"}},"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/ramps/{id}/cancel":{"post":{"tags":["Ramps"],"operationId":"ramps.cancel","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"app":{"type":"string"},"environment":{"type":"string"},"flag":{"type":"string"},"rule":{"anyOf":[{"type":"string"},{"type":"null"}]},"contextKind":{"type":"string"},"variations":{"type":"array","items":{"type":"string"}},"ramp":{"type":"string"},"status":{"type":"string","enum":["active","paused","completed","cancelled","failed"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]},"stepsApplied":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"share":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"steps":{"type":"array","items":{"type":"object","properties":{"step":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"weight":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"applyAt":{"type":"string"},"status":{"type":"string","enum":["scheduled","paused","applied","failed","cancelled"]},"appliedAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"error":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["step","weight","applyAt","status","appliedAt","error"],"additionalProperties":false}},"requestedBy":{"type":"string"},"requestedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedBy":{"anyOf":[{"type":"string"},{"type":"null"}]},"approvedByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"}},"required":["id","app","environment","flag","rule","contextKind","variations","ramp","status","reason","stepsApplied","share","steps","requestedBy","requestedByName","approvedBy","approvedByName","createdAt"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Cancel a ramp; the rollout stays where it is (one already over is returned as it is)"}},"/api/v1/orgs/{org}/members":{"get":{"tags":["Members"],"operationId":"members.list","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"offset","in":"query","schema":{"type":"string"},"required":false},{"name":"limit","in":"query","schema":{"type":"string"},"required":false},{"name":"q","in":"query","schema":{"type":"string","maxLength":100},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"joinedAt":{"type":"string"}},"required":["userId","email","name","image","role","joinedAt"],"additionalProperties":false}},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"total":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"owners":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991}},"required":["data","offset","limit","hasMore","total","owners"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"A page at a time, oldest member first. `?q=` keeps members whose email or name contains it.","summary":"List the organization's members and their roles"}},"/api/v1/orgs/{org}/members/{userId}":{"patch":{"tags":["Members"],"operationId":"members.changeRole","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"userId","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string"},"email":{"type":"string"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"image":{"anyOf":[{"type":"string"},{"type":"null"}]},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"joinedAt":{"type":"string"}},"required":["userId","email","name","image","role","joinedAt"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"LAST_OWNER","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LAST_OWNER"}}}}},"description":"Admins can't change an owner's role or make anyone an owner. Demoting the only owner answers `409 LAST_OWNER`.","summary":"Change someone's role","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["role"],"additionalProperties":false}}},"required":true}},"delete":{"tags":["Members"],"operationId":"members.remove","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"userId","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"204":{"description":"<No Content>"},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"LAST_OWNER","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LAST_OWNER"}}}}},"description":"Removing yourself is leaving, which any role can do. The only owner can't leave or be removed (`409 LAST_OWNER`): transfer ownership first. Admins can't remove owners.","summary":"Remove someone, or leave"}},"/api/v1/orgs/{org}/invites":{"get":{"tags":["Members"],"operationId":"members.listInvites","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"offset","in":"query","schema":{"type":"string"},"required":false},{"name":"limit","in":"query","schema":{"type":"string"},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"createdBy":{"type":"string"},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"expired":{"type":"boolean"}},"required":["id","email","role","createdBy","createdByName","createdAt","expiresAt","expired"],"additionalProperties":false}},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasMore":{"type":"boolean"}},"required":["data","offset","limit","hasMore"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"List pending invites, including expired ones"},"post":{"tags":["Members"],"operationId":"members.invite","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]},"createdBy":{"type":"string"},"createdByName":{"anyOf":[{"type":"string"},{"type":"null"}]},"createdAt":{"type":"string"},"expiresAt":{"type":"string"},"expired":{"type":"boolean"},"url":{"type":"string"},"emailSent":{"type":"boolean"}},"required":["id","email","role","createdBy","createdByName","createdAt","expiresAt","expired","url","emailSent"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"ALREADY_EXISTS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ALREADY_EXISTS"}}}},"429":{"description":"RATE_LIMITED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RATE_LIMITED"}}}}},"description":"Emails a link that works once, for 7 days, for whoever signs in with that email. The link is also in the answer (`url`), shown this once; `emailSent` says whether the email was queued, and `GET /orgs/:org/invites/:id/email` whether it then went out. Inviting the same email again replaces their pending invite. Admins can invite any role but owner. An organization can send 50 invites a day (`429 RATE_LIMITED` after that). The link stops working if whoever sent it is removed, loses the role to give it, or (for an API token) is revoked.","summary":"Invite someone by email, with a role","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"email":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["email","role"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/invites/{id}/email":{"get":{"tags":["Members"],"operationId":"members.inviteEmail","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"status":{"type":"string","enum":["queued","sent","failed","unknown"]},"reason":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","reason"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Emails are sent in the background and retried for about 10 minutes, so a new invite's starts `queued`. Ask again until it's `sent` or `failed`; when `failed`, share the invite's link yourself.","summary":"Whether an invite's email went out"}},"/api/v1/orgs/{org}/invites/{id}":{"delete":{"tags":["Members"],"operationId":"members.revokeInvite","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"id","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true}],"security":[{"bearer":[]}],"responses":{"204":{"description":"<No Content>"},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"summary":"Revoke a pending invite"}},"/api/v1/invites/{token}/accept":{"post":{"tags":["Members"],"operationId":"members.accept","parameters":[{"name":"token","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"id":{"type":"string"},"slug":{"type":"string"},"name":{"type":"string"},"role":{"type":"string","enum":["owner","admin","editor","viewer"]}},"required":["id","slug","name","role"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"402":{"description":"PLAN_LIMIT_REACHED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PLAN_LIMIT_REACHED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Needs a signed-in person (not an API token) whose verified email is the one invited. Answers the organization you joined, with your role.","summary":"Accept an invite"}},"/api/v1/orgs/{org}/connected-apps":{"get":{"tags":["Members"],"operationId":"members.connectedApps","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"array","items":{"type":"object","properties":{"userId":{"type":"string"},"userName":{"anyOf":[{"type":"string"},{"type":"null"}]},"userEmail":{"type":"string"},"clientId":{"type":"string"},"name":{"type":"string"},"hosts":{"type":"array","items":{"type":"string"}},"connectedAt":{"type":"string"},"lastUsedAt":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["userId","userName","userEmail","clientId","name","hosts","connectedAt","lastUsedAt"],"additionalProperties":false}}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Apps such as Claude that members allowed to act as them here through the MCP connector, most recently allowed first. Only apps allowed for this organization, with times from here: nothing about members' other organizations. Admins and owners.","summary":"List the apps members connected to this organization"}},"/api/v1/orgs/{org}/connected-apps/{userId}/{clientId}":{"delete":{"tags":["Members"],"operationId":"members.disconnectMemberApp","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"userId","in":"path","schema":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"},"required":true},{"name":"clientId","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"204":{"description":"<No Content>"},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Its next request here is refused, and it disappears from the member's list for this organization. The member's other organizations keep it; with none left, it's disconnected. Recorded in this organization's audit log. Admins and owners.","summary":"Disconnect a member's app from this organization"}},"/api/v1/orgs/{org}/transfer":{"post":{"tags":["Members"],"operationId":"members.transfer","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"204":{"description":"<No Content>"},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Owners only, signed in. The member you name becomes an owner and you become an admin.","summary":"Transfer ownership","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"userId":{"type":"string","pattern":"^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|[fF]{8}-[fF]{4}-[fF]{4}-[fF]{4}-[fF]{12})$","format":"uuid"}},"required":["userId"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/audit":{"get":{"tags":["Audit log"],"operationId":"audit.list","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true},{"name":"offset","in":"query","schema":{"type":"string"},"required":false},{"name":"limit","in":"query","schema":{"type":"string"},"required":false},{"name":"cursor","in":"query","schema":{"type":"string"},"required":false},{"name":"app","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":false},{"name":"environment","in":"query","schema":{"type":"string","pattern":"^[a-z0-9][a-z0-9._-]{0,63}$","description":"lowercase letters, digits, '-', '_' or '.', up to 64 characters"},"required":false},{"name":"resourceType","in":"query","schema":{"type":"string","enum":["organization","app","environment","flag","segment","sdk_key","api_token","member","invite","plan"]},"required":false},{"name":"resourceKey","in":"query","schema":{"type":"string"},"required":false},{"name":"actor","in":"query","schema":{"type":"string"},"required":false},{"name":"action","in":"query","schema":{"type":"string"},"required":false},{"name":"via","in":"query","schema":{"type":"string","enum":["mcp"]},"required":false},{"name":"since","in":"query","schema":{"type":"string"},"required":false},{"name":"until","in":"query","schema":{"type":"string"},"required":false}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"data":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"at":{"type":"string"},"actor":{"type":"string"},"actorName":{"anyOf":[{"type":"string"},{"type":"null"}]},"via":{"anyOf":[{"type":"string"},{"type":"null"}]},"action":{"type":"string"},"resourceType":{"type":"string"},"resourceKey":{"type":"string"},"environment":{"anyOf":[{"type":"string"},{"type":"null"}]},"app":{"anyOf":[{"type":"string"},{"type":"null"}]},"before":{"anyOf":[{},{"type":"null"}]},"after":{"anyOf":[{},{"type":"null"}]},"details":{"anyOf":[{},{"type":"null"}]}},"required":["id","at","actor","actorName","action","resourceType","resourceKey","environment","app","before","after","details"],"additionalProperties":false}},"offset":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"limit":{"type":"integer","minimum":-9007199254740991,"maximum":9007199254740991},"hasMore":{"type":"boolean"},"next":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["data","offset","limit","hasMore","next"],"additionalProperties":false}}}},"400":{"description":"VALIDATION_FAILED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/VALIDATION_FAILED"}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Filter by app, environment, resource, actor, action and time. Page with `cursor`: each page's `next` is the cursor for the one after it (null on the last page), and pages don't shift when new entries arrive. `offset` still works.","summary":"Read the audit log, newest first"}},"/api/v1/orgs/{org}/billing":{"get":{"tags":["Billing"],"operationId":"billing.get","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"payments":{"type":"boolean"},"taxes":{"type":"boolean"},"plan":{"type":"string"},"planVersion":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]},"source":{"type":"string","enum":["free","stripe","comp","self-hosted"]},"endsAt":{"anyOf":[{"type":"string"},{"type":"null"}]},"limits":{"type":"object","properties":{"mau":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]},"apps":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]},"environmentsPerApp":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]},"members":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]},"auditLogDays":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]},"expiringEnvironmentsPerApp":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]}},"required":["mau","apps","environmentsPerApp","members","auditLogDays","expiringEnvironmentsPerApp"],"additionalProperties":false},"usage":{"type":"object","properties":{"month":{"type":"string"},"mau":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]},"byKind":{"type":"array","items":{"type":"object","properties":{"kind":{"type":"string"},"mau":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]}},"required":["kind","mau"],"additionalProperties":false}}},"required":["month","mau","byKind"],"additionalProperties":false},"counts":{"type":"object","properties":{"apps":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]},"members":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]},"environmentsPerApp":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]},"expiringEnvironmentsPerApp":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]}},"required":["apps","members","environmentsPerApp","expiringEnvironmentsPerApp"],"additionalProperties":false},"subscription":{"anyOf":[{"type":"object","properties":{"status":{"type":"string"},"interval":{"anyOf":[{"type":"string","enum":["month","year"]},{"type":"null"}]},"currentPeriodEnd":{"anyOf":[{"type":"string"},{"type":"null"}]},"cancelAtPeriodEnd":{"type":"boolean"}},"required":["status","interval","currentPeriodEnd","cancelAtPeriodEnd"],"additionalProperties":false},{"type":"null"}]},"prices":{"anyOf":[{"type":"object","properties":{"currency":{"type":"string"},"monthly":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]},"yearly":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]},"includedMau":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]},"overagePer1000":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]},{"type":"null"}]}},"required":["currency","monthly","yearly","includedMau","overagePer1000"],"additionalProperties":false},{"type":"null"}]}},"required":["payments","taxes","plan","planVersion","source","endsAt","limits","usage","counts","subscription","prices"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}}},"description":"Owners and admins only. Self-hosted Slydog has no plans (`404`). `prices` are read from Stripe and are null when this server doesn't take payments.","summary":"See the plan, this month's usage and the subscription"}},"/api/v1/orgs/{org}/billing/checkout":{"post":{"tags":["Billing"],"operationId":"billing.checkout","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"409":{"description":"ALREADY_EXISTS","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ALREADY_EXISTS"}}}},"503":{"description":"BILLING_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BILLING_UNAVAILABLE"}}}}},"description":"Answers a Stripe Checkout URL to send the browser to. After paying, Stripe returns to the admin's Billing page with `?checkout=success`, and the plan applies within seconds. Organizations comped with no end, and those already paying, answer `409 ALREADY_EXISTS` (one under a comp that ends may start paying for after it); a server without Stripe answers `503 BILLING_UNAVAILABLE`.","summary":"Start paying for Pro","requestBody":{"content":{"application/json":{"schema":{"type":"object","properties":{"plan":{"type":"string","enum":["pro"]},"interval":{"type":"string","enum":["month","year"]}},"required":["plan","interval"],"additionalProperties":false}}},"required":true}}},"/api/v1/orgs/{org}/billing/portal":{"post":{"tags":["Billing"],"operationId":"billing.portal","parameters":[{"name":"org","in":"path","schema":{"type":"string"},"required":true}],"security":[{"bearer":[]}],"responses":{"200":{"description":"Success","content":{"application/json":{"schema":{"type":"object","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":false}}}},"401":{"description":"UNAUTHORIZED","content":{"application/json":{"schema":{"$ref":"#/components/schemas/UNAUTHORIZED"}}}},"403":{"description":"FORBIDDEN","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FORBIDDEN"}}}},"404":{"description":"NOT_FOUND","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NOT_FOUND"}}}},"503":{"description":"BILLING_UNAVAILABLE","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BILLING_UNAVAILABLE"}}}}},"description":"Answers a Stripe Customer Portal URL: change the card, see invoices, switch between monthly and yearly, or cancel at the end of the period. `404` before the organization's first Checkout.","summary":"Manage billing"}}},"components":{"schemas":{"UNAUTHORIZED":{"type":"object","properties":{"status":{"type":"number","enum":[401]},"code":{"type":"string","enum":["UNAUTHORIZED"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"BILLING_UNAVAILABLE":{"type":"object","properties":{"status":{"type":"number","enum":[503]},"code":{"type":"string","enum":["BILLING_UNAVAILABLE"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"FORBIDDEN":{"type":"object","properties":{"status":{"type":"number","enum":[403]},"code":{"type":"string","enum":["FORBIDDEN"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"NOT_FOUND":{"type":"object","properties":{"status":{"type":"number","enum":[404]},"code":{"type":"string","enum":["NOT_FOUND"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"ALREADY_EXISTS":{"type":"object","properties":{"status":{"type":"number","enum":[409]},"code":{"type":"string","enum":["ALREADY_EXISTS"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"VALIDATION_FAILED":{"type":"object","properties":{"status":{"type":"number","enum":[400]},"code":{"type":"string","enum":["VALIDATION_FAILED"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"PLAN_LIMIT_REACHED":{"type":"object","properties":{"status":{"type":"number","enum":[402]},"code":{"type":"string","enum":["PLAN_LIMIT_REACHED"]},"message":{"type":"string"},"limit":{"type":"string","enum":["apps","environmentsPerApp","members","expiringEnvironmentsPerApp","mau"]},"allowed":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]},"current":{"anyOf":[{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]},"plan":{"type":"string"},"upgradeUrl":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["status","code","message","limit","allowed","current","plan","upgradeUrl"],"additionalProperties":false},"RATE_LIMITED":{"type":"object","properties":{"status":{"type":"number","enum":[429]},"code":{"type":"string","enum":["RATE_LIMITED"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"LAST_OWNER":{"type":"object","properties":{"status":{"type":"number","enum":[409]},"code":{"type":"string","enum":["LAST_OWNER"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"CONFIRMATION_REQUIRED":{"type":"object","properties":{"status":{"type":"number","enum":[428]},"code":{"type":"string","enum":["CONFIRMATION_REQUIRED"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"CONFLICT":{"type":"object","properties":{"status":{"type":"number","enum":[409]},"code":{"type":"string","enum":["CONFLICT"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"INVALID_RULES":{"type":"object","properties":{"status":{"type":"number","enum":[422]},"code":{"type":"string","enum":["INVALID_RULES"]},"message":{"type":"string"},"problems":{"type":"array","items":{"type":"string"}},"issues":{"type":"array","items":{"type":"object","properties":{"path":{"type":"array","items":{"anyOf":[{"type":"string"},{"type":"number"},{"type":"string","enum":["Infinity","-Infinity","NaN"]}]}},"message":{"type":"string"}},"required":["path","message"],"additionalProperties":false}}},"required":["status","code","message","problems","issues"],"additionalProperties":false},"REQUEST_DECIDED":{"type":"object","properties":{"status":{"type":"number","enum":[409]},"code":{"type":"string","enum":["REQUEST_DECIDED"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"CANNOT_APPROVE":{"type":"object","properties":{"status":{"type":"number","enum":[403]},"code":{"type":"string","enum":["CANNOT_APPROVE"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false},"STALE_REQUEST":{"type":"object","properties":{"status":{"type":"number","enum":[409]},"code":{"type":"string","enum":["STALE_REQUEST"]},"message":{"type":"string"}},"required":["status","code","message"],"additionalProperties":false}},"securitySchemes":{"bearer":{"description":"An API token (`sly_tok_…`) or a session token. API tokens belong to one organization and carry a role; make one with `POST /api/v1/orgs/{org}/tokens`. A session acts in every organization you belong to, with your role in each. In a browser signed in at `/api/auth`, the session cookie works without this header.","type":"http","scheme":"bearer"}}},"security":[],"tags":[{"name":"Sign-in"},{"name":"You"},{"name":"Organizations"},{"name":"Apps"},{"name":"Environments"},{"name":"Flags"},{"name":"Segments","description":"Segments belong to an environment, since keys differ between development and production."},{"name":"SDK keys"},{"name":"API tokens","description":"A token can't have a higher role than whoever makes it."},{"name":"Change requests","description":"When an organization requires approval, changes to protected environments become requests that wait for a second person."},{"name":"Scheduled changes","description":"Flag changes applied at a set time. Approvals still apply: a change to a protected environment that needs approval is scheduled only once someone else approves it."},{"name":"Ramps","description":"Progressive rollouts on a timetable (5% → 25% → 50% → 100%), applied by the scheduled-changes job."},{"name":"Members","description":"Everyone in an organization can see its members. Owners and admins invite people, change roles and remove people. An organization always has at least one owner."},{"name":"Audit log"},{"name":"Billing"}]}