{
  "openapi": "3.0.0",
  "paths": {
    "/health": {
      "get": {
        "operationId": "HealthController_check",
        "parameters": [],
        "responses": {
          "200": {
            "description": ""
          }
        },
        "tags": [
          "Health"
        ]
      }
    },
    "/v1/me": {
      "get": {
        "operationId": "MeController_me",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Me"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "me"
        ]
      }
    },
    "/v1/projects": {
      "get": {
        "operationId": "ProjectsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectList"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "projects"
        ]
      },
      "post": {
        "operationId": "ProjectsController_create",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProject"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The org's plan does not allow this (`code: plan_limit`, and `limit` names which). Upgrade the plan, or wait for next month for the monthly active users.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Something with this key exists already. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/projects/{projectId}": {
      "get": {
        "operationId": "ProjectsController_read",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "projects"
        ]
      },
      "patch": {
        "operationId": "ProjectsController_update",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateProject"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Project"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "projects"
        ]
      },
      "delete": {
        "operationId": "ProjectsController_remove",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteByKey"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "The body does not name the project's key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "projects"
        ]
      }
    },
    "/v1/onboarding": {
      "post": {
        "operationId": "OnboardingController_create",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProject"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Onboarded"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The org's plan does not allow this (`code: plan_limit`, and `limit` names which). Upgrade the plan, or wait for next month for the monthly active users.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Something with this key exists already. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "onboarding"
        ]
      }
    },
    "/v1/billing/plan": {
      "get": {
        "operationId": "BillingController_read",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Plan"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/options": {
      "get": {
        "operationId": "BillingController_options",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingOptions"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/checkout": {
      "post": {
        "operationId": "BillingController_checkout",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartCheckout"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingRedirect"
                }
              }
            }
          },
          "400": {
            "description": "Choose Pro or Business.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "There is an existing subscription or Checkout in progress. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Stripe is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Paid subscriptions are unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/billing/portal": {
      "post": {
        "operationId": "BillingController_portal",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingRedirect"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The organization does not have a Stripe customer yet. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Stripe is temporarily unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Paid subscriptions are unavailable.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "UsageController_read",
        "parameters": [
          {
            "name": "month",
            "required": false,
            "in": "query",
            "description": "A calendar month (UTC) as `YYYY-MM`, with a year from 0001 to 9999. The current month when not given.",
            "schema": {
              "type": "string",
              "pattern": "^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])$",
              "description": "A calendar month (UTC) as `YYYY-MM`, with a year from 0001 to 9999. The current month when not given.",
              "example": "2026-01"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Usage"
                }
              }
            }
          },
          "400": {
            "description": "An invalid calendar month or a year outside 0001 to 9999.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "billing"
        ]
      }
    },
    "/v1/members": {
      "get": {
        "operationId": "MembersController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberList"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "members"
        ]
      }
    },
    "/v1/members/{memberId}": {
      "patch": {
        "operationId": "MembersController_update",
        "parameters": [
          {
            "name": "memberId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMember"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Member"
                }
              }
            }
          },
          "400": {
            "description": "A body that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A caller who is not an owner or an admin, or an admin making or demoting an owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No member with this id in the caller's org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The org's last owner cannot be demoted. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "members"
        ]
      },
      "delete": {
        "operationId": "MembersController_remove",
        "parameters": [
          {
            "name": "memberId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "responses": {
          "204": {
            "description": "Removed."
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A caller who is not an owner or an admin, or an admin removing an owner.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No member with this id in the caller's org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The org's last owner cannot be removed. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "members"
        ]
      }
    },
    "/v1/org": {
      "patch": {
        "operationId": "OrgController_rename",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameOrg"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Org"
                }
              }
            }
          },
          "400": {
            "description": "A body that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "org"
        ]
      }
    },
    "/v1/org/audit": {
      "get": {
        "operationId": "OrgController_audit",
        "parameters": [
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Which page of 50 entries, from 1 (the newest). 1 when not given; a page past the end is empty.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991,
              "description": "Which page of 50 entries, from 1 (the newest). 1 when not given; a page past the end is empty."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditList"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "org"
        ]
      }
    },
    "/v1/orgs": {
      "get": {
        "operationId": "OrgsController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgOfLoginList"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "orgs"
        ]
      },
      "post": {
        "operationId": "OrgsController_create",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NewOrg"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Org"
                }
              }
            }
          },
          "400": {
            "description": "A body that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "orgs"
        ]
      }
    },
    "/v1/orgs/{orgId}/switch": {
      "post": {
        "operationId": "OrgsController_switch",
        "parameters": [
          {
            "name": "orgId",
            "required": true,
            "in": "path",
            "schema": {
              "type": "string"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Org"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No org with this id that the login is a member of.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "orgs"
        ]
      }
    },
    "/v1/tokens": {
      "get": {
        "operationId": "TokensController_list",
        "parameters": [],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiTokenList"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "tokens"
        ]
      },
      "post": {
        "operationId": "TokensController_create",
        "parameters": [
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiToken"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedApiToken"
                }
              }
            }
          },
          "400": {
            "description": "A body that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "tokens"
        ]
      }
    },
    "/v1/tokens/{tokenId}/revoke": {
      "post": {
        "operationId": "TokensController_revoke",
        "parameters": [
          {
            "name": "tokenId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiToken"
                }
              }
            }
          },
          "400": {
            "description": "A token id that is not one.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No token with this id in the caller's org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "tokens"
        ]
      }
    },
    "/v1/projects/{projectId}/environments/{envId}/copy": {
      "post": {
        "operationId": "CopyStateController_copy",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "envId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CopyState"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CopiedState"
                }
              }
            }
          },
          "400": {
            "description": "A body that does not match its schema, or the source is the target.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "No such project, environment or flag in the project.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "428": {
            "description": "A member copied into a protected environment without `confirm: true`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "environments"
        ]
      }
    },
    "/v1/projects/{projectId}/applications": {
      "get": {
        "operationId": "ApplicationsController_list",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApplicationList"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "applications"
        ]
      },
      "post": {
        "operationId": "ApplicationsController_create",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApplication"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Something with this key exists already. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "applications"
        ]
      }
    },
    "/v1/projects/{projectId}/applications/{applicationId}": {
      "get": {
        "operationId": "ApplicationsController_read",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "applicationId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "applications"
        ]
      },
      "patch": {
        "operationId": "ApplicationsController_rename",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "applicationId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameApplication"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Application"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "applications"
        ]
      },
      "delete": {
        "operationId": "ApplicationsController_remove",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "applicationId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteByKey"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "The body does not name the application's key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "It is the project's last application. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "applications"
        ]
      }
    },
    "/v1/projects/{projectId}/environments": {
      "get": {
        "operationId": "EnvironmentsController_list",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EnvironmentList"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "environments"
        ]
      },
      "post": {
        "operationId": "EnvironmentsController_create",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEnvironment"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The org's plan does not allow this (`code: plan_limit`, and `limit` names which). Upgrade the plan, or wait for next month for the monthly active users.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Something with this key exists already. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "environments"
        ]
      }
    },
    "/v1/projects/{projectId}/environments/{envId}": {
      "get": {
        "operationId": "EnvironmentsController_read",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "envId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "environments"
        ]
      },
      "patch": {
        "operationId": "EnvironmentsController_update",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "envId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEnvironment"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Environment"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "environments"
        ]
      },
      "delete": {
        "operationId": "EnvironmentsController_remove",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "envId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DeleteByKey"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "The body does not name the environment's key.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "environments"
        ]
      }
    },
    "/v1/projects/{projectId}/applications/{applicationId}/sdk-keys": {
      "get": {
        "operationId": "SdkKeysController_list",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "applicationId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SdkKeyList"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "sdk keys"
        ]
      },
      "post": {
        "operationId": "SdkKeysController_create",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "applicationId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSdkKey"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CreatedSdkKey"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "sdk keys"
        ]
      }
    },
    "/v1/projects/{projectId}/applications/{applicationId}/sdk-keys/{keyId}/identity-secret": {
      "post": {
        "operationId": "SdkKeysController_replaceIdentitySecret",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "applicationId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "keyId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReplacedIdentitySecret"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Only live client keys can receive a signing secret. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "sdk keys"
        ]
      }
    },
    "/v1/projects/{projectId}/applications/{applicationId}/sdk-keys/{keyId}/revoke": {
      "post": {
        "operationId": "SdkKeysController_revoke",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "applicationId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "keyId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SdkKey"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "sdk keys"
        ]
      }
    },
    "/v1/projects/{projectId}/audit": {
      "get": {
        "operationId": "AuditController_list",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Which page of 50 entries, from 1 (the newest). 1 when not given; a page past the end is empty.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991,
              "description": "Which page of 50 entries, from 1 (the newest). 1 when not given; a page past the end is empty."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditList"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "audit log"
        ]
      }
    },
    "/v1/projects/{projectId}/flags": {
      "get": {
        "operationId": "FlagsController_list",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/FlagList"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "flags"
        ]
      },
      "post": {
        "operationId": "FlagsController_create",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateFlag"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flag"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The org's plan does not allow this (`code: plan_limit`, and `limit` names which). Upgrade the plan, or wait for next month for the monthly active users.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Something with this key exists already. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "flags"
        ]
      }
    },
    "/v1/projects/{projectId}/flags/{flagId}": {
      "get": {
        "operationId": "FlagsController_read",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "flagId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flag"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "flags"
        ]
      },
      "patch": {
        "operationId": "FlagsController_update",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "flagId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFlag"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flag"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The flag is archived. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "flags"
        ]
      },
      "delete": {
        "operationId": "FlagsController_remove",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "flagId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "flags"
        ]
      }
    },
    "/v1/projects/{projectId}/flags/{flagId}/environments/{envId}": {
      "patch": {
        "operationId": "FlagsController_setState",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "flagId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "envId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateFlagState"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flag"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The flag is archived. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "A member changed a protected environment without `confirm: true`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "flags"
        ]
      }
    },
    "/v1/projects/{projectId}/flags/{flagId}/applications": {
      "put": {
        "operationId": "FlagsController_setApplications",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "flagId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetFlagApplications"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flag"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The flag is archived. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "flags"
        ]
      }
    },
    "/v1/projects/{projectId}/flags/{flagId}/archive": {
      "post": {
        "operationId": "FlagsController_archive",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "flagId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flag"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "flags"
        ]
      }
    },
    "/v1/projects/{projectId}/flags/{flagId}/unarchive": {
      "post": {
        "operationId": "FlagsController_unarchive",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "flagId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Flag"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "flags"
        ]
      }
    },
    "/v1/projects/{projectId}/flags/{flagId}/audit": {
      "get": {
        "operationId": "FlagsController_audit",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "flagId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "page",
            "required": false,
            "in": "query",
            "description": "Which page of 50 entries, from 1 (the newest). 1 when not given; a page past the end is empty.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 9007199254740991,
              "description": "Which page of 50 entries, from 1 (the newest). 1 when not given; a page past the end is empty."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditList"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "flags"
        ]
      }
    },
    "/v1/projects/{projectId}/flags/{flagId}/environments/{envId}/overrides": {
      "get": {
        "operationId": "OverridesController_list",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "flagId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "envId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Overrides"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "overrides"
        ]
      }
    },
    "/v1/projects/{projectId}/flags/{flagId}/environments/{envId}/users/{userId}": {
      "put": {
        "operationId": "OverridesController_setUser",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "flagId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "envId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/UserId"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetOverride"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Overrides"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The flag is archived. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "A member changed a protected environment without `confirm: true`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "overrides"
        ]
      }
    },
    "/v1/projects/{projectId}/flags/{flagId}/environments/{envId}/segments/{segmentId}": {
      "put": {
        "operationId": "OverridesController_setSegment",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "flagId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "envId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "segmentId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetOverride"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Overrides"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The flag is archived. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "428": {
            "description": "A member changed a protected environment without `confirm: true`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "overrides"
        ]
      }
    },
    "/v1/projects/{projectId}/users": {
      "get": {
        "operationId": "UsersController_search",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "search",
            "required": false,
            "in": "query",
            "description": "An exact user id, or a part of a name (case does not matter).",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256,
              "description": "An exact user id, or a part of a name (case does not matter)."
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AppUserList"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "users"
        ]
      }
    },
    "/v1/projects/{projectId}/users/bulk": {
      "post": {
        "operationId": "UsersController_upsert",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpsertUsers"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UpsertedUsers"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "413": {
            "description": "A body over 16 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "users"
        ]
      }
    },
    "/v1/projects/{projectId}/users/{userId}": {
      "delete": {
        "operationId": "UsersController_remove",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "userId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/UserId"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "users"
        ]
      }
    },
    "/v1/projects/{projectId}/segments": {
      "get": {
        "operationId": "SegmentsController_list",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentList"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "segments"
        ]
      },
      "post": {
        "operationId": "SegmentsController_create",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateSegment"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Segment"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "402": {
            "description": "The org's plan does not allow this (`code: plan_limit`, and `limit` names which). Upgrade the plan, or wait for next month for the monthly active users.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Something with this key exists already. A login session has a different active organization than the header names. The error code is `organization_changed`.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "segments"
        ]
      }
    },
    "/v1/projects/{projectId}/segments/{segmentId}": {
      "get": {
        "operationId": "SegmentsController_read",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "segmentId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Segment"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "segments"
        ]
      },
      "patch": {
        "operationId": "SegmentsController_rename",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "segmentId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RenameSegment"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Segment"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "segments"
        ]
      },
      "delete": {
        "operationId": "SegmentsController_remove",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "segmentId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "responses": {
          "204": {
            "description": "Deleted."
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "segments"
        ]
      }
    },
    "/v1/projects/{projectId}/segments/{segmentId}/users": {
      "get": {
        "operationId": "SegmentsController_listMembers",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "segmentId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentMembers"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "segments"
        ]
      },
      "put": {
        "operationId": "SegmentsController_setMembers",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "segmentId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetSegmentMembers"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentMembers"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "413": {
            "description": "A body over 16 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "segments"
        ]
      },
      "patch": {
        "operationId": "SegmentsController_patchMembers",
        "parameters": [
          {
            "name": "projectId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "name": "segmentId",
            "required": true,
            "in": "path",
            "schema": {
              "$ref": "#/components/schemas/Id"
            }
          },
          {
            "$ref": "#/components/parameters/ExpectedOrganization"
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ChangeSegmentMembers"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SegmentMembers"
                }
              }
            }
          },
          "400": {
            "description": "A body or an id that does not match its schema.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "No login and no API token, or one that is not valid.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A login that is no member of any org, or a role or an API token this route does not take (apps/api/src/auth/roles.ts).",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Nothing with this id in the caller's org: it does not exist, or it belongs to another org.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "$ref": "#/components/responses/OrganizationChanged"
          },
          "413": {
            "description": "A body over 16 MB.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Too many requests from this API token or member, or too many refused tokens from this address; ask again after `Retry-After` seconds.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "tags": [
          "segments"
        ]
      }
    }
  },
  "info": {
    "title": "Dipswitch api",
    "description": "The management API. Every /v1 route takes an API token (`Authorization: Bearer <token>`) or a login session. Something of another org answers 404, like something that does not exist. Errors include `{ statusCode, message }` and can include a machine-readable `code`.",
    "version": "1",
    "contact": {}
  },
  "tags": [],
  "servers": [],
  "components": {
    "securitySchemes": {
      "token": {
        "scheme": "bearer",
        "bearerFormat": "JWT",
        "type": "http",
        "description": "An API token of the org."
      },
      "session": {
        "type": "apiKey",
        "in": "cookie",
        "name": "better-auth.session_token",
        "description": "A member login."
      }
    },
    "schemas": {
      "Error": {
        "type": "object",
        "properties": {
          "statusCode": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "message": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            ],
            "description": "For people. A body that fails its schema lists one message per field."
          },
          "code": {
            "description": "A machine-readable reason when the route provides one.",
            "type": "string"
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "statusCode",
          "message"
        ],
        "description": "Every error answer of `/v1`."
      },
      "Me": {
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "member"
                ]
              },
              "memberId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "orgId": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "memberId",
              "userId",
              "orgId"
            ]
          },
          {
            "type": "object",
            "properties": {
              "kind": {
                "type": "string",
                "enum": [
                  "token"
                ]
              },
              "tokenId": {
                "$ref": "#/components/schemas/Id"
              },
              "orgId": {
                "type": "string"
              }
            },
            "required": [
              "kind",
              "tokenId",
              "orgId"
            ]
          }
        ]
      },
      "Id": {
        "type": "string",
        "pattern": "^[1-9][0-9]{0,18}$",
        "description": "A database id: a 64-bit integer written as a string of decimal digits with no leading zero, because it does not fit a JSON number safely.",
        "example": "1"
      },
      "ProjectList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Project"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "Project": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "unseenUserMonths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 13,
            "description": "Users no SDK has seen for this many months, with no override and in no segment, are removed. 13 at most."
          }
        },
        "required": [
          "id",
          "key",
          "name",
          "unseenUserMonths"
        ]
      },
      "Key": {
        "type": "string",
        "pattern": "^[A-Za-z0-9][A-Za-z0-9._-]{0,127}$",
        "description": "The key of a project, application, environment, flag or segment: 1 to 128 letters, digits, `.`, `_` or `-`, starting with a letter or a digit.",
        "example": "new-billing"
      },
      "CreateProject": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          }
        },
        "required": [
          "key",
          "name"
        ],
        "additionalProperties": false,
        "description": "A \"Default\" application is created with it."
      },
      "UpdateProject": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "unseenUserMonths": {
            "type": "integer",
            "minimum": 1,
            "maximum": 13,
            "description": "Users no SDK has seen for this many months, with no override and in no segment, are removed. 13 at most."
          }
        },
        "additionalProperties": false
      },
      "DeleteByKey": {
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          }
        },
        "required": [
          "key"
        ],
        "additionalProperties": false
      },
      "Onboarded": {
        "type": "object",
        "properties": {
          "project": {
            "$ref": "#/components/schemas/Project"
          },
          "application": {
            "$ref": "#/components/schemas/Application"
          },
          "environments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Environment"
            }
          }
        },
        "required": [
          "project",
          "application",
          "environments"
        ],
        "description": "A project made by onboarding, with its \"Default\" application and the environments Development and Production."
      },
      "Application": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "projectId": {
            "$ref": "#/components/schemas/Id"
          },
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          }
        },
        "required": [
          "id",
          "projectId",
          "key",
          "name"
        ]
      },
      "Environment": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "projectId": {
            "$ref": "#/components/schemas/Id"
          },
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "isProtected": {
            "type": "boolean",
            "description": "A member's change to a flag here must carry a confirmation; API tokens are exempt."
          },
          "verifyIdentity": {
            "type": "boolean",
            "description": "Require a signature when a client key asks for a named user in this environment."
          }
        },
        "required": [
          "id",
          "projectId",
          "key",
          "name",
          "isProtected",
          "verifyIdentity"
        ]
      },
      "Plan": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/PlanId"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "monthlyPriceUsd": {
            "type": "number",
            "minimum": 0,
            "description": "A placeholder until prices are decided."
          },
          "limits": {
            "type": "object",
            "properties": {
              "monthlyActiveUsers": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991,
                "description": "Users `edge` saw in a calendar month (UTC), over all of the org's projects; users only a server SDK sees are not counted."
              },
              "members": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "projects": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991
              },
              "environments": {
                "type": "integer",
                "minimum": 1,
                "maximum": 9007199254740991,
                "description": "Over all of the org's projects."
              }
            },
            "required": [
              "monthlyActiveUsers",
              "members",
              "projects",
              "environments"
            ],
            "description": "What the plan allows the whole org. Placeholders until the limits are decided."
          }
        },
        "required": [
          "id",
          "name",
          "monthlyPriceUsd",
          "limits"
        ],
        "description": "A plan, its limits and its price."
      },
      "PlanId": {
        "type": "string",
        "enum": [
          "free",
          "pro",
          "business"
        ],
        "description": "The plan an org is on."
      },
      "BillingOptions": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "hasSubscription": {
            "type": "boolean"
          }
        },
        "required": [
          "enabled",
          "hasSubscription"
        ]
      },
      "StartCheckout": {
        "type": "object",
        "properties": {
          "plan": {
            "type": "string",
            "enum": [
              "pro",
              "business"
            ]
          }
        },
        "required": [
          "plan"
        ],
        "additionalProperties": false
      },
      "BillingRedirect": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": [
          "url"
        ]
      },
      "Usage": {
        "type": "object",
        "properties": {
          "month": {
            "type": "string",
            "pattern": "^(?!0000)[0-9]{4}-(0[1-9]|1[0-2])$",
            "description": "A calendar month (UTC) as `YYYY-MM`, with a year from 0001 to 9999. The current month when not given.",
            "example": "2026-01"
          },
          "monthlyActiveUsers": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Users `edge` saw this month, over the org's projects."
          },
          "requests": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Requests of the org's SDK keys this month, but polls answered \"not modified\"."
          },
          "projects": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "projectId": {
                  "description": "A deleted project is listed by its id still.",
                  "allOf": [
                    {
                      "$ref": "#/components/schemas/Id"
                    }
                  ]
                },
                "monthlyActiveUsers": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "requests": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "keys": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "sdkKeyId": {
                        "$ref": "#/components/schemas/Id"
                      },
                      "requests": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "sdkKeyId",
                      "requests"
                    ]
                  }
                }
              },
              "required": [
                "projectId",
                "monthlyActiveUsers",
                "requests",
                "keys"
              ]
            }
          }
        },
        "required": [
          "month",
          "monthlyActiveUsers",
          "requests",
          "projects"
        ],
        "description": "An org's usage in one month, per project and per SDK key."
      },
      "MemberList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Member"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "Member": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string"
          },
          "email": {
            "type": "string",
            "format": "email",
            "pattern": "^(?:[A-Za-z0-9_'+\\-]+\\.)*[A-Za-z0-9_'+\\-]*[A-Za-z0-9_+-]@(?:[A-Za-z0-9][A-Za-z0-9\\-]*\\.)+[A-Za-z]{2,}$"
          },
          "role": {
            "$ref": "#/components/schemas/Role"
          }
        },
        "required": [
          "id",
          "name",
          "email",
          "role"
        ],
        "description": "A person who logs in to the panel, in this org."
      },
      "Role": {
        "type": "string",
        "enum": [
          "owner",
          "admin",
          "member"
        ],
        "description": "Owners and admins manage the org; members manage flags, users and segments."
      },
      "UpdateMember": {
        "type": "object",
        "properties": {
          "role": {
            "$ref": "#/components/schemas/Role"
          }
        },
        "required": [
          "role"
        ],
        "additionalProperties": false
      },
      "RenameOrg": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "Org": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "slug": {
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "id",
          "name",
          "slug"
        ]
      },
      "AuditList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditEntry"
            }
          },
          "total": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "How many entries there are in all, on every page."
          }
        },
        "required": [
          "items",
          "total"
        ],
        "description": "Newest first, at most 50 entries a page."
      },
      "AuditEntry": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "actor": {
            "type": "string",
            "description": "`member:<id>` or `token:<id>`; `login:<user id>` for an invitation rejected by the login it was sent to; `system:cleanup` for the removal of unseen users and `system:stripe` for subscription changes."
          },
          "actorName": {
            "nullable": true,
            "description": "The member's or the token's name now, read when the entry is read; null when it no longer exists, and for a `login:` actor; the system process name for `system:cleanup` and `system:stripe`.",
            "type": "string"
          },
          "at": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "projectId": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Id"
              }
            ]
          },
          "flagId": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Id"
              }
            ]
          },
          "envId": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Id"
              }
            ]
          },
          "appUserId": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Id"
              }
            ]
          },
          "segmentId": {
            "nullable": true,
            "allOf": [
              {
                "$ref": "#/components/schemas/Id"
              }
            ]
          },
          "change": {
            "type": "object",
            "properties": {
              "action": {
                "type": "string"
              }
            },
            "required": [
              "action"
            ],
            "additionalProperties": {},
            "description": "What changed: `action`, and the values before and after."
          }
        },
        "required": [
          "id",
          "actor",
          "actorName",
          "at",
          "projectId",
          "flagId",
          "envId",
          "appUserId",
          "segmentId",
          "change"
        ]
      },
      "OrgOfLoginList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrgOfLogin"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "OrgOfLogin": {
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "slug": {
            "type": "string",
            "minLength": 1
          },
          "role": {
            "$ref": "#/components/schemas/Role"
          },
          "active": {
            "type": "boolean",
            "description": "Whether this session acts in it now."
          }
        },
        "required": [
          "id",
          "name",
          "slug",
          "role",
          "active"
        ],
        "description": "An org the caller's login is a member of, with the role it has there."
      },
      "NewOrg": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false,
        "description": "A further org, on Free, with the caller as its owner."
      },
      "ApiTokenList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiToken"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "ApiToken": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "createdBy": {
            "type": "string",
            "description": "`member:<id>` of the member who made it, or `command`."
          },
          "createdByName": {
            "nullable": true,
            "description": "That member's name now; null for the command, or once the member is removed.",
            "type": "string"
          },
          "lastUsedAt": {
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "revokedAt": {
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "id",
          "name",
          "createdBy",
          "createdByName",
          "lastUsedAt",
          "revokedAt"
        ],
        "description": "An API token without its secret, which is shown once, when the token is made."
      },
      "CreateApiToken": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string"
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "CreatedApiToken": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "createdBy": {
            "type": "string",
            "description": "`member:<id>` of the member who made it, or `command`."
          },
          "createdByName": {
            "nullable": true,
            "description": "That member's name now; null for the command, or once the member is removed.",
            "type": "string"
          },
          "lastUsedAt": {
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "revokedAt": {
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "token": {
            "type": "string",
            "description": "The secret. Shown only in this answer; store it now."
          }
        },
        "required": [
          "id",
          "name",
          "createdBy",
          "createdByName",
          "lastUsedAt",
          "revokedAt",
          "token"
        ]
      },
      "CopyState": {
        "type": "object",
        "properties": {
          "from": {
            "description": "The environment copied from.",
            "allOf": [
              {
                "$ref": "#/components/schemas/Id"
              }
            ]
          },
          "flagIds": {
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Id"
            },
            "description": "The flags whose switch, value and overrides are copied."
          },
          "confirm": {
            "description": "Needed for a member's copy into a protected environment.",
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "from",
          "flagIds"
        ],
        "additionalProperties": false
      },
      "CopiedState": {
        "type": "object",
        "properties": {
          "copied": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Id"
            },
            "description": "The flags whose state the target now has, in the order asked."
          },
          "skipped": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "flagId": {
                  "$ref": "#/components/schemas/Id"
                },
                "reason": {
                  "type": "string",
                  "enum": [
                    "archived"
                  ]
                }
              },
              "required": [
                "flagId",
                "reason"
              ]
            },
            "description": "Archived flags, left as they were."
          }
        },
        "required": [
          "copied",
          "skipped"
        ]
      },
      "ApplicationList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Application"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "CreateApplication": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          }
        },
        "required": [
          "key",
          "name"
        ],
        "additionalProperties": false
      },
      "RenameApplication": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "EnvironmentList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Environment"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "CreateEnvironment": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "isProtected": {
            "type": "boolean"
          },
          "verifyIdentity": {
            "type": "boolean",
            "description": "Require a signature when a client key asks for a named user in this environment."
          }
        },
        "required": [
          "key",
          "name"
        ],
        "additionalProperties": false
      },
      "UpdateEnvironment": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "isProtected": {
            "type": "boolean"
          },
          "verifyIdentity": {
            "type": "boolean",
            "description": "Require a signature when a client key asks for a named user in this environment."
          }
        },
        "additionalProperties": false,
        "description": "At least one of `name`, `isProtected` and `verifyIdentity`."
      },
      "SdkKeyList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/SdkKey"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "SdkKey": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "applicationId": {
            "$ref": "#/components/schemas/Id"
          },
          "envId": {
            "$ref": "#/components/schemas/Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "server",
              "client"
            ],
            "description": "A server key gets the ruleset; a client key, public, gets values for one user."
          },
          "revokedAt": {
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "hasIdentitySecret": {
            "type": "boolean",
            "description": "A signing secret has been issued for this client key."
          }
        },
        "required": [
          "id",
          "applicationId",
          "envId",
          "kind",
          "revokedAt",
          "hasIdentitySecret"
        ],
        "description": "SDK key metadata. The key and the signing secret are omitted from reads."
      },
      "CreateSdkKey": {
        "type": "object",
        "properties": {
          "envId": {
            "$ref": "#/components/schemas/Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "server",
              "client"
            ],
            "description": "A server key gets the ruleset; a client key, public, gets values for one user."
          }
        },
        "required": [
          "envId",
          "kind"
        ],
        "additionalProperties": false
      },
      "CreatedSdkKey": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "applicationId": {
            "$ref": "#/components/schemas/Id"
          },
          "envId": {
            "$ref": "#/components/schemas/Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "server",
              "client"
            ],
            "description": "A server key gets the ruleset; a client key, public, gets values for one user."
          },
          "revokedAt": {
            "nullable": true,
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "hasIdentitySecret": {
            "type": "boolean",
            "description": "A signing secret has been issued for this client key."
          },
          "key": {
            "type": "string",
            "description": "The SDK key. Shown only in this answer."
          },
          "identitySecret": {
            "type": "string",
            "description": "The signing secret. Shown only when issued. Keep it on your backend."
          }
        },
        "required": [
          "id",
          "applicationId",
          "envId",
          "kind",
          "revokedAt",
          "hasIdentitySecret",
          "key"
        ]
      },
      "ReplacedIdentitySecret": {
        "type": "object",
        "properties": {
          "identitySecret": {
            "type": "string",
            "description": "The signing secret. Shown only when issued. Keep it on your backend."
          }
        },
        "required": [
          "identitySecret"
        ]
      },
      "FlagList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Flag"
            }
          }
        },
        "required": [
          "items"
        ],
        "description": "Archived flags included, marked by `archivedAt`."
      },
      "Flag": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "projectId": {
            "$ref": "#/components/schemas/Id"
          },
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "description": {
            "nullable": true,
            "description": "What the flag is for.",
            "type": "string",
            "maxLength": 2000
          },
          "tags": {
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Free labels for finding flags; no tag twice."
          },
          "ownerId": {
            "nullable": true,
            "description": "The id of the member of the org who owns the flag.",
            "type": "string",
            "minLength": 1
          },
          "archivedAt": {
            "nullable": true,
            "description": "Set while the flag is archived: frozen, still served with its last state.",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "applicationIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Id"
            },
            "description": "The applications the flag is limited to; empty means every application, unless `appliesToNone`."
          },
          "appliesToNone": {
            "type": "boolean",
            "description": "Served to no application: the only one it was limited to was deleted. Setting its applications clears it."
          },
          "environments": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/FlagState"
            },
            "description": "The state in every environment of the project."
          }
        },
        "required": [
          "id",
          "projectId",
          "key",
          "name",
          "description",
          "tags",
          "ownerId",
          "archivedAt",
          "applicationIds",
          "appliesToNone",
          "environments"
        ]
      },
      "FlagState": {
        "type": "object",
        "properties": {
          "envId": {
            "$ref": "#/components/schemas/Id"
          },
          "enabled": {
            "type": "boolean",
            "description": "The switch. Off is off for everyone, overrides included."
          },
          "defaultOn": {
            "type": "boolean",
            "description": "When the switch is on: the value for a user with no override."
          }
        },
        "required": [
          "envId",
          "enabled",
          "defaultOn"
        ]
      },
      "CreateFlag": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "description": {
            "nullable": true,
            "description": "What the flag is for.",
            "type": "string",
            "maxLength": 2000
          },
          "tags": {
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Free labels for finding flags; no tag twice."
          },
          "ownerId": {
            "nullable": true,
            "description": "The id of the member of the org who owns the flag.",
            "type": "string",
            "minLength": 1
          }
        },
        "required": [
          "key",
          "name"
        ],
        "additionalProperties": false,
        "description": "The flag starts switched off in every environment, with the value for everyone else on."
      },
      "UpdateFlag": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          },
          "description": {
            "nullable": true,
            "description": "What the flag is for.",
            "type": "string",
            "maxLength": 2000
          },
          "tags": {
            "maxItems": 32,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 64
            },
            "description": "Free labels for finding flags; no tag twice."
          },
          "ownerId": {
            "nullable": true,
            "description": "The id of the member of the org who owns the flag.",
            "type": "string",
            "minLength": 1
          }
        },
        "additionalProperties": false,
        "description": "What the flag is; its key is fixed. At least one field."
      },
      "UpdateFlagState": {
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "defaultOn": {
            "type": "boolean"
          },
          "confirm": {
            "description": "Needed for a member's change in a protected environment.",
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "additionalProperties": false,
        "description": "At least one of `enabled` and `defaultOn`."
      },
      "SetFlagApplications": {
        "type": "object",
        "properties": {
          "applicationIds": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Id"
            },
            "description": "Empty: the flag applies to every application. No application twice."
          }
        },
        "required": [
          "applicationIds"
        ],
        "additionalProperties": false
      },
      "Overrides": {
        "type": "object",
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "userId": {
                  "$ref": "#/components/schemas/UserId"
                },
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "userId",
                "enabled"
              ]
            },
            "description": "Ordered by user id."
          },
          "segments": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "segmentId": {
                  "$ref": "#/components/schemas/Id"
                },
                "enabled": {
                  "type": "boolean"
                }
              },
              "required": [
                "segmentId",
                "enabled"
              ]
            },
            "description": "Ordered by segment id."
          }
        },
        "required": [
          "users",
          "segments"
        ],
        "description": "The overrides of one flag in one environment."
      },
      "UserId": {
        "type": "string",
        "minLength": 1,
        "maxLength": 256,
        "allOf": [
          {
            "type": "string",
            "pattern": "^[^\\u0000]*$"
          },
          {
            "type": "string",
            "pattern": "^(?!\\.{1,2}$)"
          }
        ],
        "description": "The id the customer's app gives the SDK for a user: any text of 1 to 256 characters but NUL, other than `.` and `..`, compared exactly.",
        "example": "ana"
      },
      "SetOverride": {
        "type": "object",
        "properties": {
          "enabled": {
            "nullable": true,
            "description": "The override; null clears it.",
            "type": "boolean"
          },
          "confirm": {
            "description": "Needed for a member's change in a protected environment.",
            "type": "boolean",
            "enum": [
              true
            ]
          }
        },
        "required": [
          "enabled"
        ],
        "additionalProperties": false
      },
      "AppUserList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppUser"
            }
          }
        },
        "required": [
          "items"
        ],
        "description": "At most 100, ordered by id."
      },
      "AppUser": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/UserId"
          },
          "name": {
            "nullable": true,
            "type": "string",
            "maxLength": 256,
            "pattern": "^[^\\u0000]*$",
            "example": "Ana Petrović"
          },
          "firstSeenAt": {
            "nullable": true,
            "description": "When an SDK first reported the user; null until then.",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          },
          "lastSeenAt": {
            "nullable": true,
            "description": "When an SDK last reported the user, at most once a day.",
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z|([+-](?:[01]\\d|2[0-3]):[0-5]\\d)))$"
          }
        },
        "required": [
          "id",
          "name",
          "firstSeenAt",
          "lastSeenAt"
        ]
      },
      "UpsertUsers": {
        "type": "object",
        "properties": {
          "users": {
            "minItems": 1,
            "maxItems": 1000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "$ref": "#/components/schemas/UserId"
                },
                "name": {
                  "type": "string",
                  "maxLength": 256,
                  "pattern": "^[^\\u0000]*$",
                  "example": "Ana Petrović"
                }
              },
              "required": [
                "id"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": [
          "users"
        ],
        "additionalProperties": false,
        "description": "Adds the users that are new and renames the others; a user without `name` keeps its name. No user id twice."
      },
      "UpsertedUsers": {
        "type": "object",
        "properties": {
          "created": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "updated": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "created",
          "updated"
        ]
      },
      "SegmentList": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/Segment"
            }
          }
        },
        "required": [
          "items"
        ]
      },
      "Segment": {
        "type": "object",
        "properties": {
          "id": {
            "$ref": "#/components/schemas/Id"
          },
          "projectId": {
            "$ref": "#/components/schemas/Id"
          },
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          }
        },
        "required": [
          "id",
          "projectId",
          "key",
          "name"
        ]
      },
      "CreateSegment": {
        "type": "object",
        "properties": {
          "key": {
            "$ref": "#/components/schemas/Key"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          }
        },
        "required": [
          "key",
          "name"
        ],
        "additionalProperties": false
      },
      "RenameSegment": {
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 200,
            "description": "Shown in the panel. Can be changed; the key cannot."
          }
        },
        "required": [
          "name"
        ],
        "additionalProperties": false
      },
      "SegmentMembers": {
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AppUser"
            }
          }
        },
        "required": [
          "items"
        ],
        "description": "Every member, ordered by id."
      },
      "SetSegmentMembers": {
        "type": "object",
        "properties": {
          "userIds": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserId"
            }
          }
        },
        "required": [
          "userIds"
        ],
        "additionalProperties": false,
        "description": "The whole membership. A user id never seen before is added as a user. No user id twice."
      },
      "ChangeSegmentMembers": {
        "type": "object",
        "properties": {
          "add": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserId"
            }
          },
          "remove": {
            "maxItems": 1000,
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserId"
            }
          }
        },
        "additionalProperties": false,
        "description": "Adds and removes members. A user id never seen before is added as a user. At least one user in `add` or `remove`, and none in both."
      }
    },
    "parameters": {
      "ExpectedOrganization": {
        "name": "x-dipswitch-organization",
        "in": "header",
        "required": false,
        "schema": {
          "type": "string"
        },
        "description": "The organization ID expected by a caller using a login session. API tokens use the organization attached to the token."
      }
    },
    "responses": {
      "OrganizationChanged": {
        "description": "A login session has a different active organization than the header names. The error code is `organization_changed`.",
        "content": {
          "application/json": {
            "schema": {
              "$ref": "#/components/schemas/Error"
            }
          }
        }
      }
    }
  },
  "security": [
    {
      "token": []
    },
    {
      "session": []
    }
  ]
}
