{
  "openapi": "3.2.0",
  "info": {
    "title": "TerraScale Auth API",
    "version": "v1"
  },
  "servers": [
    {
      "url": "https://auth.terrascale.tech"
    }
  ],
  "paths": {
    "/agents/oauth/authorize": {
      "get": {
        "tags": [
          "Sign in as agent"
        ],
        "summary": "Sign in as agent: authorization endpoint",
        "description": "The authorization endpoint of the agent issuer {origin}/agents, by GET with query parameters or POST with the same parameters form-encoded. Authorization code flow only (response_type=code) with PKCE code_challenge_method=S256; scopes openid, profile and, for a registered client only, owner_email. client_id is either the canonical https origin the app controls (lowercase ASCII host, punycode for international names, no default port, path, trailing slash or userinfo), with redirect_uri an https URL on that same origin, or the client_id of a registered client (POST /v1/terrascale/agentid-clients), with redirect_uri exactly one of its redirect_uris. An origin client asking for owner_email is answered invalid_scope at the redirect_uri. Without a proof for this exact request it answers a one-time transaction that lives 5 minutes: an HTML page that reloads itself every 2 seconds, or with Accept: application/json a JSON body with status pending, transaction_id, proof_url, client_id, client_name (the origin, or a registered client's name) and expires_at. Both carry Link: <proof_url>; rel=\"agent-proof\". Once an agent posted a valid proof to proof_url, the same request (any parameter order) redirects to redirect_uri with code, state and iss, once. A request without the openid scope is answered invalid_scope at the redirect_uri before any transaction opens. An expired or used transaction answers 400 expired_transaction. Errors after client and redirect validation go to the client. Per caller address and per client_id it allows 120 and 600 requests a minute; more answer 429 rate_limited with Retry-After.",
        "operationId": "agentid_authorize",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentIdPendingBody"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "post": {
        "tags": [
          "Sign in as agent"
        ],
        "summary": "Sign in as agent: authorization endpoint",
        "description": "The authorization endpoint of the agent issuer {origin}/agents, by GET with query parameters or POST with the same parameters form-encoded. Authorization code flow only (response_type=code) with PKCE code_challenge_method=S256; scopes openid, profile and, for a registered client only, owner_email. client_id is either the canonical https origin the app controls (lowercase ASCII host, punycode for international names, no default port, path, trailing slash or userinfo), with redirect_uri an https URL on that same origin, or the client_id of a registered client (POST /v1/terrascale/agentid-clients), with redirect_uri exactly one of its redirect_uris. An origin client asking for owner_email is answered invalid_scope at the redirect_uri. Without a proof for this exact request it answers a one-time transaction that lives 5 minutes: an HTML page that reloads itself every 2 seconds, or with Accept: application/json a JSON body with status pending, transaction_id, proof_url, client_id, client_name (the origin, or a registered client's name) and expires_at. Both carry Link: <proof_url>; rel=\"agent-proof\". Once an agent posted a valid proof to proof_url, the same request (any parameter order) redirects to redirect_uri with code, state and iss, once. A request without the openid scope is answered invalid_scope at the redirect_uri before any transaction opens. An expired or used transaction answers 400 expired_transaction. Errors after client and redirect validation go to the client. Per caller address and per client_id it allows 120 and 600 requests a minute; more answer 429 rate_limited with Retry-After.",
        "operationId": "agentid_authorize_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentIdPendingBody"
                }
              },
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/agents/v1/authorize/{transaction}/proof": {
      "post": {
        "tags": [
          "Sign in as agent"
        ],
        "summary": "Sign in as agent: prove the agent",
        "description": "Unauthenticated; the agent answers the transaction its authorization request opened. proof is an ES256 JWT signed by an active key of an active agent of a TerraScale account: header kid the key's kid and no jwk, jku, x5u, x5c or crit; iss and sub the agent id; aud exactly this URL; txn the transaction id; client_id the client_id of the authorization request; a jti used once per agent; integer iat and exp with exp at most 300 seconds after iat (30 seconds of clock skew). A valid proof answers 204 and the same authorization request then completes once. Every other proof (bad signature, header, claims or times, a replayed jti, a revoked or expired agent or key, an owner disabled or signed out everywhere since the agent was created, a transaction already proved) answers the same 401 invalid_proof and reveals nothing. An unknown, expired or used transaction answers 404 expired_transaction. Per agent 30 and per client_id 600 proofs a minute; more answer 429 rate_limited with Retry-After.",
        "operationId": "agentid_prove",
        "parameters": [
          {
            "name": "transaction",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentIdProofRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/agents/oauth/token": {
      "post": {
        "tags": [
          "Sign in as agent"
        ],
        "summary": "Sign in as agent: token endpoint",
        "description": "application/x-www-form-urlencoded grant_type=authorization_code with code, redirect_uri and code_verifier. An origin client is public: it sends client_id and no secret. A registered client (POST /v1/terrascale/agentid-clients) authenticates with client_secret_basic (HTTP Basic client_id:client_secret) or client_secret_post (client_id and client_secret in the form); a missing, wrong, retired or deleted client's secret answers 401 invalid_client. The registration, its owner and the secret it was checked against are asserted in the same save that consumes the code, so a rotation without grace or a deletion that commits first fails the redemption with invalid_grant and leaves the code unconsumed. The code lives 60 seconds and is redeemed once; a second redemption answers invalid_grant. The agent, the key that proved the sign-in and the owner are checked again, and their row versions are asserted in the same save that consumes the code, so a revocation that commits first fails the redemption with invalid_grant: a revoked or expired agent, a revoked proof key, or an owner disabled or signed out everywhere answers invalid_grant. The answer has id_token (ES256, signed by the agent issuer's keys in {origin}/agents/.well-known/jwks.json, aud the client_id; for a registered client granted owner_email it carries owner_email and owner_email_verified only while the agent's owner shares their email for this agent), an encrypted access_token for the userinfo endpoint only, token_type Bearer, expires_in 300 and scope; never a refresh token. Every POST charges the caller address's shared token budget (as /terrascale/oauth/token), and each client_id 600 and each agent 60 redemptions a minute; more answer 429 rate_limited with Retry-After. Storage that does not answer answers 503 temporarily_unavailable.",
        "operationId": "agentid_token",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequestForm"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/agents/oauth/userinfo": {
      "get": {
        "tags": [
          "Sign in as agent"
        ],
        "summary": "Sign in as agent: userinfo endpoint",
        "description": "GET, or POST form-encoded, with an access token of the agent issuer. Answers sub (pairwise: stable for one agent and client_id, unrelated across clients) and actor_type agent, with the profile scope name (the agent's name) and owner_sub (the owner's pairwise subject for this client_id), and for a registered client granted the owner_email scope owner_email and owner_email_verified, only while the owner shares their email for this agent (share_owner_email, read on every call in one query with the client's registration). Claims not granted or not shared are omitted. The agent, the key that proved the sign-in and the owner are read again on every call: a revoked or expired agent, a revoked proof key, or an owner disabled or signed out everywhere answers 401 invalid_token, as does a token of a registered client that was deleted or whose account was disabled, and a token of any other issuer. Answers carry Cache-Control: no-store.",
        "operationId": "agentid_userinfo",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentIdUserInfoBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "post": {
        "tags": [
          "Sign in as agent"
        ],
        "summary": "Sign in as agent: userinfo endpoint",
        "description": "GET, or POST form-encoded, with an access token of the agent issuer. Answers sub (pairwise: stable for one agent and client_id, unrelated across clients) and actor_type agent, with the profile scope name (the agent's name) and owner_sub (the owner's pairwise subject for this client_id), and for a registered client granted the owner_email scope owner_email and owner_email_verified, only while the owner shares their email for this agent (share_owner_email, read on every call in one query with the client's registration). Claims not granted or not shared are omitted. The agent, the key that proved the sign-in and the owner are read again on every call: a revoked or expired agent, a revoked proof key, or an owner disabled or signed out everywhere answers 401 invalid_token, as does a token of a registered client that was deleted or whose account was disabled, and a token of any other issuer. Answers carry Cache-Control: no-store.",
        "operationId": "agentid_userinfo_post",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentIdUserInfoBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/terrascale/agentid-clients": {
      "post": {
        "tags": [
          "Sign in as agent"
        ],
        "summary": "Register a Sign in as agent client",
        "description": "Registers a confidential client of the agent issuer {origin}/agents for the signed-in TerraScale account. name is 1 to 64 characters; redirect_uris holds 1 to 10 distinct absolute https URLs in canonical form (lowercase scheme and host, no default port, userinfo or fragment), matched exactly at authorization. The answer has client_id (a ULID) and client_secret, shown once; only its SHA-256 digest is kept. The client authenticates at {origin}/agents/oauth/token with client_secret_basic or client_secret_post and may request the owner_email scope. An account has at most 10 clients (409 client_limit). Needs a create_oauth_client step-up proof in X-TerraScale-Step-Up-Proof, spent in the same save as the change, so a sign-out everywhere that commits first refuses it with 409; a token an agent acts with is 403 owner_required.",
        "operationId": "create_agentid_client",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentIdClientRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentIdClientBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Sign in as agent"
        ],
        "summary": "List your Sign in as agent clients",
        "description": "The Sign in as agent clients the signed-in TerraScale account registered, at most 10, without their secrets. previous_secret_expires_at is set while a rotated-out secret still works. A token an agent acts with is 403 owner_required.",
        "operationId": "list_agentid_clients",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentIdClientPageBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/agentid-clients/{client_id}": {
      "delete": {
        "tags": [
          "Sign in as agent"
        ],
        "summary": "Delete a Sign in as agent client",
        "description": "Deletes a client the signed-in account owns: its next authorization request, token redemption and secret are refused at once. Another account's client is 404. Needs a delete_oauth_client step-up proof in X-TerraScale-Step-Up-Proof, spent in the same save as the change, so a sign-out everywhere that commits first refuses it with 409; a token an agent acts with is 403 owner_required.",
        "operationId": "delete_agentid_client",
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/agentid-clients/{client_id}/secret/rotate": {
      "post": {
        "tags": [
          "Sign in as agent"
        ],
        "summary": "Rotate a Sign in as agent client's secret",
        "description": "Issues a new client_secret for a client the signed-in account owns and answers it exactly once; only its digest is kept. The previous secret keeps working for grace_seconds (default 3600, 0 to 86400), then is refused like any wrong secret; rotating again inside the grace replaces the previous secret. Another account's client is 404. Needs a rotate_oauth_client step-up proof in X-TerraScale-Step-Up-Proof, spent in the same save as the change, so a sign-out everywhere that commits first refuses it with 409; a token an agent acts with is 403 owner_required.",
        "operationId": "rotate_agentid_client_secret",
        "parameters": [
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateAgentIdClientRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentIdClientSecretBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{project}/agents/{agent}/keys": {
      "post": {
        "tags": [
          "Agents"
        ],
        "summary": "Add agent key",
        "description": "An agent has at most two active keys. Agent identities. Requires the admin role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "add_agent_key",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AddAgentKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentKeyBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/ui/{slug}/agent-enrollments": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Approve or deny an AI agent",
        "description": "Same-origin form post with user_code and decision=approve or deny from a browser with a live project session (otherwise 403). Approve needs a fresh approve_agent step-up bound to the enrollment: without one it redirects to /ui/{slug}/step-up/{id} and back here. It then creates the agent owned by the signed-in user with the requested scopes the agent policy allows, under the create_agent limits and events, and the code stops working. Deny makes the agent's next poll answer access_denied. A code works once; an unknown, expired or decided code answers 400.",
        "operationId": "ui_agent_enrollment_decide",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "302": {
            "description": "Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Approve an AI agent",
        "description": "The verification page of agent enrollment, branded for the project. Without a live project session it redirects to /ui/{slug}/sign-in and returns with the same user_code. With user_code it shows the agent's name, the requested scopes the agent policy allows, whether it asks to act as itself, its key fingerprint and the signed-in account, with Approve and Deny; opening it never decides. Each code lookup charges the hosted IP budget and 20 per user per 15 minutes (429 with Retry-After).",
        "operationId": "ui_agent_enrollment",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "302": {
            "description": "Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/{project}/users/{user}/agents": {
      "post": {
        "tags": [
          "Agents"
        ],
        "summary": "Create agent",
        "description": "Agent identities. Requires the admin role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "create_agent",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateAgentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Agents"
        ],
        "summary": "List user agents",
        "description": "limit is 1 to 100 (default 50) and after the previous page's next. Agent identities. Requires the viewer role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_user_agents",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Agents per page, default 50.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/agents/{agent}": {
      "get": {
        "tags": [
          "Agents"
        ],
        "summary": "Get agent",
        "description": "Agent identities. Requires the viewer role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "get_agent",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "Agents"
        ],
        "summary": "Revoke agent",
        "description": "Idempotent; the agent stays listed as revoked. Agent identities. Requires the admin role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "revoke_agent",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/agent-policy": {
      "get": {
        "tags": [
          "Agents"
        ],
        "summary": "Get agent policy",
        "description": "Agent identities. Requires the viewer role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "get_agent_policy",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPolicyBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Agents"
        ],
        "summary": "Set agent policy",
        "description": "Agent identities. Requires the admin role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "set_agent_policy",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentPolicyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPolicyBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/me/agents": {
      "get": {
        "tags": [
          "Agents"
        ],
        "summary": "List your agents",
        "description": "The agents the signed-in TerraScale account owns, enrolled through /v1/terrascale/agent-enrollments, with their scopes (mcp:read, mcp:write), keys and last_used_at.",
        "operationId": "list_account_agents",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Agents per page, default 50.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{project}/agents": {
      "get": {
        "tags": [
          "Agents"
        ],
        "summary": "List agents",
        "description": "owner filters by the owning user id; limit is 1 to 100 (default 50) and after the previous page's next. Agent identities. Requires the viewer role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_agents",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "owner",
            "in": "query",
            "description": "Only agents owned by this user id; an id with no agents in the project answers an empty page.",
            "schema": {
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Agents per page, default 50.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/me/agents": {
      "get": {
        "tags": [
          "Agents"
        ],
        "summary": "List self agents",
        "description": "The signed-in end user manages only the agents they own. Uses the project's hosted session cookie; mutations require the auth public Origin.",
        "operationId": "list_self_agents",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Agents per page, default 50.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "SessionCookie": [ ]
          }
        ]
      }
    },
    "/v1/{project}/agent-enrollments/{enrollment}/token": {
      "post": {
        "tags": [
          "Agents"
        ],
        "summary": "Poll agent enrollment",
        "description": "Unauthenticated; proof is an ES256 JWT signed by the enrolled private key with aud this exact URL, a jti, iat, and exp at most 300 seconds ahead, each iat later than the previous accepted poll's. Without such a proof the answer is 401 invalid_proof and reveals nothing. Otherwise 400 authorization_pending, slow_down (sooner than interval), access_denied or expired_token, or 200 with agent_id and kid once approved. The result is answered once; later polls answer expired_token.",
        "operationId": "redeem_agent_enrollment",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "enrollment",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentEnrollmentTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentEnrollmentTokenBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/terrascale/me/agents/{agent}": {
      "delete": {
        "tags": [
          "Agents"
        ],
        "summary": "Revoke your agent",
        "description": "Revokes an agent the signed-in TerraScale account owns, and every key of it: its next token, exchange or platform call is refused. Another account's agent is 404; revoking again is 204.",
        "operationId": "revoke_account_agent",
        "parameters": [
          {
            "name": "agent",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Agents"
        ],
        "summary": "Share your email with apps your agent signs in to",
        "description": "Sets share_owner_email (default false) on an agent the signed-in TerraScale account owns. While it is true, a registered Sign in as agent client that was granted the owner_email scope receives owner_email and owner_email_verified for sign-ins of this agent; while it is false they are omitted. UserInfo reads the flag on every call; ID tokens already issued keep what they carry until they expire (5 minutes). Another account's agent is 404; a token an agent acts with is 403 owner_required.",
        "operationId": "share_account_agent_owner_email",
        "parameters": [
          {
            "name": "agent",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AgentSharingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{project}/agents/{agent}/keys/{kid}": {
      "delete": {
        "tags": [
          "Agents"
        ],
        "summary": "Revoke agent key",
        "description": "Idempotent; the key stays listed with revoked_at. Agent identities. Requires the admin role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "revoke_agent_key",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kid",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/me/agents/{agent}": {
      "delete": {
        "tags": [
          "Agents"
        ],
        "summary": "Revoke self agent",
        "description": "The signed-in end user manages only the agents they own. Uses the project's hosted session cookie; mutations require the auth public Origin.",
        "operationId": "revoke_self_agent",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "agent",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "SessionCookie": [ ]
          }
        ]
      }
    },
    "/v1/{project}/agent-enrollments": {
      "post": {
        "tags": [
          "Agents"
        ],
        "summary": "Start agent enrollment",
        "description": "Unauthenticated. An agent asks to be enrolled with its own public P-256 JWK (the same rules as create_agent). {project} is a project id, or terrascale for an agent of a TerraScale account (allowed scopes mcp:read and mcp:write, fixed by TerraScale). Answers enrollment_id, a single-use user_code, verification_uri (the tenant's hosted approval page), verification_uri_complete, expires_in (600) and interval (5). The user of that tenant who will own the agent signs in there, verifies again and approves or denies. Limited to 10 per IP per 15 minutes and 300 per tenant per hour, the platform tenant included (429 with Retry-After). A storage conflict answers 409 version_conflict; start again.",
        "operationId": "start_agent_enrollment",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartAgentEnrollmentRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentEnrollmentBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/admin/{asset}": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Load bundled administrator assets",
        "operationId": "admin_asset",
        "parameters": [
          {
            "name": "asset",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/fonts/{asset}": {
      "get": {
        "tags": [
          "Admin"
        ],
        "summary": "Load bundled fonts",
        "operationId": "font_asset",
        "parameters": [
          {
            "name": "asset",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/{project}/attack-protection/unlock": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Redeem a single-use account unlock link",
        "description": " Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "confirm_unlock_project_account",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "required": [
                  "user",
                  "token"
                ],
                "type": "object",
                "properties": {
                  "user": {
                    "maxLength": 26,
                    "minLength": 26,
                    "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
                    "type": "string"
                  },
                  "token": {
                    "maxLength": 26,
                    "minLength": 26,
                    "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
                    "type": "string"
                  }
                }
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/plain": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Confirm a single-use account unlock link",
        "description": " Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "unlock_project_account",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "query",
            "required": true,
            "schema": {
              "maxLength": 26,
              "minLength": 26,
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
              "type": "string"
            }
          },
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "maxLength": 26,
              "minLength": 26,
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/email/alert": {
      "post": {
        "tags": [
          "Email"
        ],
        "summary": "Notify the current organization owners of an alert transition",
        "description": "Dashboard ClientBasic email authority. ts-auth resolves current owners internally; no recipient identities are returned. Durable dedupe per organization, alert and state, so one message per transition. Delivery status semantics match email_allowance_send.",
        "operationId": "email_alert_send",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailAlertRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllowanceEmailResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/email/allowance": {
      "post": {
        "tags": [
          "Email"
        ],
        "summary": "Notify the current organization owners of an allowance threshold",
        "description": "Dashboard ClientBasic email authority. ts-auth resolves current owners internally; no recipient identities are returned. Durable dedupe per organization, UTC month, metric and threshold. Explicit provider rate limits and missing email configuration may be retried. A crash or ambiguous provider acceptance remains unknown and is never automatically resent: the SMTP provider has no confirmed idempotency contract here. Accepted means provider acceptance, not inbox delivery.",
        "operationId": "email_allowance_send",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AllowanceEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AllowanceEmailResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/email/admission": {
      "post": {
        "tags": [
          "Email"
        ],
        "summary": "Reserve one infrastructure notification attempt",
        "description": "ts-alerts only. Domain-separated HMAC credential derived from CLOUDFLARE_EMAIL_TOKEN (Vault secret gru-1-cloudflare-email-token). A fresh ULID may grant one send, within ten seconds. Admitted IDs never grant another attempt; refusals and ambiguous responses suppress email. No retry of an unknown provider outcome.",
        "operationId": "email_admission",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailAdmissionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailAdmissionResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "mailAdmission": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/email/branding": {
      "get": {
        "tags": [
          "Email"
        ],
        "summary": "Read email branding",
        "description": "The saved branding (null fields use the default) and the default of every field.",
        "operationId": "email_branding_get",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailBrandingResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Email"
        ],
        "summary": "Save email branding",
        "description": "Replaces the whole branding (null or omitted fields use the default) if the configuration is still at expected_version, and returns the new version. Colours are #rrggbb; URLs are https; logo_url needs logo_width and logo_height.",
        "operationId": "email_branding_put",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailBrandingRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailBrandingResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/email/templates/{kind}/{locale}": {
      "get": {
        "tags": [
          "Email"
        ],
        "summary": "Read an email template",
        "description": "kind is sign_in_code, magic_link, verify_email, password_reset, invitation, mfa_code, new_device, lockout, email_change_code or email_change_notice; locale is en or pt-BR. Lockout copy uses locked_until, an absolute UTC timestamp.",
        "operationId": "email_template_get",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Email"
        ],
        "summary": "Save an email template",
        "description": "Replaces the override (null fields use the default; all null resets the template) if the configuration is still at expected_version. Copy is plain text with the kind's {{ name }} placeholders only; a blank line in body starts a paragraph. The code, button, expiry line and footer always come from the layout.",
        "operationId": "email_template_put",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "kind",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "locale",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTemplateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/email/versions/{version}": {
      "get": {
        "tags": [
          "Email"
        ],
        "summary": "Read an email configuration version",
        "description": "The branding and overridden templates of one version; version 0 is the defaults.",
        "operationId": "email_version_get",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailConfig"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/email/templates": {
      "get": {
        "tags": [
          "Email"
        ],
        "summary": "List email templates",
        "description": "Every email kind in every locale, whether its copy is overridden, and the placeholders it may use.",
        "operationId": "email_templates_list",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTemplateListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/email/versions": {
      "get": {
        "tags": [
          "Email"
        ],
        "summary": "List email configuration versions",
        "description": "The newest saved versions, newest first: limit (1 to 100, default 20). Version 0, the defaults, is not listed but can be read and restored.",
        "operationId": "email_versions_list",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailVersionListResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/email/preview": {
      "post": {
        "tags": [
          "Email"
        ],
        "summary": "Preview an email",
        "description": "Renders kind in locale with synthetic values (code 123456; lockout until 15 minutes from now in UTC, without a code, link or expiry line) and the saved configuration, or the draft branding and fields given. Nothing is saved or sent. color_scheme light or dark pins an auto theme for the preview.",
        "operationId": "email_preview",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailPreviewRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailPreviewResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/email/versions/{version}/restore": {
      "post": {
        "tags": [
          "Email"
        ],
        "summary": "Roll back the email configuration",
        "description": "Saves version's branding and templates as a new version (change rollback:{version}) if the configuration is still at expected_version. History is never rewritten.",
        "operationId": "email_version_restore",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "version",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailRestoreRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailConfig"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/email/support": {
      "post": {
        "tags": [
          "Email"
        ],
        "summary": "Send a customer support request",
        "description": "Dashboard ClientBasic email authority. ts-auth checks the user's access to the organization and project, sends the request to support@terrascale.tech with Reply-To set to the user's address, persists acceptance, then attempts an acknowledgement. Status describes the support message; optional acknowledgementStatus describes the separate acknowledgement. Repeats return recorded outcomes without resending either message, except a retryable support send releases the id for a safe retry. Unknown outcomes are never retried. 429 rate_limited past 5 requests per user per hour. Accepted means provider acceptance, not inbox delivery.",
        "operationId": "email_support_send",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailSupportRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailSupportResponse"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/email/test": {
      "post": {
        "tags": [
          "Email"
        ],
        "summary": "Send a test email",
        "description": "Renders like preview (auto colour scheme) and sends it to `to` with the subject prefixed [Test]. 202 confirms provider acceptance, not inbox delivery. Rejected or unknown acceptance returns 502; do not automatically retry unknown acceptance. At most 10 per instance per minute; capacity refusals also return 429 with Retry-After.",
        "operationId": "email_test_send",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailTestRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailTestResponse"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "422": {
            "description": "Unprocessable Entity",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/ui/{slug}/impersonation/end": {
      "post": {
        "tags": [
          "Impersonation"
        ],
        "summary": "End the current impersonation",
        "description": "Same-origin form post; ends the impersonation and clears its isolated browser cookie.",
        "operationId": "end_hosted_impersonation",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/{project}/impersonations/{impersonation}/end": {
      "post": {
        "tags": [
          "Impersonation"
        ],
        "summary": "End an impersonation",
        "description": "Requires a person with the project admin role. Ends the selected impersonation and records a manual end in the audit log and event outbox. Person-only step-up operation; project API keys answer 403 person_required.",
        "operationId": "end_impersonation",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "impersonation",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{project}/impersonations": {
      "get": {
        "tags": [
          "Impersonation"
        ],
        "summary": "List active impersonations",
        "description": "Requires a person with the project admin role. Returns up to 100 active impersonations in the project. Person-only step-up operation; project API keys answer 403 person_required.",
        "operationId": "list_impersonations",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImpersonationPage"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{project}/users/{user}/impersonations": {
      "post": {
        "tags": [
          "Impersonation"
        ],
        "summary": "Issue a single-use impersonation ticket",
        "description": "Requires a person with the project admin role. Tickets last 60 seconds and bind one client; starting requires a start_impersonation step-up proof. Person-only step-up operation; project API keys answer 403 person_required.",
        "operationId": "start_impersonation",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-TerraScale-Step-Up-Proof",
            "in": "header",
            "description": "Fresh approved single-use ts-auth audience proof for this operation's purpose. Account deletion alternatively accepts its exact preauthorized deletion receipt continuation.",
            "required": true,
            "schema": {
              "maxLength": 70,
              "minLength": 70,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartImpersonationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImpersonationTicket"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/healthz": {
      "get": {
        "tags": [
          "Observability"
        ],
        "summary": "Liveness probe",
        "operationId": "healthz",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StatusBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/readyz": {
      "get": {
        "tags": [
          "Observability"
        ],
        "summary": "Readiness probe",
        "description": "Returns 200 only when the configured TerraBase auth database answers a read-only query of its schema journal showing every migration applied with its recorded checksum, the serving issuer has signing keys with valid authenticated public metadata, and this replica's startup signing-ring bootstrap has completed. Startup seeds the platform owner and projects and provisions the first encrypted signing key when absent; existing unusable keys fail closed without replacement. A background check runs five seconds after the previous one ends, with an eight-second deadline, and this endpoint answers its latest result. Answers not ready before the first check completes and when the latest check is older than fifteen seconds.",
        "operationId": "readyz",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadyBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReadyBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/{slug}/oauth/authorize": {
      "get": {
        "tags": [
          "OAuth"
        ],
        "summary": "Authorization endpoint",
        "description": "GET with query parameters or POST with the same parameters as application/x-www-form-urlencoded. Authorization code flow (response_type=code) with PKCE code_challenge_method=S256 required. Without a live tsauth_session cookie the browser is redirected to /ui/{slug}/sign-in and returns here by GET with the same parameters. prompt=none answers login_required without a session or with one older than max_age. prompt=login, or a live session older than max_age, sends the browser to a deliberate sign-in: the resumed request drops login from prompt and carries ts_login_after (Unix milliseconds), which only a session created after that time satisfies in place of max_age, so it cannot be met by an older session. prompt=consent and select_account are not supported or advertised and answer invalid_request; prompt and ts_login_after may appear only once. Errors after client and redirect validation are redirected to the client. The response is a 302 to the client, or with response_mode=form_post a 200 page that posts the result to it. A project's configured session lifetime applies from the original authentication, including after rotation; the next session check persists any reduction, so a later increase cannot revive that session. A nonempty project redirect allowlist additionally requires an exact redirect_uri match; a disallowed URI receives no redirect, including error and form_post responses. An empty list keeps each client's registered URI validation. Sessions of active MFA users must come from a sign-in that proved the second factor; corrupt or unavailable factor state fails closed with temporarily_unavailable.",
        "operationId": "oauth_authorize",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Authorization endpoint",
        "description": "GET with query parameters or POST with the same parameters as application/x-www-form-urlencoded. Authorization code flow (response_type=code) with PKCE code_challenge_method=S256 required. Without a live tsauth_session cookie the browser is redirected to /ui/{slug}/sign-in and returns here by GET with the same parameters. prompt=none answers login_required without a session or with one older than max_age. prompt=login, or a live session older than max_age, sends the browser to a deliberate sign-in: the resumed request drops login from prompt and carries ts_login_after (Unix milliseconds), which only a session created after that time satisfies in place of max_age, so it cannot be met by an older session. prompt=consent and select_account are not supported or advertised and answer invalid_request; prompt and ts_login_after may appear only once. Errors after client and redirect validation are redirected to the client. The response is a 302 to the client, or with response_mode=form_post a 200 page that posts the result to it. A project's configured session lifetime applies from the original authentication, including after rotation; the next session check persists any reduction, so a later increase cannot revive that session. A nonempty project redirect allowlist additionally requires an exact redirect_uri match; a disallowed URI receives no redirect, including error and form_post responses. An empty list keeps each client's registered URI validation. Sessions of active MFA users must come from a sign-in that proved the second factor; corrupt or unavailable factor state fails closed with temporarily_unavailable.",
        "operationId": "oauth_authorize_post",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/{project}/custom-tokens": {
      "post": {
        "tags": [
          "Custom tokens"
        ],
        "summary": "Mint a custom token for one end user of the project",
        "description": "Backend only. Requires a live project API key of this project with auth:tokens:mint and no database restriction; no other scope is needed, and the key's and project's IP allowlists apply. The body names a canonical ULID user_id, an optional database ULID the token is restricted to, and optional claims (at most 32 members and 1000 bytes serialized, names [a-z][a-z0-9_]{0,62}, values strings of at most 256 characters, finite numbers, booleans, or arrays of at most 64 strings or 64 numbers). Unknown members are rejected. The token is an at+jwt signed by the project tenant's key ring under the tenant issuer, with token_use custom and only the project's TerraBase data audiences, so ts-auth's own endpoints refuse it. It expires after 300 seconds and is not refreshable; revoking the key stops minting at once. Shares the token IP budget and limits each key to 1000 requests a minute. Never send the project key to a browser. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "mintCustomToken",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CustomTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CustomTokenBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Minimum delay in whole seconds before retrying a rate-limited request.",
                "required": true,
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/{slug}/oauth/device": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Device authorization endpoint",
        "description": "RFC 8628 for the public ts CLI client (client_id 00000000000000000000000007, display name ts-cli), application/x-www-form-urlencoded client_id and optional scope (openid email profile offline_access). Answers device_code, user_code, verification_uri ({public origin}/ui/terrascale/device), verification_uri_complete (adds ?user_code=), expires_in (1800) and interval (5). The user signs in and approves or denies on that page; the CLI polls the token endpoint with grant_type=urn:ietf:params:oauth:grant-type:device_code and gets authorization_pending, slow_down (polled sooner than interval), access_denied or expired_token as RFC 8628 §3.5 says. Calls share the token endpoint's per-IP minute budget; exhaustion answers 429 rate_limited with Retry-After.",
        "operationId": "oauth_device_authorization",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/device": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Approve or deny a device",
        "description": "Same-origin form post with user_code and decision=approve or deny, from a browser with a live session (otherwise 403). Approve signs the device in as the session's user with the scopes it asked for; an active MFA user's session must have proved the second factor (otherwise 403). Deny makes the device's next poll answer access_denied. A code works once; an unknown, expired or decided code answers 400. Lookups share the device page's limits (429 with Retry-After).",
        "operationId": "ui_device_decide",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Hosted device page",
        "description": "The RFC 8628 verification page. Without a live tsauth_session cookie it redirects to /ui/{slug}/sign-in and returns here with the same user_code. With user_code it shows the code, the client and the signed-in account with Approve and Deny buttons; opening it never approves. Each code lookup charges the IP sign-in call bucket (120, refilling 30 per minute) and 20 per user per 15 minutes; exhaustion answers 429 with Retry-After.",
        "operationId": "ui_device",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "302": {
            "description": "Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/{slug}/.well-known/openid-configuration": {
      "get": {
        "tags": [
          "OAuth"
        ],
        "summary": "OpenID Provider metadata",
        "description": "OpenID Connect Discovery 1.0 metadata for the issuer {public origin}/{slug}: terrascale, or an existing customer project's id. Other slugs, including TerraScale's own internal projects (00000000000000000000000001 to 00000000000000000000000007 and every project of its internal organization), answer 404. A project tenant serves authorization-code and refresh flows for its interactive clients and end users, and client-credentials grants for its machine apps. Device and token-exchange grants are platform-only.",
        "operationId": "oidc_discovery",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/{slug}/oauth/anonymous": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Guest sign-in",
        "description": "application/x-www-form-urlencoded client_id, for a project client with allow_anonymous; a confidential client also authenticates with client_secret_basic or client_secret_post, and no other parameter is accepted. Creates a guest user, which has no email or password credential and counts as a user of the project, and answers the token endpoint's access, refresh and ID tokens with is_anonymous: true and the scopes openid and offline_access; the access token names the project data audiences like any user sign-in. Only a project whose sign_up_mode is public admits guests (403 access_denied otherwise). Each client admits 30 guests a minute and each address 10 a minute per project (429 rate_limited with Retry-After), on top of the token endpoint's per-peer budget. A client without allow_anonymous answers 400 unauthorized_client, and the platform issuer answers 400 unsupported_grant_type.",
        "operationId": "oauth_anonymous",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          },
          { }
        ]
      }
    },
    "/{slug}/.well-known/jwks.json": {
      "get": {
        "tags": [
          "OAuth"
        ],
        "summary": "JSON Web Key Set",
        "description": "Every ES256 key in the tenant's key ring (terrascale, or an existing customer project's id; others, including TerraScale's own internal projects, answer 404), so tokens signed before a rotation keep validating. A key is published before it signs.",
        "operationId": "oidc_jwks",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/{slug}/oauth/logout": {
      "get": {
        "tags": [
          "OAuth"
        ],
        "summary": "End-session endpoint",
        "description": "OpenID Connect RP-Initiated Logout 1.0, by GET with query parameters or POST with the same parameters as application/x-www-form-urlencoded. post_logout_redirect_uri must exactly match one registered for the client identified by client_id or id_token_hint and, for a project with a nonempty redirect allowlist, an entry in that list. A disallowed project URI answers a local error without navigation. The answer is otherwise the hosted Signed out page; with a validated post_logout_redirect_uri it continues there at once (with state, if sent), and a Continue link to the same address appears after 1.5 seconds for a browser that blocks the navigation. A live hosted session ends only when id_token_hint was issued to its user or the user confirms: otherwise the answer is a Sign out? page whose same-origin form POST (confirm=1, carrying the request's parameters) ends it, and the request itself changes nothing. Access and refresh tokens already issued stay valid until they expire or are revoked.",
        "operationId": "oauth_logout",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "End-session endpoint",
        "description": "OpenID Connect RP-Initiated Logout 1.0, by GET with query parameters or POST with the same parameters as application/x-www-form-urlencoded. post_logout_redirect_uri must exactly match one registered for the client identified by client_id or id_token_hint and, for a project with a nonempty redirect allowlist, an entry in that list. A disallowed project URI answers a local error without navigation. The answer is otherwise the hosted Signed out page; with a validated post_logout_redirect_uri it continues there at once (with state, if sent), and a Continue link to the same address appears after 1.5 seconds for a browser that blocks the navigation. A live hosted session ends only when id_token_hint was issued to its user or the user confirms: otherwise the answer is a Sign out? page whose same-origin form POST (confirm=1, carrying the request's parameters) ends it, and the request itself changes nothing. Access and refresh tokens already issued stay valid until they expire or are revoked.",
        "operationId": "oauth_logout_post",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/{slug}/oauth/revoke": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Revocation endpoint",
        "description": "RFC 7009, application/x-www-form-urlencoded token (and optionally token_type_hint); the client authenticates as at the token endpoint and may revoke only its own tokens: confidential clients with client_secret_basic or client_secret_post, a public client (no secret registered) by sending only client_id in the form (RFC 7009 section 2.1). Revoking a refresh or access token ends its whole sign-in: every refresh token of it is refused and ts-auth stops accepting its access tokens, while access tokens validated offline (TerraBase) stay valid until they expire, at most 5 minutes. An unknown, expired or already revoked token also answers 200.",
        "operationId": "oauth_revoke",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          },
          { }
        ]
      }
    },
    "/{slug}/oauth/token": {
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "Token endpoint",
        "description": "application/x-www-form-urlencoded grant_type=authorization_code (code, redirect_uri, code_verifier), grant_type=refresh_token (refresh_token), grant_type=urn:ietf:params:oauth:grant-type:device_code (device_code, client_id; RFC 8628 for the ts CLI, see /{slug}/oauth/device) or, for service clients only, grant_type=client_credentials. Every POST to /terrascale/oauth/token and /terrascale/oauth/device, including invalid client credentials and malformed requests, charges the socket peer's shared minute budget before client authentication: TS_AUTH_RATE_LIMIT (or --rate-limit), default 1000, per IPv4 address or IPv6 /64, with an additional IPv6 /48 budget at four times that capacity. Forwarding is disabled by default. With TS_AUTH_TRUSTED_PROXIES (or --trusted-proxies) configured, exact trusted socket peers have four times the aggregate peer capacity in separate trusted-proxy buckets and also charge a separate resolved-client budget of TS_AUTH_RATE_LIMIT per IPv4 address or IPv6 /64, with an additional resolved-client IPv6 /48 budget at four times that capacity; both apply before authentication. ASP.NET processes only the rightmost X-Forwarded-For hop from these peers. Missing or malformed rightmost addresses retain the proxy address and share its client budget. Other forwarding headers and submitted client identifiers do not select a budget. Exhaustion answers 429 rate_limited with Retry-After in seconds; missing peer addresses or unavailable limiter storage answer 503 temporarily_unavailable. Both are OAuth JSON errors with Cache-Control: no-store. Storage that does not answer within 10 seconds answers 503 temporarily_unavailable, with Retry-After unless a write may already have committed; a retry of a grant that committed late may answer invalid_grant, so sign in again then. Confidential clients authenticate with client_secret_basic or client_secret_post; public clients (authorization_code with PKCE, device_code) send only client_id, and the agent jwt-bearer grant sends no client authentication at all. Access tokens are ES256 JWTs with typ at+jwt whose aud holds TS_AUTH_ACCESS_TOKEN_AUDIENCES; a user's carry email and email_verified, a service client's have sub = client id and no scopes. Refresh tokens rotate on every use, with one exception: when the ts-dashboard client redeems an authorization code with ts_refresh_expires_at (Unix seconds, after now and at most 365 days and 5 minutes ahead, the 5 minutes absorbing a clock difference between the dashboard and ts-auth), the grant's refresh token expires at that instant and never rotates, so a refresh answers no refresh_token and the client keeps using the one it has, authenticating as the client every time; any other ts_refresh_expires_at from that client answers invalid_request and leaves the code unredeemed. Other clients, other grants and refresh requests ignore the parameter. Other platform refresh tokens have a fixed expiry 14 days after the authorization code is redeemed. Project refresh tokens initially expire at the original auth_time plus the project's configured session lifetime (5 minutes to 30 days). Rotation never extends an observed expiry, and reducing policy immediately limits code and refresh redemption. Observing policy expiry revokes the whole sign-in, so later policy increases cannot revive its grants. Authorization-code redirect_uri must still satisfy the project's current nonempty allowlist as well as the client registration. Active MFA users' authorization-code, refresh and exchange grants need the ts_auth_mfa claim of a second-factor sign-in; primary-only ones answer invalid_grant. Pending and disabled factors permit primary authentication; corrupt or unavailable factor state answers 503 temporarily_unavailable. Machine client credentials and API keys are independent of user MFA. User sign-in access and identity tokens carry the server-issued numeric auth_time as Unix seconds; refresh and organization/project exchange preserve its original value. Submitted auth_time parameters are ignored. Exchange requires a nonnegative integer no more than 30 seconds ahead of the exchanging replica; missing, malformed, negative or further-ahead values answer invalid_grant. Machine tokens carry no auth_time. Authentication time alone does not establish MFA completion. Project machine apps use client_credentials with their own nonempty allowed scopes, an optional resource from allowed_audiences, and a per-app 5 to 60 minute lifetime (default 15). Their sub is client_id; aud is the selected resource. They have no end-user identity. A machine client has an additional 1000/minute budget. Interactive apps cannot use client_credentials. Agents of a project, and agents of TerraScale accounts at /terrascale/oauth/token (allowed scopes mcp:read and mcp:write), use grant_type=urn:ietf:params:oauth:grant-type:jwt-bearer (RFC 7523) without client authentication: assertion is an ES256 JWT signed by an active key of an active agent, header kid = the key's kid and no jwk, jku, x5u, x5c or crit member, iss = sub = the agent id, aud = exactly this token endpoint URL, integer iat and exp (no fraction, exponent or string) with exp at most 300 seconds after iat (30 seconds of clock skew) and a jti of at most 128 characters used once per agent. Optional scope is a subset of the agent's allowed_scopes (default all of them) and optional requested_subject is owner (default) or agent (only for an agent with allow_self_subject); any other parameter answers invalid_request. The answer has access_token, token_type Bearer, expires_in 300 (less when the agent's expires_at comes sooner; the token never outlives the agent) and scope, and no refresh or ID token. The token has token_use agent, actor_type agent, agent_id and scope, no aud, and either sub = the owner with act.sub = the agent, or sub = the agent with owner_sub = the owner. Every refusal (unknown or revoked key, bad signature, algorithm, header, issuer, audience or times, replayed jti, revoked or expired agent, owner disabled, deleted or signed out everywhere since the agent was created, scope outside allowed_scopes, self subject not allowed) answers the same 400 invalid_grant. Each agent has 60 tokens a minute and each owner's agents 600, charged only for requests that pass every check but the final save. The token is released only when one save commits the used jti (kept 10 minutes past the assertion's accepted window), the agent's last_used_at when due, and the versions of the key and owner it checked; a revocation, sign-out everywhere or disable committed before that save makes it fail. Only the ts-dashboard client, authenticated with its secret, may use grant_type=urn:terrascale:params:oauth:grant-type:agent-exchange at /terrascale/oauth/token, with subject_token (a delegated agent token of the platform issuer: token_use agent, act.sub = agent_id, sub = the owner, no aud, unexpired) and subject_token_type urn:ietf:params:oauth:token-type:access_token and nothing else. ts-auth checks the agent online (active, unexpired, an active key, the owner enabled and not signed out everywhere since the agent was created) and answers an access token for the owner: only the platform issuer as audience (never TerraBase), agent_id and act.sub = the agent, agent_scope = the subject token's scopes still allowed to the agent, auth_time = the agent's creation, no ts_auth_mfa, no platform_role, no scopes, no refresh or ID token, and expires_in at most 300 seconds and never past the subject token. Every use of it (platform API, userinfo, project exchange) reads the agent again from the home region and refuses it once the agent is revoked or its owner signed out. On the platform API it reads; with mcp:write in agent_scope it may also rename an organization, create a project and rename a project; every other POST, PUT, PATCH or DELETE and every person-only operation answers 403 agent_forbidden. An organization exchange answers 400 invalid_target; a project exchange keeps agent_id and act.sub and intersects its scopes with agent_scope (mcp:read: databases:read and sql:read; mcp:write: also databases:write and sql:write; never auth:*). Missing or failed client authentication answers 401 invalid_client; another client answers 400 unauthorized_client; another parameter, another subject_token_type or no subject_token answers 400 invalid_request; every refusal of the subject token or its agent answers 400 invalid_grant.",
        "operationId": "oauth_token",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/TokenRequestForm"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Minimum delay in whole seconds before retrying a rate-limited request.",
                "required": true,
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          },
          { }
        ]
      }
    },
    "/{slug}/oauth/userinfo": {
      "get": {
        "tags": [
          "OAuth"
        ],
        "summary": "UserInfo endpoint",
        "description": "GET, or POST with an application/x-www-form-urlencoded body. Requires an access token issued by this issuer and not revoked, with the user's current authentication epoch. Tokens of active MFA accounts without the ts_auth_mfa claim and identity tokens are rejected. Unavailable or corrupt MFA state answers 503 temporarily_unavailable.",
        "operationId": "oauth_userinfo",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInfoBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuthAccessBearer": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "OAuth"
        ],
        "summary": "UserInfo endpoint",
        "description": "GET, or POST with an application/x-www-form-urlencoded body. Requires an access token issued by this issuer and not revoked, with the user's current authentication epoch. Tokens of active MFA accounts without the ts_auth_mfa claim and identity tokens are rejected. Unavailable or corrupt MFA state answers 503 temporarily_unavailable.",
        "operationId": "oauth_userinfo_post",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserInfoBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "OAuthAccessBearer": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/invitations/accept": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "summary": "Accept an invitation",
        "description": "The caller's verified email must equal the invitation's, ignoring case (403 email_mismatch otherwise). 404 for an unknown token, 409 invitation_expired, 409 not_pending or already_member.",
        "operationId": "accept_invitation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AcceptedInvitationBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/account/deletion/history": {
      "get": {
        "tags": [
          "Members"
        ],
        "summary": "Read your deletion's history request metadata",
        "description": "Requires the existing generation-specific deletion receipt capability. Optional organization ULID must be a candidate covered by that receipt. Returns only the opaque erasure id, immutable request time and auth worker progress after logical deletion; 404 when no history job is available (including retirement), never completion evidence. Does not advance cleanup, settlement or erasure and returns no subject ids, records or tokens. Read the peer-only TerraBase inspection separately for holder metadata.",
        "operationId": "account_deletion_history",
        "parameters": [
          {
            "name": "organization",
            "in": "query",
            "description": "Candidate organization ULID covered by the deletion receipt.",
            "schema": {
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountDeletionHistory"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "accountDeletionReceipt": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/account/deletion": {
      "get": {
        "tags": [
          "Members"
        ],
        "summary": "Read your account deletion status",
        "description": "Present the deletion receipt capability header, without a bearer token. 204 proves logical account deletion for its exact closure generation; 202 means that generation is pending. 404 unknown or expired; 409 deletion_refused when the generation ended without completion proof. Optional organization ULID query: 204 requires both account proof and that candidate organization’s deletion fence; a surviving candidate stays 202, noncandidates are 404. Grants no mutation or personal data. Does not certify physical erasure or other services' data.",
        "operationId": "account_deletion_status",
        "parameters": [
          {
            "name": "X-TerraScale-Deletion-Receipt",
            "in": "header",
            "description": "Status-only capability: 32 random bytes in canonical unpadded base64url. Never put it in a URL or logs.",
            "required": true,
            "schema": {
              "maxLength": 43,
              "minLength": 43,
              "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$",
              "type": "string"
            }
          },
          {
            "name": "organization",
            "in": "query",
            "description": "Candidate organization ULID; completion additionally requires its own deletion fence.",
            "schema": {
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "accountDeletionReceipt": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/account/mfa": {
      "get": {
        "tags": [
          "Members"
        ],
        "summary": "Get two-factor status",
        "description": "The caller's own second-factor state and the hosted page that manages it.",
        "operationId": "get_account_mfa",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AccountMfaBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/deletions/{id}/acknowledge": {
      "post": {
        "tags": [
          "Members"
        ],
        "summary": "Acknowledge dashboard deletion cleanup",
        "description": "Private ts-dashboard HTTP Basic service API. After its own cleanup is verified, acknowledge the exact proof id, scope, subjectId and organizationId. Requires an existing verified platform deletion job and an absent auth root. Idempotent while that same proof remains retained; unknown, mismatched or retired proofs return 404. Allows history erasure and eventual fence retirement.",
        "operationId": "deletion_acknowledge",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DashboardDeletionAcknowledgement"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "413": {
            "description": "Payload Too Large",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "415": {
            "description": "Unsupported Media Type",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/api-keys/self": {
      "get": {
        "tags": [
          "API keys"
        ],
        "summary": "Check an API key token",
        "description": "Bearer: an access token issued for an API key (client credentials). 200 while the key exists and is unexpired, the token's key string still works (a rotation's grace included), and its organization and project exist. 401 key_revoked or key_expired otherwise, invalid_token for any other token. Each check makes several strong-consistency reads of the storage replica serving the answering ts-auth instance, after every write that instance has seen, so it reflects what that replica held while the check ran. A call can join a check of the same key token that is still running, which may have started before a revocation reached that replica, and a completed check's answer is reused for at most 1 second. 429 rate_limited past 100 checks a second (bursts of 200) or 32 concurrent checks from one address (IPv6 per /64), counted before the token is verified, or while 16,384 other addresses are active; 503 when storage does not answer within 10 seconds, too many checks are in flight, or 16,384 distinct key tokens are being checked.",
        "operationId": "get_api_key_status",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyStatusBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "apiKeyToken": [ ]
          }
        ]
      }
    },
    "/ui/{slug}/email-change/cancel": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Cancel a pending email change",
        "description": "Same-origin form POST with user and token from the notice link. A live link cancels the change by signing the account out everywhere; the answer is the same page whether or not the link was live.",
        "operationId": "ui_cancel_email_change",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "get": {
        "tags": [
          "Security"
        ],
        "summary": "Review a pending email change",
        "description": "Renders a confirmation form for the cancel link of an email change notice. Changes nothing.",
        "operationId": "ui_email_change_cancel",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/ownership-transfer": {
      "delete": {
        "tags": [
          "Ownership transfer"
        ],
        "summary": "Cancel the pending transfer",
        "description": "An owner or the nominee.",
        "operationId": "cancel_ownership_transfer",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Ownership transfer"
        ],
        "summary": "Get the pending transfer",
        "description": "Needs any organization role (a collaborator gets 403). 404 when none is pending.",
        "operationId": "get_ownership_transfer",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnershipTransferBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "post": {
        "tags": [
          "Ownership transfer"
        ],
        "summary": "Offer ownership to a member",
        "description": "Needs owner and a fresh start_ownership_transfer/ts-auth X-TerraScale-Step-Up-Proof. The nominee is a member who is not an owner. Replaces a pending transfer; valid 7 days.",
        "operationId": "start_ownership_transfer",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StartTransferRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OwnershipTransferBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/members/{user}/role": {
      "put": {
        "tags": [
          "Members"
        ],
        "summary": "Change a member's organization role",
        "description": "Needs admin, and owner when the member is or becomes an owner. 409 last_owner when it would demote the last owner.",
        "operationId": "change_member_role",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/account/email-change/confirm": {
      "post": {
        "tags": [
          "Members"
        ],
        "summary": "Confirm a sign-in email change",
        "description": "Commits the caller's pending change with the code the new address received, at the authentication state it was requested in: the new address becomes the sign-in email, the old one is released, and the epoch advances, ending every session and token of the account, including this one. The code works once; five wrong codes, expiry, a replaced request or any sign-out void it (403 email_change_denied). 409 email_taken when another account claimed the address meanwhile.",
        "operationId": "confirm_email_change",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConfirmEmailChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/ownership-transfer/confirm": {
      "post": {
        "tags": [
          "Ownership transfer"
        ],
        "summary": "Confirm a transfer",
        "description": "Only the nominee. The nominee becomes an owner and the owner who started it an admin.",
        "operationId": "confirm_ownership_transfer",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/step-up/consume": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Consume a dashboard step-up proof",
        "description": "Atomically consumes an approved, unexpired proof with the current account epoch/state before issuing a PAT, a dashboard plan change or any deletion side effects. ts-dashboard create_pat, ts-auth change_plan, ts-auth delete_organization and ts-dashboard delete_account are accepted. change_plan and delete_organization require organization_id, the organization the caller is about to change, and consume their proof single-use for the signed-in user only when it was minted for that organization; a proof minted for another organization answers 403 and stays unconsumed. create_pat and delete_account refuse organization_id. delete_account requires operation_receipt, a canonical 32-byte base64url deletion receipt; 200 returns operation_grant only after the commit and final five-minute deadline check. Persist it privately: auth DELETE retries require both that secret in X-TerraScale-Deletion-Authorization and the exact receipt/account/state, for 15 days. create_pat, change_plan and delete_organization return 204 without a credential. The organization DELETE then requires the consumed delete_organization proof in X-TerraScale-Step-Up-Proof before the proof's five-minute deadline and spends it. A late or failed deletion consume releases no operation_grant. Other operations consume their ts-auth proofs at the sensitive API itself. Replay or mismatch: 403 step_up_required.",
        "operationId": "consume_step_up",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConsumeStepUpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StepUpGrantBody"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/invitations": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "summary": "Invite an email address",
        "description": "Without project_id: an organization role; needs admin, and owner to invite an owner. With project_id: a role on that project; needs the project's admin role. ts-auth emails a link to the dashboard's accept page, <dashboard origin>/invitations/<token>; the token is also answered once. Valid 7 days, single use. 409 invitation_pending while an unexpired invitation for the email and target is pending, 409 already_member when the address's user already has it. 429 rate_limited with Retry-After past 100 invitations per organization per hour or 50 per inviting user per day, or when the organization's share of invitation email capacity is used up; nothing is created. A full or stopping email queue answers 503 before creating a pending invitation; failed creates release their reserved queue capacity.",
        "operationId": "create_invitation",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateInvitationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationCreatedBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Minimum delay in whole seconds before the binding limit admits another invitation.",
                "required": true,
                "schema": {
                  "type": "integer"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Invitations"
        ],
        "summary": "List invitations",
        "description": "Every invitation with its status, in creation order. Needs admin; a project admin lists its project's with project_id.",
        "operationId": "list_invitations",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project_id",
            "in": "query",
            "description": "Only invitations to this project.",
            "schema": {
              "pattern": "^[0-7][0-9A-HJKMNP-TV-Z]{25}$",
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/api-keys": {
      "post": {
        "tags": [
          "API keys"
        ],
        "summary": "Create an organization API key",
        "description": "Needs admin. The key reaches every project of the organization, one project per token. The key string is answered once. 429 rate_limited with Retry-After past 20 API keys created per user per hour, organization and project keys together.",
        "operationId": "create_organization_api_key",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeySecretBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "API keys"
        ],
        "summary": "List organization API keys",
        "description": "Needs admin. Keys that can still be used, never secrets, in creation order.",
        "operationId": "list_organization_api_keys",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations": {
      "post": {
        "tags": [
          "Organizations"
        ],
        "summary": "Create an organization",
        "description": "The caller becomes its first member, with the owner role.",
        "operationId": "create_organization",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateOrganizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "List the caller's organizations",
        "description": "Organizations the caller is a member of, and those where it is a collaborator on a project (role null), in id order.",
        "operationId": "list_organizations",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/projects/{project}/api-keys": {
      "post": {
        "tags": [
          "API keys"
        ],
        "summary": "Create a project API key",
        "description": "Needs the project's member role; scopes must be within the caller's. The key string is answered once. 429 rate_limited with Retry-After past 20 API keys created per user per hour, organization and project keys together.",
        "operationId": "create_project_api_key",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeySecretBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "API keys"
        ],
        "summary": "List project API keys",
        "description": "Needs the project's member role. Keys that can still be used, never secrets, in creation order.",
        "operationId": "list_project_api_keys",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/projects": {
      "post": {
        "tags": [
          "Projects"
        ],
        "summary": "Create a project",
        "description": "Needs the member organization role, or the admin role for an AI agent acting for the caller with mcp:write. The caller becomes the project's explicit admin. 409 name_taken.",
        "operationId": "create_project",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "List projects",
        "description": "Every project for organization members, the granted ones for collaborators; in id order.",
        "operationId": "list_projects",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/invitations/decline": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "summary": "Decline an invitation",
        "description": "Same email rule as accept. The invitation's status becomes declined.",
        "operationId": "decline_invitation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/account": {
      "delete": {
        "tags": [
          "Members"
        ],
        "summary": "Delete your account",
        "description": "Requires a fresh delete_account/ts-auth X-TerraScale-Step-Up-Proof, or the exact preauthorized receipt plus X-TerraScale-Deletion-Authorization for continuation. A timely initial proof consumption with a receipt returns its authorization secret in that response header; persist privately for retries. Once logical deletion completes (204), revokes auth access and frees the caller's email and durably retries remaining auth cleanup. This response does not certify physical erasure, backups or deletion of other services' data. Organizations where the caller is the only member are deleted with their projects and databases, including replicas in every region. TerraBase permanently fences each project and purges its data before accepting active-copy erasure; the account waits for every catalog holder. Backup erasure remains durable background work under the database deletion deadlines. Shared organizations are left. 202 while a project closure is pending: the account stays until it finishes in the background, and new sign-ins are temporarily refused until completion or cancellation; cancellation restores sign-in without changing credentials. The background worker resumes without another submit. Optional X-TerraScale-Deletion-Receipt: a canonical 32-byte random base64url capability, retained for 15 days to read status after tokens stop working. Reuse it only for this closure generation; 409 deletion_refused otherwise. 409 platform_project_protected, before any closure starts, while the caller is the only member of TerraScale's own organization, whose projects hold its services' databases. A 409 (last_owner, not_empty, closure_conflict, binding_conflict) before anything was removed ends the request: the account, its memberships and organizations stay, but project closures it already started are not rolled back (TerraBase fences are permanent) and finish on their own. Once removals began, a 409 only pauses the deletion until its cause is resolved.",
        "operationId": "delete_account",
        "parameters": [
          {
            "name": "X-TerraScale-Step-Up-Proof",
            "in": "header",
            "description": "Fresh approved single-use ts-auth audience proof for this operation's purpose. Account deletion alternatively accepts its exact preauthorized deletion receipt continuation.",
            "schema": {
              "maxLength": 70,
              "minLength": 70,
              "type": "string"
            }
          },
          {
            "name": "X-TerraScale-Deletion-Receipt",
            "in": "header",
            "description": "Status-only capability: 32 random bytes in canonical unpadded base64url. Never put it in a URL or logs.",
            "schema": {
              "maxLength": 43,
              "minLength": 43,
              "pattern": "^[A-Za-z0-9_-]{42}[AEIMQUYcgkosw048]$",
              "type": "string"
            }
          },
          {
            "name": "X-TerraScale-Deletion-Authorization",
            "in": "header",
            "description": "Secret acknowledgement returned only after timely proof consumption; required with the exact receipt for continuation. Never put it in a URL or logs.",
            "schema": {
              "maxLength": 43,
              "minLength": 43,
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "X-TerraScale-Deletion-Authorization": {
                "description": "Returned on initial timely proof consumption with a receipt. Persist privately for that exact deletion's retries; absent on continuation.",
                "schema": {
                  "maxLength": 43,
                  "minLength": 43,
                  "type": "string"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "X-TerraScale-Deletion-Authorization": {
                "description": "Returned on initial timely proof consumption with a receipt. Persist privately for that exact deletion's retries; absent on continuation.",
                "schema": {
                  "maxLength": 43,
                  "minLength": 43,
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "X-TerraScale-Deletion-Authorization": {
                "description": "Returned on initial timely proof consumption with a receipt. Persist privately for that exact deletion's retries; absent on continuation.",
                "schema": {
                  "maxLength": 43,
                  "minLength": 43,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "X-TerraScale-Deletion-Authorization": {
                "description": "Returned on initial timely proof consumption with a receipt. Persist privately for that exact deletion's retries; absent on continuation.",
                "schema": {
                  "maxLength": 43,
                  "minLength": 43,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "X-TerraScale-Deletion-Authorization": {
                "description": "Returned on initial timely proof consumption with a receipt. Persist privately for that exact deletion's retries; absent on continuation.",
                "schema": {
                  "maxLength": 43,
                  "minLength": 43,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "X-TerraScale-Deletion-Authorization": {
                "description": "Returned on initial timely proof consumption with a receipt. Persist privately for that exact deletion's retries; absent on continuation.",
                "schema": {
                  "maxLength": 43,
                  "minLength": 43,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "X-TerraScale-Deletion-Authorization": {
                "description": "Returned on initial timely proof consumption with a receipt. Persist privately for that exact deletion's retries; absent on continuation.",
                "schema": {
                  "maxLength": 43,
                  "minLength": 43,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}": {
      "delete": {
        "tags": [
          "Organizations"
        ],
        "summary": "Delete an organization",
        "description": "Needs the owner role and, in X-TerraScale-Step-Up-Proof, this organization's delete_organization/ts-auth proof that POST /v1/terrascale/step-up/consume already consumed for the same account and state, before the proof's five-minute deadline. The delete spends the proof first, so any retry needs a new proof. 409 not_empty while it has projects. Logically removes the auth organization and durably retries its remaining auth records. This response does not certify physical erasure or other services' data.",
        "operationId": "delete_organization",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Organizations"
        ],
        "summary": "Get an organization",
        "description": "Members and collaborators. A caller who is neither gets 404, as for an unknown id.",
        "operationId": "get_organization",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Organizations"
        ],
        "summary": "Rename an organization",
        "description": "Needs the admin organization role.",
        "operationId": "rename_organization",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/projects/{project}": {
      "delete": {
        "tags": [
          "Projects"
        ],
        "summary": "Delete a project",
        "description": "Needs the project's admin role. Commits a closure intent, then asks TerraBase to fence the project permanently; the auth project is removed (204) only after every TerraBase region confirmed it empty, then its project roles, API keys and all invitation statuses are durably retried. 202 while TerraBase has not confirmed: the project refuses new roles, API keys and invitations and the closure finishes in the background; repeating the request resumes it. 409 platform_project_protected, changing nothing, for TerraScale's own projects, which hold its services' databases. 409 not_empty, closure_conflict or binding_conflict, changing nothing, when TerraBase refuses; once TerraBase showed the fence, a later refusal keeps the closure pending instead. This does not certify physical erasure.",
        "operationId": "delete_project",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Projects"
        ],
        "summary": "Get a project",
        "description": "Needs an effective project role. Others get 404.",
        "operationId": "get_project",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Projects"
        ],
        "summary": "Rename a project",
        "description": "Needs the project's admin role. 409 name_taken.",
        "operationId": "rename_project",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/NameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/api-keys/{key}": {
      "get": {
        "tags": [
          "API keys"
        ],
        "summary": "Get an organization API key",
        "description": "Needs admin.",
        "operationId": "get_organization_api_key",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "API keys"
        ],
        "summary": "Revoke an organization API key",
        "description": "Needs admin. No token is issued for it afterwards; TerraBase refuses tokens already issued within 3 seconds in every region.",
        "operationId": "revoke_organization_api_key",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/projects/{project}/api-keys/{key}": {
      "get": {
        "tags": [
          "API keys"
        ],
        "summary": "Get a project API key",
        "description": "Needs the project's member role.",
        "operationId": "get_project_api_key",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "delete": {
        "tags": [
          "API keys"
        ],
        "summary": "Revoke a project API key",
        "description": "Needs the project's member role. No token is issued for it afterwards; TerraBase refuses tokens already issued within 3 seconds in every region.",
        "operationId": "revoke_project_api_key",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/leave": {
      "post": {
        "tags": [
          "Members"
        ],
        "summary": "Leave an organization",
        "description": "Members and collaborators. Removes the caller's organization and project roles. 409 last_owner for the last owner.",
        "operationId": "leave_organization",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/audit-events": {
      "get": {
        "tags": [
          "Audit"
        ],
        "summary": "List audit events",
        "description": "Needs admin. Newest first; kept at least 90 days.",
        "operationId": "list_audit_events",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuditEventPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{slug}/deletions": {
      "get": {
        "tags": [
          "Members"
        ],
        "summary": "List pending dashboard deletion proofs",
        "description": "Private service API for the ts-dashboard confidential client using HTTP Basic. Returns at most 20 unacknowledged platform account, organization or project logical-deletion proofs with absent roots. Rotates delivery metadata for fair retries; does not certify physical erasure. Organization proofs use subjectId as organizationId; account proofs use null.",
        "operationId": "deletions_list",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DashboardDeletionList"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/members": {
      "get": {
        "tags": [
          "Members"
        ],
        "summary": "List organization members",
        "description": "Needs any organization role. In user id order.",
        "operationId": "list_members",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MemberPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/projects/{project}/members": {
      "get": {
        "tags": [
          "Project members"
        ],
        "summary": "List explicit project roles",
        "description": "Needs an effective project role. Lists explicit grants only; organization members' implied roles are not repeated. In user id order.",
        "operationId": "list_project_members",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectMemberPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/invitations/lookup": {
      "post": {
        "tags": [
          "Invitations"
        ],
        "summary": "Look up an invitation by token",
        "description": "Any signed-in user holding the token. A token that is unknown, expired or no longer pending answers 404.",
        "operationId": "lookup_invitation",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationTokenRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/InvitationLookupBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/members/{user}": {
      "delete": {
        "tags": [
          "Members"
        ],
        "summary": "Remove a member",
        "description": "Needs admin, and owner to remove an owner. 409 last_owner for the last owner. Also removes the user's project roles in the organization.",
        "operationId": "remove_member",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/projects/{project}/members/{user}": {
      "delete": {
        "tags": [
          "Project members"
        ],
        "summary": "Remove a project role",
        "description": "Needs the project's admin role. Organization members keep the role their organization role implies.",
        "operationId": "remove_project_member",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Project members"
        ],
        "summary": "Grant or change a project role",
        "description": "Needs the project's admin role. A new grant needs a member of the organization (404 otherwise; invite anyone else).",
        "operationId": "set_project_member_role",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RoleRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectMemberBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/account/email-change": {
      "post": {
        "tags": [
          "Members"
        ],
        "summary": "Start a sign-in email change",
        "description": "Requires a fresh change_email/ts-auth proof in X-TerraScale-Step-Up-Proof. Emails a single-use code, valid ten minutes, to new_email and a cancel link to the current address; replaces any pending change. 409 email_taken when another account owns the address; 429 rate_limited after three requests per account or address per hour, or the platform-wide hourly budget.",
        "operationId": "request_email_change",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EmailChangeRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Accepted",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EmailChangeBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/step-up": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Start purpose-bound reauthentication",
        "description": "Creates a pending five-minute proof bound to the account, authentication epoch/state, purpose and audience. Supported: delete_account (ts-auth or ts-dashboard), create_pat (ts-dashboard), delete_organization, start_ownership_transfer, change_plan, rotate_api_key, create_oauth_client, update_oauth_client, rotate_oauth_client, create_webhook_endpoint, rotate_webhook_secret, change_email, add_passkey, delete_passkey and start_impersonation (ts-auth). organization_id is required for, and binds the proof to, delete_organization, start_ownership_transfer and change_plan. For start_impersonation it must be the project ULID, a colon, and the target user ULID. It is refused for every other purpose. Keep proof on the backend; send the browser only to step_up_url. return_uri must be /auth/step-up/callback on a registered dashboard redirect origin, without query or fragment. Fresh primary credentials and active MFA are mandatory; an existing session never approves it.",
        "operationId": "request_step_up",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/StepUpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/StepUpBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/invitations/{invitation}": {
      "delete": {
        "tags": [
          "Invitations"
        ],
        "summary": "Revoke an invitation",
        "description": "Needs admin, or the project's admin for a project invitation. Its status becomes revoked and its token stops working. 409 when it is no longer pending.",
        "operationId": "revoke_invitation",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invitation",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/api-keys/{key}/rotate": {
      "post": {
        "tags": [
          "API keys"
        ],
        "summary": "Rotate an organization API key",
        "description": "Needs admin. Issues a new secret for the same id; the previous one keeps working for previous_secret_ttl seconds. Rotation is always available: it ends any older previous secret immediately; the current secret becomes the previous one for the requested grace. At most two secrets remain valid.",
        "operationId": "rotate_organization_api_key",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-TerraScale-Step-Up-Proof",
            "in": "header",
            "description": "Fresh approved single-use ts-auth audience proof for this operation's purpose. Account deletion alternatively accepts its exact preauthorized deletion receipt continuation.",
            "required": true,
            "schema": {
              "maxLength": 70,
              "minLength": 70,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeySecretBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/projects/{project}/api-keys/{key}/rotate": {
      "post": {
        "tags": [
          "API keys"
        ],
        "summary": "Rotate a project API key",
        "description": "Needs the project's member role. Issues a new secret for the same id; the previous one keeps working for previous_secret_ttl seconds. Rotation is always available: it ends any older previous secret immediately; the current secret becomes the previous one for the requested grace. At most two secrets remain valid.",
        "operationId": "rotate_project_api_key",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-TerraScale-Step-Up-Proof",
            "in": "header",
            "description": "Fresh approved single-use ts-auth audience proof for this operation's purpose. Account deletion alternatively accepts its exact preauthorized deletion receipt continuation.",
            "required": true,
            "schema": {
              "maxLength": 70,
              "minLength": 70,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeySecretBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/api-keys/self/scoped-keys": {
      "post": {
        "tags": [
          "API keys"
        ],
        "summary": "Mint a scoped API key for an agent",
        "description": "Authorization: Basic base64(keyId:key) of an API key. Mints a new API key that reaches one database (ULID) of one project: access read grants sql:read, read_write sql:read and sql:write. ttl_seconds is 60 to 2,592,000 (default 3600) and the key never outlives its parent. project is required for an organization key and must equal a project key's project. The parent must hold the scopes and, when narrowed, the same database. A scoped key mints no keys; revoking or rotating the parent revokes it. The key string is answered once.",
        "operationId": "create_scoped_api_key",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ScopedKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScopedKeyBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "clientBasic": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/mfa-policy": {
      "put": {
        "tags": [
          "Organizations"
        ],
        "summary": "Require two-factor authentication",
        "description": "Needs the owner role. With require_mfa true, members without an active second factor get 403 mfa_required from the organization's endpoints and token exchange until they enrol an authenticator app or a passkey; turning it on needs the caller's own factor (409 mfa_not_enrolled), which a passkey also satisfies. Recorded in the audit log as organization.mfa_required or organization.mfa_optional.",
        "operationId": "set_organization_mfa_policy",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaPolicyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/api-keys/{key}/allowed-cidrs": {
      "put": {
        "tags": [
          "API keys"
        ],
        "summary": "Set an organization API key's IP allowlist",
        "description": "The same role as creating the key. Replaces its IP allowlist: up to 32 IPv4 or IPv6 CIDRs or addresses, empty allows any address. TerraBase answers 403 ip_not_allowed to a token of the key used from another address, or from outside the project's allowlist; a change applies to tokens issued afterwards, within 60 seconds.",
        "operationId": "set_organization_api_key_allowed_cidrs",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AllowedCidrsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/projects/{project}/allowed-cidrs": {
      "put": {
        "tags": [
          "Projects"
        ],
        "summary": "Set a project's IP allowlist",
        "description": "Needs the project's admin role. Replaces the allowlist every API key token of the project is held to, on top of the key's own: up to 32 IPv4 or IPv6 CIDRs or addresses, empty allows any address. TerraBase answers 403 ip_not_allowed otherwise; a change applies to tokens issued afterwards, within 60 seconds.",
        "operationId": "set_project_allowed_cidrs",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AllowedCidrsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/projects/{project}/api-keys/{key}/allowed-cidrs": {
      "put": {
        "tags": [
          "API keys"
        ],
        "summary": "Set a project API key's IP allowlist",
        "description": "The same role as creating the key. Replaces its IP allowlist: up to 32 IPv4 or IPv6 CIDRs or addresses, empty allows any address. TerraBase answers 403 ip_not_allowed to a token of the key used from another address, or from outside the project's allowlist; a change applies to tokens issued afterwards, within 60 seconds.",
        "operationId": "set_project_api_key_allowed_cidrs",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AllowedCidrsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ApiKeyBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/account/sign-out": {
      "post": {
        "tags": [
          "Members"
        ],
        "summary": "Sign out everywhere",
        "description": "Advances the caller's authentication epoch: every hosted browser session, OAuth refresh token and sign-in access token of the account, including the one making this call, is refused from then on, and pending sign-in codes and challenges die. API keys are separate credentials and stay valid. Repeating the call is harmless.",
        "operationId": "sign_out_everywhere",
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/ui/{slug}/step-up/{id}": {
      "get": {
        "tags": [
          "Security"
        ],
        "summary": "Verify a sensitive operation",
        "description": "Requires the request account's hosted session, then fresh password or request-bound email proof and active MFA. GET only renders; no email or approval occurs.",
        "operationId": "ui_step_up",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Prove fresh credentials for a sensitive operation",
        "description": "Same-origin form POST. Password: password; passwordless: action=send requests one code per request, then code redeems it. Active MFA follows as a second code form (TOTP or recovery). No proof secret appears in HTML or URLs. Success approves the durable pending proof and shows a safe continuation to its validated callback. Refused verification: 401; stale request, wrong account or CSRF: 403; exhausted budgets: 429.",
        "operationId": "ui_verify_step_up",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/organization-invitations": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Accept an organization invitation",
        "operationId": "ui_accept_project_organization_invitation",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Accept an organization invitation",
        "operationId": "ui_project_organization_invitation",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/{project}/organizations/{org}/domains": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Add an organization domain",
        "description": "Project-scoped verified domains. Publish record_name with record_value as DNS TXT before verifying. A domain belongs to one organization per project. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "add_project_organization_domain",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectDomainRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOrganizationDomainBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List organization domains",
        "description": "Project-scoped verified domains. Publish record_name with record_value as DNS TXT before verifying. A domain belongs to one organization per project. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_project_organization_domains",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOrganizationDomainPage"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/organizations/{org}/memberships": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Add an organization member",
        "description": "Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "add_project_organization_member",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectMembershipRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOrganizationMembership"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List organization members",
        "description": "Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_project_organization_members",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectMembershipPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/organizations": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Create an organization",
        "description": "Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "create_project_organization",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectOrganizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOrganizationBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List organizations",
        "description": "Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_project_organizations",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOrganizationPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/organizations/{org}/invitations": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Invite an organization member",
        "description": "Invitation email names the organization and branded app; optional inviter_name is 1 to 100 plain-text characters without controls, bidi formatting or markup. The caller email and key name are never used. Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "create_project_organization_invitation",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectInvitationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOrganizationInvitationBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List organization invitations",
        "description": "Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_project_organization_invitations",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOrganizationInvitationPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/organizations/{org}/domains/{domain}": {
      "delete": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Delete an organization domain",
        "description": "Project-scoped verified domains. Publish record_name with record_value as DNS TXT before verifying. A domain belongs to one organization per project. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "delete_project_organization_domain",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/organizations/{org}": {
      "delete": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Delete an organization",
        "description": "Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "delete_project_organization",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Get an organization",
        "description": "Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "get_project_organization",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOrganizationBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Update an organization",
        "description": "Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "update_project_organization",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectOrganizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOrganizationBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/organizations/{org}/memberships/{user}": {
      "delete": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Remove an organization member",
        "description": "Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "delete_project_organization_member",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Change an organization role",
        "description": "Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "update_project_organization_member",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectMembershipRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOrganizationMembership"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/ui/{slug}/organizations/{org}/join": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Join or dismiss a suggested organization",
        "operationId": "ui_join_project_organization",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/{project}/organizations/{org}/invitations/{invitation}": {
      "delete": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Revoke an organization invitation",
        "description": "Project-scoped organizations, separate from platform organizations. Reads require auth:read; mutations require auth:write. Membership changes preserve an admin and enforce max_members. Organization deletion cascades memberships, invitations and domains. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "revoke_project_organization_invitation",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invitation",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/organizations/{org}/domains/{domain}/verify": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Verify an organization domain",
        "description": "Project-scoped verified domains. Publish record_name with record_value as DNS TXT before verifying. A domain belongs to one organization per project. Resolver errors answer 503 dns_unavailable. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "verify_project_organization_domain",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "domain",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectOrganizationDomainBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/ui/{slug}/invitations/{token}": {
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Accept a project invitation",
        "operationId": "ui_project_invitation",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "token",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/{project}/waitlist/{entry}/approve": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Approve a waitlist entry",
        "description": "Needs the admin project role. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "approve_project_waitlist",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/clients": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Register an OAuth client",
        "description": "An authorization code client with S256 PKCE, refresh tokens and logout. type is public, confidential or machine; machine apps use client_credentials with 1 to 64 allowed_scopes, optional allowed_audiences and token_lifetime_minutes (5 to 60, default 15), and no redirect URIs; redirect_uris holds 1 to 10 absolute https URLs (http only on loopback hosts) without userinfo or fragments. Each URI must additionally exactly match an entry in the project's redirect allowlist when nonempty; an empty list adds no restriction. A confidential client's client_secret is answered once and never again. allowed_origins holds at most 10 exact browser origins (https://host[:port], or http on a loopback host; lowercase, no default port, path, trailing slash, wildcard, userinfo, query or fragment) whose cross-origin token, userinfo, revocation and guest requests get CORS; allow_anonymous (default false) admits guests at /{project}/oauth/anonymous. Machine apps take neither. Needs the admin project role. Person-only step-up operation; project API keys answer 403 person_required.",
        "operationId": "create_project_client",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "X-TerraScale-Step-Up-Proof",
            "in": "header",
            "description": "Fresh approved single-use ts-auth audience proof for this operation's purpose. Account deletion alternatively accepts its exact preauthorized deletion receipt continuation.",
            "required": true,
            "schema": {
              "maxLength": 70,
              "minLength": 70,
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateClientRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List OAuth clients",
        "description": "The tenant's clients without secrets; limit is 1 to 100 (default 100) and after the previous page's next. Needs the viewer project role. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_project_clients",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/invitations": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Invite an end user",
        "description": "Needs the admin project role. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "create_project_invitation",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectInvitationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectInvitationBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List project invitations",
        "description": "Needs the viewer project role. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_project_invitations",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectInvitationPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/users": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Create an end user",
        "description": "Requires auth:write or the admin project role. Password is optional. Does not send email. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "create_project_user",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateProjectUserRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectUserBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List end users",
        "description": "q matches an email substring; limit is 1 to 100 (default 50) and after the previous page's next. Needs the viewer project role. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_project_users",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectUserPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/clients/{client_id}": {
      "delete": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Delete an OAuth client",
        "description": "Needs the admin project role. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "delete_project_client",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Update an OAuth client",
        "description": "Changes a client's display name and redirect URIs, or a machine app's allowed_scopes, allowed_audiences and token_lifetime_minutes (5 to 60); machine apps require no redirect URIs; its client_id stays the same and no secret is answered. redirect_uris holds 1 to 10 absolute https URLs (http only on loopback hosts) without userinfo or fragments, and each URI must additionally exactly match an entry in the project's redirect allowlist when nonempty. allowed_origins holds at most 10 exact browser origins (https://host[:port], or http on a loopback host; lowercase, no default port, path, trailing slash, wildcard, userinfo, query or fragment) whose cross-origin token, userinfo, revocation and guest requests get CORS; allow_anonymous (default false) admits guests at /{project}/oauth/anonymous. Machine apps take neither. An omitted allowed_origins or allow_anonymous stays unchanged. Needs the admin project role. Person-only step-up operation; project API keys answer 403 person_required.",
        "operationId": "update_project_client",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateClientRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{project}/providers/{provider}": {
      "delete": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Remove a social sign-in provider",
        "description": "Removes the provider and its stored secret; its button leaves the hosted pages. Users who signed in with it keep their accounts and can use the other methods. Needs the admin project role. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "delete_project_provider",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Configure a social sign-in provider",
        "description": "provider is google, github, apple, microsoft, gitlab, linkedin, slack, discord, facebook, x, oidc or oauth2. The project's own OAuth client: client_id and client_secret (Apple: the Services ID and the .p8 private key, with team_id and key_id; oidc: also the https issuer). microsoft accepts tenant common (default), organizations or consumers; oauth2 requires authorize_url, token_url, userinfo_url, scopes, id_claim, email_claim and email_verified_claim in oauth2, with HTTPS endpoints and dotted claim paths. client_secret is stored encrypted and never answered; omitted, the stored one is kept. Register callback_url at the provider. Needs a person with the admin project role because this changes the external sign-in credentials; project API keys are refused. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "set_project_provider",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SetProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/users/{user}": {
      "delete": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Delete an end user",
        "description": "Needs the admin project role. Its email is released and its sessions and tokens stop working at once. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "delete_project_user",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Get an end user",
        "description": "Needs the viewer project role. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "get_project_user",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectUserBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Update an end user",
        "description": "Requires auth:write or the admin project role. Omitted fields are unchanged. Metadata uses JSON merge patch; each merged object is at most 8192 UTF-8 bytes and depth 10. custom_claims replaces the trusted claims whole and null clears them: an object of at most 32 members and 1000 bytes serialized, names matching [a-z][a-z0-9_]{0,62}, values strings of at most 256 characters, finite numbers, booleans, or arrays of at most 64 strings or 64 numbers. Every later access token of the user carries them as claims. Unchanged patches emit no event. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "update_project_user",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserProfilePatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectUserBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/users/{user}/disable": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Disable an end user",
        "description": "Needs the admin project role. The user can no longer sign in, and every session and token it holds stops working at once. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "disable_project_user",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectUserBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/users/{user}/enable": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Enable an end user",
        "description": "Needs the admin project role. The user may sign in again; sessions ended by disabling stay ended. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "enable_project_user",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectUserBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/users/export": {
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Export an end-user directory page",
        "description": "Needs admin on every page. limit 1..100 (default 100); after is the previous next; format json (default) or csv. X-Export-Next carries the continuation for either format; absent means complete. X-Export-Created-Before is the fixed creation cutoff. Immutable storage-id order, not ULID order. Later creations are excluded; deletions disappear and profile fields are read per page, not a transaction snapshot. Retry the same cursor to resume; retain each page once. Replication lag and creator clock skew can omit accounts; retries may reflect changed fields, so deduplicate by id. Email possession was proven at account creation; only email, linked provider/client/subject and public profile fields are exported; no credentials or sessions are portable. Every returned page is audited. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "export_project_users",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Rows per page, default 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The prior next cursor, unchanged; omit to start.",
            "schema": {
              "maxLength": 8192,
              "type": "string"
            }
          },
          {
            "name": "format",
            "in": "query",
            "description": "json (default) or csv. CSV linked_providers is a JSON array; formula-leading cells have an apostrophe prefix.",
            "schema": {
              "pattern": "^(json|csv)$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Export-Next": {
                "description": "Opaque continuation; absent on the last page.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Export-Created-Before": {
                "description": "Fixed creation cutoff, not a transaction snapshot.",
                "schema": {
                  "type": "string",
                  "format": "date-time"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DirectoryPageBody"
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/settings": {
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Get a project tenant's settings",
        "description": "Its issuer, sign-in methods, branding and counts. Needs the viewer project role; a project the caller cannot see is 404. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "get_project_settings",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Change a project tenant's settings",
        "description": "Omitted methods are unchanged and a sent branding replaces the branding (null clears a value). At least one of passcode, password and magic_link stays on; magic_link emails a browser-bound ten-minute link and username requires a case-insensitive username at sign-up; logo_url and footer links are https, colours #rrggbb, name 1 to 64 characters, title_size 20 to 40, default_theme light/dark/system and email_message at most 500 plain-text characters (only newline controls). Name, logo and accent also brand verification, sign-in and reset emails; sender stays TerraScale. Configuration replaces the project redirect allowlist (at most 100 exact URLs; empty adds no restriction) and session lifetime (300 to 2592000 seconds). require_mfa requires an enrolled allowed factor before sign-in; allow_totp and allow_passkey select the allowed factors, with at least one required when require_mfa is true. inactivity_timeout_minutes is null (off) or 15 to 43200 minutes (30 days). single_session supersedes prior sessions on each sign-in. These policies cannot extend session_lifetime_seconds. organization_picker defaults to false; omitted leaves it unchanged. Only the reserved platform tenant uses the bootstrap auth project setting to request organization choice at dashboard sign-in. Needs the admin project role. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "update_project_settings",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateSettingsRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SettingsBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/users/import": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Import end users",
        "description": "Requires auth:write or the admin project role. Up to 500 rows; invalid rows return indexed errors without rejecting valid rows. Ten calls per project per minute. No email is sent. Accepts bcrypt, argon2id PHC and Django pbkdf2_sha256$iterations$salt$base64-hash. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "import_project_users",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ImportProjectUsersRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ImportProjectUsersBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/ui/{slug}/waitlist": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Request access to a project",
        "operationId": "ui_project_waitlist_join",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Join a project's waitlist",
        "operationId": "ui_project_waitlist",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/{project}/sessions": {
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List live sessions",
        "description": "Unrevoked sessions of enabled users within both their issued expiry and the current project lifetime, with the earlier effective expiry returned, of one user when user is set; limit is 1 to 100 (default 50) and after the previous page's next. Needs the viewer project role. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_project_sessions",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectSessionPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/waitlist": {
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List the project waitlist",
        "description": "Needs the viewer project role. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_project_waitlist",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WaitlistPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/step-up": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Reverify a project end user",
        "description": "Requires a live project sign-in access token for client_id. Reverify an allowed TOTP/recovery code or a user-verified passkey using challenge and passkey from hosted passkey sign-in options. Password alone is accepted only when MFA is not required; password may also accompany the second factor. Returns a five-minute ES256 JWT with typ step-up+jwt, project issuer, client audience, sub, sid, auth_time and RFC 8176 amr. Verify type, signature with the project's JWKS, issuer, audience and expiry. The next refresh reflects fresh auth_time without extending the absolute session. Subject to the hosted IP and account attempt budgets. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "project_step_up",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ProjectStepUpRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProjectStepUpBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/waitlist/{entry}/reject": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Reject a waitlist entry",
        "description": "Needs the admin project role. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "reject_project_waitlist",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "entry",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/invitations/{invitation}": {
      "delete": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Revoke a project invitation",
        "description": "Needs the admin project role. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "revoke_project_invitation",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "invitation",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/sessions/{session}": {
      "delete": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Revoke a session",
        "description": "Needs the admin project role. Signs the session out; a revoked session answers 204 again. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "revoke_project_session",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "session",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/clients/{client_id}/secret/rotate": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Rotate an OAuth client's secret",
        "description": "Issues a new client_secret for a confidential client and answers it exactly once; only its OpenIddict hash is kept. The previous secret keeps working for grace_seconds (default 3600, 0 to 86400), then is refused like any wrong secret; rotating again inside the grace replaces the previous secret. Needs the admin project role. Person-only step-up operation; project API keys answer 403 person_required.",
        "operationId": "rotate_project_client_secret",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "client_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/RotateClientRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ClientSecretBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{project}/users/{user}/sign-out": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Sign a user out everywhere",
        "description": "Needs the admin project role or an auth:write project secret API key. Advances the user's authentication epoch and stamp, invalidating every hosted session, authorization code and refresh token. Existing offline access tokens remain valid until expiry. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "sign_out_project_user",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/me/profile": {
      "patch": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Update your name and unsafe metadata",
        "description": "Requires the project's live hosted session cookie and an exact same-origin Origin header. Only first_name, last_name and unsafe_metadata are accepted. Metadata uses JSON merge patch, limited to 8192 UTF-8 bytes and depth 10 after merging. Unchanged patches emit no event. Limited to 20 requests per user and 60 per IP per minute.",
        "operationId": "update_self_profile",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SelfProfilePatch"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SelfProfileBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "SessionCookie": [ ]
          }
        ]
      }
    },
    "/ui/{slug}/reset/complete": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Set a new password with a reset code",
        "description": "Same-origin form post with email, code and password; the password follows the sign-up policy (400 outside it, the code stays live). Limits: the IP call bucket of 120 refilling 30 per minute and 5 attempts per normalized email per 30 minutes (429 with Retry-After); a wrong, expired or used code and an unknown address answer the same 401 page. Success signs the user out everywhere and continues to the sign-in page.",
        "operationId": "ui_password_reset_complete",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-in/mfa": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Sign in with a second factor",
        "description": "Same-origin form post with challenge (from the code, password, sign-up or platform provider step), code and next. code is the authenticator app's current six-digit code or one unused 24-character recovery code; each works once. The challenge lasts 5 minutes, completes at most once and dies with a sign-out everywhere, reset or factor change; a spent or expired challenge answers 401 with sign-in from the start. Charges the IP call bucket of 120 refilling 30 per minute and 5 failed second-factor attempts per account per 15 minutes (a successful proof is not charged); exhaustion answers 429 with Retry-After and keeps a live challenge. A wrong code answers 401 with the step again. Success sets the tsauth_session cookie and continues to next.",
        "operationId": "ui_sign_in_mfa",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-in/passkey": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Sign in with a passkey",
        "description": "Same-origin JSON post with the challenge from ui_sign_in_passkey_options, the email address, the browser's assertion and next. Finds the discoverable credential by its id, requires it to belong to an enabled account with that email address and its user handle to match, and verifies origin, RP id, the challenge (single-use, five minutes), user verification and the signature; refuses a non-increasing sign count without recording anything, and updates the credential's sign count and last use in the same transaction. Charges 10 attempts per normalized email per 15 minutes; exhaustion answers 429 with Retry-After. Every refusal answers the same generic 403 passkey_denied, whether or not the address has an account. Success sets the tsauth_session cookie, skips the second-factor step (a user-verified passkey satisfies organizations that require one) and continues to next.",
        "operationId": "ui_sign_in_passkey",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeySignInRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-in/passkey/options": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Start a passkey sign-in",
        "description": "Same-origin form post with the email address and, on the second-factor step, its challenge. Returns WebAuthn PublicKeyCredentialRequestOptions with a sealed single-use challenge valid 5 minutes and userVerification required. allowCredentials stays empty, so the authenticator offers its discoverable passkeys and the answer reveals nothing about which addresses have accounts or passkeys, unless the caller already identified the account: a live second-factor challenge or a live session for that address lists the account's own credentials, so passkeys enrolled without a resident key keep working there. Pass the answer to ui_sign_in_passkey.",
        "operationId": "ui_sign_in_passkey_options",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyOptionsBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-in/password": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Sign in with a password",
        "description": "Same-origin form post. A post without password shows the password step. With email and password it charges the password budgets: 10 attempts per normalized email per 15 minutes; with account lockout on, the account locks after 10 failures for 30 minutes. A wrong email or password and an account without a password answer the same 401 page. A right password of an account with an active authenticator app gets the second-factor step. Success sets the tsauth_session cookie and continues to next.",
        "operationId": "ui_sign_in_password",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/security/recovery/regenerate": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Regenerate recovery codes",
        "description": "Same-origin form post with code (the authenticator's current code or an unused recovery code) from a live session opened in the last 15 minutes; an older session is asked to sign in again before its code is read. The code reauthenticates the change, and a sign-out that lands before it commits refuses it. Success replaces every recovery code with eight new ones in one write (old codes stop working, the authenticator and its secret stay, the account's sessions stay) and shows the new codes once. The authorizing code is spent. A wrong code answers 401; 5 failed attempts per account per 15 minutes (429); a successful code is not charged.",
        "operationId": "ui_security_recovery_regenerate",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-in/magic": {
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Redeem a browser-bound sign-in link",
        "description": "A single-use ten-minute email link. A different browser receives the email-code form without redeeming the link. Shares sign-in attempt budgets and requires the local second factor when configured.",
        "operationId": "ui_sign_in_magic_redeem",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Email a browser-bound sign-in link",
        "description": "Same-origin form post. Shares the email and IP sign-in budgets. The ten-minute link works once in the requesting browser; another browser must enter the emailed code. Unknown addresses receive the same response.",
        "operationId": "ui_sign_in_magic_request",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-in": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Email a sign-in code",
        "description": "Same-origin form post (the Origin header must be the public origin). The response never reveals whether the address has an account. Shared mail-start limits: an IP call bucket of 120 refilling 30 per minute, an IP mail bucket of 30 refilling 60 per hour, a 60-second cooldown per normalized email across sign-in, sign-up and reset, and 5 mail calls per normalized email per hour, including unknown emails. IPv6 is grouped per /64 and additionally per /48 at four times the IP budget. Exhaustion answers 429 with Retry-After; a spent hourly code budget is told plainly - no new code was sent, when it resets, the resend control disabled for the same wait - identically for every address, whether or not it has an account, so nothing becomes enumerable. A new code replaces the previous one. A full or stopping delivery queue answers 503 before code issuance, including for unknown addresses.",
        "operationId": "ui_sign_in_request_code",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Minimum delay in whole seconds before retrying a rate-limited request.",
                "required": true,
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Hosted sign-in page",
        "description": "Email passcode or password sign-in for existing accounts, with links to sign-up and password reset. next is honoured only when it is this issuer's /{slug}/oauth/authorize URL, the /ui/{slug}/device page, a project's /ui/{slug}/agent-enrollments page with or without user_code, or exactly the dashboard's https://dash.terrascale.tech/profile or https://dash.terrascale.tech/profile?tab=security URL.",
        "operationId": "ui_sign_in",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-in/enroll/totp": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Enroll a required authenticator before sign-in",
        "operationId": "ui_required_totp_begin",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-in/enroll/totp/confirm": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Confirm required MFA and finish sign-in",
        "operationId": "ui_required_totp_confirm",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/reset/resend": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Resend the password reset code",
        "description": "Same-origin form post with the email of the reset code step. A fresh reset code is mailed to the same address, replacing the previous one, and the visitor stays on the code step. The response never reveals whether the address has an account; a spent hourly code budget is told plainly (429, Retry-After, resend disabled), identically for every refused address, so nothing becomes enumerable. Shares the mail-start limits (IP call and mail budgets, the 60-second mail cooldown per normalized email, 5 codes per normalized email per UTC clock hour). A full or stopping delivery queue answers 503 before code issuance, including for unknown addresses.",
        "operationId": "ui_password_reset_resend",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-up/resend": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Resend the sign-up code",
        "description": "Same-origin form post with the email and pending token of the pending sign-up. A fresh code is mailed to the same pending sign-up, replacing the previous code; an address that got an account meanwhile is mailed a sign-in code instead. The page is the same either way. Shares the mail-start limits (IP call and mail budgets, the 60-second mail cooldown per normalized email, 5 codes per normalized email per UTC clock hour); exhaustion answers 429 with Retry-After, and a spent hourly code budget is told plainly with its resend control disabled - identically for every refused address, whether or not it has an account, so nothing becomes enumerable. A full or stopping delivery queue answers 503 before code issuance, including for unknown addresses.",
        "operationId": "ui_sign_up_resend",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/reset": {
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Hosted password reset page",
        "description": "Emails a reset code, then sets a new password with it. next is honoured as on the sign-in page.",
        "operationId": "ui_password_reset",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Email a password reset code",
        "description": "Same-origin form post with email. Shares the mail-start limits (IP call and mail budgets, the 60-second mail cooldown per normalized email, 5 codes per normalized email per UTC clock hour); exhaustion answers 429 with Retry-After. The response never reveals whether the address has an account; a spent hourly code budget is told plainly (429, Retry-After, resend disabled), identically for every refused address, so nothing becomes enumerable. A full or stopping delivery queue answers 503 before code issuance, including for unknown addresses.",
        "operationId": "ui_password_reset_start",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/security": {
      "get": {
        "tags": [
          "Security"
        ],
        "summary": "Hosted security page",
        "description": "Shows whether the signed-in account has an authenticator app (TOTP) and how many recovery codes remain, with a button to set one up or a form to turn it off. Without a live tsauth_session cookie it redirects to sign-in and returns here.",
        "operationId": "ui_security",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "302": {
            "description": "Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/mfa/enroll/email": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Resend inbox proof for required MFA enrollment",
        "description": "Same-origin form post. Requires an unexpired enrollment-inbox challenge from primary authentication for a project that still requires MFA and a user without an allowed factor. Issues a fresh challenge and purpose-specific code, subject to the shared hosted email cooldown and hourly budgets. Never opens a session.",
        "operationId": "ui_required_mfa_send_email",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/security/username": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Set the account username",
        "description": "Same-origin form post from a project session opened in the last ten minutes. Requires username sign-in for the project. Usernames are case-insensitive, unique per project and cannot be reserved names. Shares the hosted IP budget. A name taken before or during the update returns the same form error.",
        "operationId": "ui_security_username",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-up": {
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Hosted sign-up page",
        "description": "Creates an account with an email address and a password; the account exists once the emailed code is entered. next is honoured as on the sign-in page.",
        "operationId": "ui_sign_up",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Start a sign-up",
        "description": "Same-origin form post with email and password (10 to 256 Unicode characters, not a common, repetitive or own-email password). One IP may start 20 sign-ups per hour (429 with Retry-After). Shares the mail-start limits: the IP call and mail budgets, a 60-second cooldown per normalized email across every mail start, and 5 codes per normalized email per UTC clock hour; exhaustion answers 429 with Retry-After. A new address is mailed a verification code bound to a random pending token the page carries; an address with an account is mailed a sign-in code and the password is discarded. An address whose account or pending sign-up already spent the hour's code budget is told that plainly (429, Retry-After, resend disabled) - identically for every refused address, whether or not it has an account, so nothing becomes enumerable. A full or stopping delivery queue answers 503 before code issuance, including for unknown addresses.",
        "operationId": "ui_sign_up_start",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/social/{provider}/callback": {
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Finish a social sign-in",
        "description": "The redirect URI registered at the provider; Apple posts it (form_post). Needs the start's state cookie and matching state, then redeems the code with the project's stored secret. The validated external subject selects its bound account. An unknown subject creates an account immediately only with an unused verified email when the project allows sign-up; matching email never links accounts. An account with an active authenticator app gets the hosted second-factor step before any session. Success sets the project's session cookie and continues to next; any failure answers 401 without a session. Unverified email uses a sealed ten-minute pending link and a single-use emailed code for new and existing accounts. Proof atomically creates an allowed account and connects the subject. Shares the hosted IP and sign-up budgets.",
        "operationId": "ui_social_callback",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Finish a social sign-in (form post)",
        "description": "The redirect URI registered at the provider; Apple posts it (form_post). Needs the start's state cookie and matching state, then redeems the code with the project's stored secret. The validated external subject selects its bound account. An unknown subject creates an account immediately only with an unused verified email when the project allows sign-up; matching email never links accounts. An account with an active authenticator app gets the hosted second-factor step before any session. Success sets the project's session cookie and continues to next; any failure answers 401 without a session. Unverified email uses a sealed ten-minute pending link and a single-use emailed code for new and existing accounts. Proof atomically creates an allowed account and connects the subject. Shares the hosted IP and sign-up budgets.",
        "operationId": "ui_social_callback_form",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/security/social/connect": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Connect a sign-in provider",
        "description": "Same-origin form post with provider from a live session opened in the last 10 minutes; an older session is asked to sign in again. Redirects to the project's configured provider with a state bound to this account, session and authentication state, sealed into the encrypted 10-minute social cookie. The callback links the identity only to this account, refuses one owned by any account in the project, and returns to the security page; it never signs an account in and never links by email. A provider the project did not configure, and the platform's pages, answer 404. Shares the hosted IP budget (429 with Retry-After).",
        "operationId": "ui_security_social_connect",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "302": {
            "description": "Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/social/{provider}": {
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Sign in with a social provider",
        "description": "Redirects to the project's configured google, github, apple, microsoft, gitlab, linkedin, slack, discord, facebook, x, oidc or oauth2 provider with state, PKCE (except Apple) and an OIDC nonce, bound to the browser by an encrypted 10-minute cookie. A provider the project did not configure, and the platform's pages, answer 404. Shares the hosted IP budget (429 with Retry-After). next is honoured as on the sign-in page.",
        "operationId": "ui_social_start",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "302": {
            "description": "Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "502": {
            "description": "Bad Gateway",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      },
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Continue with GitHub or Google",
        "description": "Same-origin form post. Redirects only when the platform tenant has provider credentials; state is browser-bound and expires in ten minutes. next accepts only this tenant's authorization or device page.",
        "operationId": "ui_platform_social_start",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "302": {
            "description": "Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/security/social/unlink": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Disconnect a sign-in provider",
        "description": "Same-origin form post with provider from a live session opened in the last 10 minutes. Success releases the provider's identities from the account, revokes every prior session and token, opens a fresh session for this browser and returns to the security page. A provider the account does not have redirects back without a change.",
        "operationId": "ui_security_social_unlink",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "302": {
            "description": "Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/security/totp": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Start authenticator enrolment",
        "description": "Same-origin form post from a live session opened in the last 15 minutes (otherwise the page asks to sign in again). Shows a QR code and key for a new TOTP secret (SHA-1, 6 digits, 30 seconds) that stays pending for 10 minutes until confirmed, and never past the end of that 15-minute window. A sign-out that lands before the change commits refuses it. 409 page when an authenticator is already active.",
        "operationId": "ui_security_totp_begin",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/security/totp/confirm": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Turn on two-factor authentication",
        "description": "Same-origin form post with code, the authenticator's current six-digit code for the pending secret, from a live session; a sign-out that lands before the change commits refuses it. Success activates the factor, signs the account out everywhere (every session and token), opens a fresh two-factor session for this browser, records member.mfa_enabled in the account's organizations' audit logs and shows eight single-use recovery codes once. A wrong or expired code answers 401; 5 failed attempts per account per 15 minutes (429); a successful code is not charged.",
        "operationId": "ui_security_totp_confirm",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/security/totp/disable": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Turn off two-factor authentication",
        "description": "Same-origin form post with code (the authenticator's current code or an unused recovery code) from a live session; the code reauthenticates the change, and a sign-out that lands before it commits refuses it. Success removes the factor and its recovery codes, signs the account out everywhere, opens a fresh session for this browser and records member.mfa_disabled in the account's organizations' audit logs. Members of organizations that require two-factor authentication lose access to them until they enrol again. A wrong code answers 401; 5 failed attempts per account per 15 minutes (429); a successful code is not charged.",
        "operationId": "ui_security_totp_disable",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/mfa/enroll/verify-email": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Prove the inbox before required MFA enrollment",
        "description": "Same-origin form post, independent of passcode sign-in. Requires the sealed five-minute enrollment-inbox challenge from primary authentication and its single-use emailed code for the same tenant, user and authentication state. Shares hosted IP and account code-attempt limits. Success only offers allowed factor enrollment and never opens a session.",
        "operationId": "ui_required_mfa_verify_email",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-in/verify": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Sign in with an emailed code",
        "description": "Same-origin form post. A code works once, for 30 minutes (ten minutes for magic links and pending social links), until a newer code replaces it, and dies after 5 wrong guesses. Hosted sign-in pages share the IP call bucket of 120 refilling 30 per minute and 5 attempts per normalized email per 30 minutes, including unknown emails and replaced codes; exhaustion answers 429 with Retry-After. An account-budget refusal temporarily blocks code redemption until the stored window ends and queues one best-effort lockout email notice per real account for that deadline, in the browser language; recovery remains separate. Success sets the tsauth_session cookie (Secure, HttpOnly, SameSite=Lax) and continues to next. An account with an active authenticator app gets the second-factor step (no session cookie yet); corrupt or unavailable MFA state fails closed.",
        "operationId": "ui_sign_in_verify_code",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              },
              "Retry-After": {
                "description": "Minimum delay in whole seconds before retrying a rate-limited request.",
                "required": true,
                "schema": {
                  "minimum": 1,
                  "type": "integer"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/sign-up/verify": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Verify a sign-up",
        "description": "Same-origin form post with email, code and pending_token. Shares the sign-in code budgets: the IP call bucket of 120 refilling 30 per minute and 5 attempts per normalized email per 30 minutes; exhaustion answers 429 with Retry-After. A wrong, expired or used code, or another requester's token, answers 401. Success creates the account (or signs the existing one in), sets the tsauth_session cookie and continues to next.",
        "operationId": "ui_sign_up_verify",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/terrascale/account/providers": {
      "get": {
        "tags": [
          "Account"
        ],
        "summary": "List my linked sign-in providers",
        "description": "Requires the account's live sign-in token. Returns provider names only.",
        "operationId": "account_linked_providers",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LinkedProvidersBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/signin/{provider}": {
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Complete platform provider sign-in",
        "description": "Consumes browser-bound OAuth state once, exchanges the authorization code with PKCE and resolves the verified stable provider subject. An unbound subject whose email belongs to an existing account is refused. Accounts with an active authenticator app get the hosted second-factor step before any session. No provider token is stored or returned.",
        "operationId": "ui_platform_social_callback",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/terrascale/account/providers/{provider}/code": {
      "post": {
        "tags": [
          "Account"
        ],
        "summary": "Email me a code to unlink a provider",
        "description": "Requires a live sign-in token and a linked provider. Emails a sign-in code to the account's verified email, subject to the sign-in mail limits; use it with DELETE /v1/terrascale/account/providers/{provider}.",
        "operationId": "account_send_unlink_code",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Accepted",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/account/providers/{provider}": {
      "delete": {
        "tags": [
          "Account"
        ],
        "summary": "Unlink my sign-in provider",
        "description": "Requires a live sign-in token and a fresh emailed sign-in code. Email-code sign-in remains available. Success revokes every prior session and token; sign in again.",
        "operationId": "account_unlink_provider",
        "parameters": [
          {
            "name": "provider",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UnlinkProviderRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OAuthErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/sso": {
      "delete": {
        "tags": [
          "Single sign-on"
        ],
        "summary": "Delete the organization's SSO connection",
        "description": "Needs the owner role. Members of the domain sign in with email codes and passwords again; their memberships stay.",
        "operationId": "delete_sso_connection",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Single sign-on"
        ],
        "summary": "Get the organization's SSO connection",
        "description": "Needs the admin organization role. 404 when the organization has none. The client secret is never returned.",
        "operationId": "get_sso_connection",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConnectionBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "Single sign-on"
        ],
        "summary": "Create or change the organization's SSO connection",
        "description": "Needs the owner role. A new domain starts unverified, with a fresh TXT verification value; the issuer's discovery document must name the same https issuer. client_secret may be omitted to keep the stored one. 409 conflict when another organization verified the domain or this organization has a connection for another domain.",
        "operationId": "put_sso_connection",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SsoConnectionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConnectionBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/ui/terrascale/sso/callback": {
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Finish a single sign-on",
        "description": "The OpenID Connect redirect URI. The state must match the browser's tsauth_sso cookie, which is cleared. The code is redeemed with PKCE and the client secret; the ID token must be signed by the issuer's keys, for the client, unexpired, carry the nonce and an email in the verified domain (email_verified true). New accounts are linked at creation. Existing unlinked accounts first see the organization, the identity provider's full issuer and the asserted email, and confirm the link (POST /ui/terrascale/sso/link); they then complete an ordinary sign-in with a first credential and any required second factor to link the connection, issuer and subject at the current connection version. Without that confirmation no link is written. Linked identities need no local primary proof. Enrolled factors and required factor enrollment complete before sign-in. Completion continues to next; validation failure answers 401.",
        "operationId": "ui_sso_callback",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/terrascale/sso/link": {
      "post": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Confirm linking a single sign-on identity",
        "description": "Confirms, for the browser's pending single sign-on continuation of an existing unlinked account, that the identity provider's sign-in is linked to the account once its ordinary sign-in completes. Requires a same-origin form post, a confirmation digest from the displayed continuation and the tsauth_sso_proof cookie; answers the password page. A stale form displays the current confirmation without changing the continuation. A continuation that is missing, expired, already linked or already confirmed answers 403.",
        "operationId": "ui_sso_link",
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/terrascale/sso": {
      "get": {
        "tags": [
          "Sign-in"
        ],
        "summary": "Start a single sign-on",
        "description": "With email (and next, honoured as on the sign-in page), redirects to the OpenID Connect identity provider of the organization that verified the email's domain, with state, nonce and PKCE (S256) sealed into the tsauth_sso cookie for 10 minutes. 400 when the domain has no verified connection; shares the sign-in IP call bucket (120, refilling 30 per minute).",
        "operationId": "ui_sso_start",
        "responses": {
          "302": {
            "description": "Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/terrascale/organizations/{organization}/sso/verify": {
      "post": {
        "tags": [
          "Single sign-on"
        ],
        "summary": "Verify the SSO connection's domain",
        "description": "Needs the owner role. Looks up the TXT record named in verification; 409 domain_unverified until it carries the value. Once verified, no other organization can take the domain, and every account of the domain signs in through the identity provider, except the organization's owners, who keep email-code and password sign-in.",
        "operationId": "verify_sso_domain",
        "parameters": [
          {
            "name": "organization",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SsoConnectionBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{project}/me/api-keys": {
      "post": {
        "tags": [
          "User API keys"
        ],
        "summary": "Create self user api key",
        "description": "The signed-in end user manages only their own keys. Uses the project's hosted session cookie; mutations require the auth public Origin. Creation requires sign-in within 10 minutes and an expiry at most 365 days ahead (default 90 days).",
        "operationId": "create_self_user_api_key",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "SessionCookie": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "User API keys"
        ],
        "summary": "List self user api keys",
        "description": "The signed-in end user manages only their own keys. Uses the project's hosted session cookie; mutations require the auth public Origin. Creation requires sign-in within 10 minutes and an expiry at most 365 days ahead (default 90 days).",
        "operationId": "list_self_user_api_keys",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "SessionCookie": [ ]
          }
        ]
      }
    },
    "/v1/{project}/users/{user}/api-keys": {
      "post": {
        "tags": [
          "User API keys"
        ],
        "summary": "Create user api key",
        "description": "Project-scoped user-owned keys. Requires the admin role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "create_user_api_key",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "User API keys"
        ],
        "summary": "List user api keys",
        "description": "Project-scoped user-owned keys; limit is 1 to 100 (default 100) and after the previous page's next. Requires the viewer role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_user_api_keys",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyPageBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/user-api-key-policy": {
      "get": {
        "tags": [
          "User API keys"
        ],
        "summary": "Get user api key policy",
        "description": "Project-scoped user-owned keys. Requires the viewer role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "get_user_api_key_policy",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyPolicyBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      },
      "put": {
        "tags": [
          "User API keys"
        ],
        "summary": "Set user api key policy",
        "description": "Project-scoped user-owned keys. Requires the admin role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "set_user_api_key_policy",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UserApiKeyPolicyBody"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UserApiKeyPolicyBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/me/api-keys/{key}": {
      "delete": {
        "tags": [
          "User API keys"
        ],
        "summary": "Revoke self user api key",
        "description": "The signed-in end user manages only their own keys. Uses the project's hosted session cookie; mutations require the auth public Origin. Creation requires sign-in within 10 minutes and an expiry at most 365 days ahead (default 90 days).",
        "operationId": "revoke_self_user_api_key",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "SessionCookie": [ ]
          }
        ]
      }
    },
    "/v1/{project}/users/{user}/api-keys/{key}": {
      "delete": {
        "tags": [
          "User API keys"
        ],
        "summary": "Revoke user api key",
        "description": "Project-scoped user-owned keys. Requires the admin role or the corresponding project key scope. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "revoke_user_api_key",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "user",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/api-keys/verify": {
      "post": {
        "tags": [
          "User API keys"
        ],
        "summary": "Verify user api key",
        "description": "Project-scoped user-owned keys. Requires an unrestricted project secret API key with auth:read; sign-in tokens are refused. Reads current storage without caching and compares hashes in constant time. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "verify_user_api_key",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyUserApiKeyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyUserApiKeyBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "userKeyVerifier": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/account/passkeys/{id}": {
      "delete": {
        "tags": [
          "Members"
        ],
        "summary": "Delete a passkey",
        "description": "Removes one enrolled passkey of the caller and releases its credential claim; the account's sessions and tokens stay. Requires a fresh approved delete_passkey/ts-auth proof in X-TerraScale-Step-Up-Proof, exactly as account deletion does. The write is conditional on the account's authentication state and the stored passkey list; a concurrent change answers 409 version_conflict, an unknown id 404 passkey_not_found. Deleting the last passkey of an account without an authenticator app that belongs to an organization requiring two-factor authentication answers 409 last_factor.",
        "operationId": "delete_passkey",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "patch": {
        "tags": [
          "Members"
        ],
        "summary": "Rename a passkey",
        "description": "Changes the caller-chosen name of one enrolled passkey, 1 to 64 characters. The write is conditional on the account's authentication state and the stored passkey list; a concurrent change answers 409 version_conflict, an unknown id 404 passkey_not_found, a stale account state 403 passkey_denied.",
        "operationId": "rename_passkey",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyRenameRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyItemBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/ui/{slug}/security/passkeys/delete": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Remove a passkey from the security page",
        "description": "Same-origin form post with id, code and next from the hosted security page's live session; the code (the authenticator's current code or an unused recovery code) reauthenticates the removal exactly as turning off two-factor authentication does. Success removes the passkey, releases its credential claim and records member.passkey_removed in the account's organizations' audit logs; sessions and tokens stay. Removing the last passkey of an account without an authenticator app that belongs to an organization requiring two-factor authentication is refused. A wrong code answers 401; a cross-origin post answers 403.",
        "operationId": "ui_security_passkey_delete",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/security/passkeys/options": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Start passkey enrollment from the security page",
        "description": "Same-origin fetch from the hosted security page with a live session cookie opened within the last 10 minutes; an older session must sign in again before a passkey can be added. Returns the same WebAuthn creation options and sealed challenge as create_passkey_options, for the browser's navigator.credentials.create call. A cross-origin post or a missing session answers 403 passkey_denied.",
        "operationId": "ui_security_passkey_options",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyOptionsBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/security/passkeys/rename": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Rename a passkey from the security page",
        "description": "Same-origin form post with id, name and next from the hosted security page's live session; renames the passkey exactly like rename_passkey (1 to 64 characters) and shows the security page again. A cross-origin post or a missing session answers 403 passkey_denied; an unknown passkey or a changed account shows the page with an error.",
        "operationId": "ui_security_passkey_rename",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/x-www-form-urlencoded": {
              "schema": {
                "$ref": "#/components/schemas/EmptyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "text/html": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/ui/{slug}/security/passkeys/verify": {
      "post": {
        "tags": [
          "Security"
        ],
        "summary": "Finish passkey enrollment from the security page",
        "description": "Same-origin JSON fetch from the hosted security page's live session, opened within the last 10 minutes, with the browser's WebAuthn registration answer; verifies exactly like create_passkey_verify and stores the passkey. An older session must sign in again before a passkey can be added. A refused ceremony, a cross-origin post, a missing session or a project that disallows passkeys answers 403 passkey_denied.",
        "operationId": "ui_security_passkey_verify",
        "parameters": [
          {
            "name": "slug",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyEnrolledBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          { }
        ]
      }
    },
    "/v1/terrascale/account/passkeys": {
      "get": {
        "tags": [
          "Members"
        ],
        "summary": "List your passkeys",
        "description": "The caller's enrolled passkeys: id, caller-chosen name, authenticator model (aaguid), creation time and last use. Public keys and other credential material are never returned.",
        "operationId": "list_passkeys",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyListBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/account/passkeys/options": {
      "post": {
        "tags": [
          "Members"
        ],
        "summary": "Start passkey enrollment",
        "description": "Returns WebAuthn PublicKeyCredentialCreationOptions for the caller with a sealed single-use challenge valid 5 minutes. Attestation is none, user verification is required and resident keys are preferred; existing credential ids are excluded. The challenge dies with the account's authentication state. Pass the answer to create_passkey_verify.",
        "operationId": "create_passkey_options",
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyOptionsBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/terrascale/account/passkeys/verify": {
      "post": {
        "tags": [
          "Members"
        ],
        "summary": "Finish passkey enrollment",
        "description": "Needs a fresh, approved, single-use add_passkey/ts-auth proof in X-TerraScale-Step-Up-Proof; a bearer token alone never adds a factor (403 step_up_required). Verifies the browser's WebAuthn registration answer (origin, RP id, user verification, challenge) against the sealed challenge from create_passkey_options and stores the passkey. The challenge works once and dies with the account's authentication state; a refused ceremony, a reused or stale challenge, or a credential id that is already enrolled answers 403 passkey_denied.",
        "operationId": "create_passkey_verify",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PasskeyVerifyRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PasskeyEnrolledBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "429": {
            "description": "Too Many Requests",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{project}/webhook-endpoints": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Register a webhook endpoint",
        "description": "Subscribes an https URL to a non-empty subset of the end-user lifecycle events user.created, user.signed_up, user.signed_in, user.disabled, user.enabled, user.deleted, user.provider_linked, user.provider_unlinked, user.updated, session.created, session.revoked and webhook.endpoint_disabled. The URL is at most 2048 characters, without userinfo or fragment; a project registers at most 3 endpoints (409 webhook_endpoint_limit). The whsec_ signing secret is answered exactly once and stored sealed under the master key. Needs the admin project role and a create_webhook_endpoint step-up proof. Person-only step-up operation; project API keys answer 403 person_required.",
        "operationId": "create_webhook_endpoint",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateWebhookEndpointRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Created",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointBody"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      },
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List webhook endpoints",
        "description": "The project's registered webhook endpoints, without secrets. Needs the admin project role. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_webhook_endpoints",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEndpointPageBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/webhook-endpoints/{id}": {
      "delete": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Delete a webhook endpoint",
        "description": "Needs the admin project role. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "delete_webhook_endpoint",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/events": {
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List retained project events",
        "description": "Events in ascending ULID order, retained 30 days. after is the previous page next cursor; limit is 1 to 100, default 50. Only events at least five seconds old are visible. Needs the member project role. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_events",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "description": "Page size, 1 to 100.",
            "schema": {
              "maximum": 100,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "name": "after",
            "in": "query",
            "description": "The previous page's next cursor; omit to start.",
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEventPage"
                }
              }
            }
          },
          "400": {
            "description": "Bad Request",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/webhook-endpoints/{id}/deliveries": {
      "get": {
        "tags": [
          "Project tenants"
        ],
        "summary": "List recent webhook deliveries and attempts",
        "description": "Needs the admin project role. Also accepts an unrestricted project secret API key with auth:read.",
        "operationId": "list_webhook_deliveries",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookDeliveryPage"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/webhook-endpoints/{id}/deliveries/{delivery}/replay": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Replay a webhook delivery with the original event id",
        "description": "Needs the admin project role. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "replay_webhook_delivery",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "delivery",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "No Content",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    },
    "/v1/{project}/webhook-endpoints/{id}/rotate-secret": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Rotate a webhook endpoint's secret",
        "description": "Issues a new whsec_ signing secret and answers it exactly once. The previous secret keeps verifying for 24 hours, then is refused. A concurrent change to the endpoint answers 409 version_conflict. Needs the admin project role and a rotate_webhook_secret step-up proof. Person-only step-up operation; project API keys answer 403 person_required.",
        "operationId": "rotate_webhook_secret",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookSecretBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "platformUser": [ ]
          }
        ]
      }
    },
    "/v1/{project}/webhook-endpoints/{id}/test": {
      "post": {
        "tags": [
          "Project tenants"
        ],
        "summary": "Send a signed test event to a webhook endpoint",
        "description": "Needs the admin project role. Also accepts an unrestricted project secret API key with auth:write.",
        "operationId": "test_webhook",
        "parameters": [
          {
            "name": "project",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/WebhookEventBody"
                }
              }
            }
          },
          "401": {
            "description": "Unauthorized",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "403": {
            "description": "Forbidden",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "404": {
            "description": "Not Found",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "409": {
            "description": "Conflict",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          },
          "503": {
            "description": "Service Unavailable",
            "headers": {
              "X-Request-ID": {
                "description": "Customer request correlation ULID; retained across authenticated first-party hops. Request logs are tenant-scoped and best effort.",
                "schema": {
                  "maxLength": 26,
                  "minLength": 26,
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorBody"
                }
              }
            }
          }
        },
        "security": [
          {
            "projectManagement": [ ]
          }
        ]
      }
    }
  },
  "components": {
    "schemas": {
      "AcceptedInvitationBody": {
        "required": [
          "organization_id",
          "project_id",
          "role"
        ],
        "type": "object",
        "properties": {
          "organization_id": {
            "type": "string"
          },
          "project_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": "string"
          }
        }
      },
      "AccountDeletionHistory": {
        "required": [
          "erasureId",
          "requestedAt",
          "authLogicalVerifiedAt",
          "historyStatus",
          "historyCompletedAt"
        ],
        "type": "object",
        "properties": {
          "erasureId": {
            "type": "string"
          },
          "requestedAt": {
            "type": "string",
            "format": "date-time"
          },
          "authLogicalVerifiedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "historyStatus": {
            "type": [
              "null",
              "string"
            ]
          },
          "historyCompletedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "AccountMfaBody": {
        "required": [
          "enabled",
          "recovery_codes_remaining",
          "manage_url"
        ],
        "type": "object",
        "properties": {
          "enabled": {
            "type": "boolean"
          },
          "recovery_codes_remaining": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "manage_url": {
            "type": "string"
          }
        }
      },
      "AddAgentKeyRequest": {
        "required": [
          "public_jwk"
        ],
        "type": "object",
        "properties": {
          "public_jwk": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        }
      },
      "AgentBody": {
        "required": [
          "id",
          "project_id",
          "owner_user_id",
          "name",
          "status",
          "allowed_scopes",
          "allow_self_subject",
          "keys",
          "created_at",
          "expires_at",
          "revoked_at",
          "last_used_at",
          "share_owner_email"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "owner_user_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "allowed_scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "allow_self_subject": {
            "type": "boolean"
          },
          "keys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentKeyBody"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "share_owner_email": {
            "type": "boolean"
          }
        }
      },
      "AgentEnrollmentBody": {
        "required": [
          "enrollmentId",
          "userCode",
          "verificationUri",
          "verificationUriComplete",
          "expiresIn",
          "interval"
        ],
        "type": "object",
        "properties": {
          "enrollmentId": {
            "type": "string"
          },
          "userCode": {
            "type": "string"
          },
          "verificationUri": {
            "type": "string"
          },
          "verificationUriComplete": {
            "type": "string"
          },
          "expiresIn": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "interval": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "AgentEnrollmentTokenBody": {
        "required": [
          "agentId",
          "kid"
        ],
        "type": "object",
        "properties": {
          "agentId": {
            "type": "string"
          },
          "kid": {
            "type": "string"
          }
        }
      },
      "AgentEnrollmentTokenRequest": {
        "required": [
          "proof"
        ],
        "type": "object",
        "properties": {
          "proof": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AgentIdClientBody": {
        "required": [
          "clientId",
          "name",
          "redirectUris",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "redirectUris": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "previousSecretExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "clientSecret": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AgentIdClientPageBody": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentIdClientBody"
            }
          }
        }
      },
      "AgentIdClientSecretBody": {
        "required": [
          "clientId",
          "clientSecret",
          "previousSecretExpiresAt"
        ],
        "type": "object",
        "properties": {
          "clientId": {
            "type": "string"
          },
          "clientSecret": {
            "type": "string"
          },
          "previousSecretExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "AgentIdPendingBody": {
        "required": [
          "status",
          "transactionId",
          "proofUrl",
          "clientId",
          "clientName",
          "expiresAt"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "transactionId": {
            "type": "string"
          },
          "proofUrl": {
            "type": "string"
          },
          "clientId": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AgentIdProofRequest": {
        "required": [
          "proof"
        ],
        "type": "object",
        "properties": {
          "proof": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AgentIdUserInfoBody": {
        "required": [
          "sub",
          "actorType",
          "name",
          "ownerSub"
        ],
        "type": "object",
        "properties": {
          "sub": {
            "type": "string"
          },
          "actorType": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerSub": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerEmail": {
            "type": [
              "null",
              "string"
            ]
          },
          "ownerEmailVerified": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "AgentKeyBody": {
        "required": [
          "kid",
          "thumbprint",
          "created_at",
          "revoked_at"
        ],
        "type": "object",
        "properties": {
          "kid": {
            "type": "string"
          },
          "thumbprint": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "revoked_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "AgentPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "AgentPolicyBody": {
        "required": [
          "allowed_scopes"
        ],
        "type": "object",
        "properties": {
          "allowed_scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "AgentSharingRequest": {
        "required": [
          "share_owner_email"
        ],
        "type": "object",
        "properties": {
          "share_owner_email": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "AllowanceEmailRequest": {
        "required": [
          "organizationId",
          "billingMonth",
          "metric",
          "threshold",
          "used",
          "allowance"
        ],
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "billingMonth": {
            "type": "string"
          },
          "metric": {
            "type": "string"
          },
          "threshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "used": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "allowance": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "AllowanceEmailResponse": {
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          }
        }
      },
      "AllowedCidrsRequest": {
        "required": [
          "allowed_cidrs"
        ],
        "type": "object",
        "properties": {
          "allowed_cidrs": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ApiKeyBody": {
        "required": [
          "id",
          "name",
          "organization_id",
          "project_id",
          "database",
          "scopes",
          "created_by",
          "created_at",
          "expires_at",
          "previous_secret_expires_at",
          "last_used_at",
          "allowed_cidrs"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "project_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "database": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "previous_secret_expires_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "last_used_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "allowed_cidrs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ApiKeyPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ApiKeyBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ApiKeySecretBody": {
        "required": [
          "api_key",
          "key"
        ],
        "type": "object",
        "properties": {
          "api_key": {
            "$ref": "#/components/schemas/ApiKeyBody"
          },
          "key": {
            "type": "string"
          }
        }
      },
      "ApiKeyStatusBody": {
        "required": [
          "key_id"
        ],
        "type": "object",
        "properties": {
          "key_id": {
            "type": "string"
          }
        }
      },
      "AttackProtectionSettings": {
        "type": "object",
        "properties": {
          "bot_challenge": {
            "type": "boolean",
            "default": false
          },
          "breached_passwords": {
            "type": "boolean",
            "default": true
          },
          "account_lockout": {
            "type": "boolean",
            "default": true
          },
          "new_device_email": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "AttackProtectionStatus": {
        "required": [
          "bot_challenge",
          "breached_passwords",
          "account_lockout",
          "new_device_email",
          "challenge_configured"
        ],
        "type": "object",
        "properties": {
          "bot_challenge": {
            "type": "boolean"
          },
          "breached_passwords": {
            "type": "boolean"
          },
          "account_lockout": {
            "type": "boolean"
          },
          "new_device_email": {
            "type": "boolean"
          },
          "challenge_configured": {
            "type": "boolean"
          }
        }
      },
      "AuditEventBody": {
        "required": [
          "id",
          "actor",
          "action",
          "target",
          "detail",
          "occurred_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "actor": {
            "type": "string"
          },
          "action": {
            "type": "string"
          },
          "target": {
            "type": [
              "null",
              "string"
            ]
          },
          "detail": {
            "type": [
              "null",
              "string"
            ]
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "AuditEventPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AuditEventBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "BrandingBody": {
        "required": [
          "name",
          "logo_url",
          "theme_color"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "logo_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "theme_color": {
            "type": [
              "null",
              "string"
            ]
          },
          "title_size": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "default_theme": {
            "type": [
              "null",
              "string"
            ]
          },
          "footer_links": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "$ref": "#/components/schemas/FooterLinkBody"
            }
          },
          "background_color": {
            "type": [
              "null",
              "string"
            ]
          },
          "text_color": {
            "type": [
              "null",
              "string"
            ]
          },
          "email_message": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ClientBody": {
        "required": [
          "client_id",
          "name",
          "type",
          "redirect_uris",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "client_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "redirect_uris": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "client_secret": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowed_scopes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "allowed_audiences": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "token_lifetime_minutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "allowed_origins": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "allow_anonymous": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "ClientPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ClientBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ClientSecretBody": {
        "required": [
          "client_id",
          "client_secret",
          "previous_secret_expires_at"
        ],
        "type": "object",
        "properties": {
          "client_id": {
            "type": "string"
          },
          "client_secret": {
            "type": "string"
          },
          "previous_secret_expires_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ConfigurationBody": {
        "required": [
          "redirect_urls"
        ],
        "type": "object",
        "properties": {
          "redirect_urls": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "session_lifetime_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32",
            "default": 1209600
          },
          "require_mfa": {
            "type": "boolean",
            "default": false
          },
          "allow_totp": {
            "type": "boolean",
            "default": true
          },
          "allow_passkey": {
            "type": "boolean",
            "default": true
          },
          "inactivity_timeout_minutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "single_session": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "ConfirmEmailChangeRequest": {
        "required": [
          "code"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          }
        }
      },
      "ConsumeStepUpRequest": {
        "required": [
          "proof",
          "purpose",
          "audience"
        ],
        "type": "object",
        "properties": {
          "proof": {
            "type": "string"
          },
          "purpose": {
            "type": "string"
          },
          "audience": {
            "type": "string"
          },
          "operation_receipt": {
            "type": [
              "null",
              "string"
            ]
          },
          "organization_id": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CountsBody": {
        "required": [
          "users",
          "clients"
        ],
        "type": "object",
        "properties": {
          "users": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "clients": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "CreateAgentIdClientRequest": {
        "required": [
          "name",
          "redirectUris"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "redirectUris": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CreateAgentRequest": {
        "required": [
          "name",
          "allowed_scopes",
          "public_jwk"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "allowed_scopes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "public_jwk": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "allow_self_subject": {
            "type": "boolean",
            "default": false
          },
          "expires_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "CreateApiKeyRequest": {
        "required": [
          "name",
          "scopes"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "database": {
            "type": [
              "null",
              "string"
            ]
          },
          "expires_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "allowed_cidrs": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CreateClientRequest": {
        "required": [
          "name",
          "type",
          "redirect_uris"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "redirect_uris": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "allowed_scopes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "allowed_audiences": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "token_lifetime_minutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "allowed_origins": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "allow_anonymous": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "CreateInvitationRequest": {
        "required": [
          "email",
          "role"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          },
          "project_id": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateOrganizationRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "idempotency_key": {
            "maxLength": 128,
            "minLength": 0,
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateProjectInvitationRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "redirect_url": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "CreateProjectUserRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password": {
            "type": [
              "null",
              "string"
            ]
          },
          "first_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "last_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "image_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "external_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "public_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "private_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "unsafe_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          }
        }
      },
      "CreateWebhookEndpointRequest": {
        "required": [
          "url",
          "eventTypes"
        ],
        "type": "object",
        "properties": {
          "url": {
            "type": [
              "null",
              "string"
            ]
          },
          "eventTypes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "CustomTokenBody": {
        "required": [
          "access_token",
          "token_type",
          "expires_in"
        ],
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string"
          },
          "token_type": {
            "type": "string"
          },
          "expires_in": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "CustomTokenRequest": {
        "required": [
          "user_id",
          "database",
          "claims"
        ],
        "type": "object",
        "properties": {
          "user_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "database": {
            "type": [
              "null",
              "string"
            ]
          },
          "claims": {
            "$ref": "#/components/schemas/JsonElement"
          }
        }
      },
      "DashboardDeletionAcknowledgement": {
        "required": [
          "scope",
          "subjectId",
          "organizationId"
        ],
        "type": "object",
        "properties": {
          "scope": {
            "type": "string"
          },
          "subjectId": {
            "type": "string"
          },
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DashboardDeletionList": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DashboardDeletionProof"
            }
          }
        }
      },
      "DashboardDeletionProof": {
        "required": [
          "id",
          "scope",
          "subjectId",
          "organizationId"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "scope": {
            "type": "string"
          },
          "subjectId": {
            "type": "string"
          },
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "DirectoryPageBody": {
        "required": [
          "items",
          "next",
          "created_before"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DirectoryUserBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          },
          "created_before": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "DirectoryProviderBody": {
        "required": [
          "provider",
          "client_id",
          "subject"
        ],
        "type": "object",
        "properties": {
          "provider": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          }
        }
      },
      "DirectoryUserBody": {
        "required": [
          "id",
          "email",
          "email_verified",
          "created_at",
          "disabled",
          "linked_providers"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "email_verified": {
            "type": "boolean"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "disabled": {
            "type": "boolean"
          },
          "linked_providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/DirectoryProviderBody"
            }
          }
        }
      },
      "EmailActor": {
        "required": [
          "id"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "EmailAdmissionRequest": {
        "required": [
          "attemptId"
        ],
        "type": "object",
        "properties": {
          "attemptId": {
            "type": "string"
          }
        }
      },
      "EmailAdmissionResponse": {
        "required": [
          "status",
          "sendBy"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "sendBy": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "EmailAlertRequest": {
        "required": [
          "organizationId",
          "projectId",
          "alertId",
          "state",
          "ruleName",
          "metric",
          "databaseName",
          "threshold",
          "value"
        ],
        "type": "object",
        "properties": {
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "projectId": {
            "type": [
              "null",
              "string"
            ]
          },
          "alertId": {
            "type": [
              "null",
              "string"
            ]
          },
          "state": {
            "type": [
              "null",
              "string"
            ]
          },
          "ruleName": {
            "type": [
              "null",
              "string"
            ]
          },
          "metric": {
            "type": [
              "null",
              "string"
            ]
          },
          "databaseName": {
            "type": [
              "null",
              "string"
            ]
          },
          "threshold": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          },
          "value": {
            "pattern": "^-?(?:0|[1-9]\\d*)(?:\\.\\d+)?(?:[eE][+-]?\\d+)?$",
            "type": [
              "null",
              "number",
              "string"
            ],
            "format": "double"
          }
        }
      },
      "EmailBranding": {
        "type": "object",
        "properties": {
          "brand_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "logo_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "logo_dark_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "logo_width": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "logo_height": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "icon_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "primary_color": {
            "type": [
              "null",
              "string"
            ]
          },
          "accent_color": {
            "type": [
              "null",
              "string"
            ]
          },
          "theme": {
            "type": [
              "null",
              "string"
            ]
          },
          "button_style": {
            "type": [
              "null",
              "string"
            ]
          },
          "footer_text": {
            "type": [
              "null",
              "string"
            ]
          },
          "support_email": {
            "type": [
              "null",
              "string"
            ]
          },
          "support_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "website_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "sender_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "reply_to": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "EmailBrandingRequest": {
        "required": [
          "expected_version",
          "actor",
          "branding"
        ],
        "type": "object",
        "properties": {
          "expected_version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "actor": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailActor"
              }
            ]
          },
          "branding": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailBranding"
              }
            ]
          }
        }
      },
      "EmailBrandingResponse": {
        "required": [
          "version",
          "updated_at",
          "updated_by",
          "branding",
          "defaults"
        ],
        "type": "object",
        "properties": {
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "updated_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "updated_by": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailActor"
              }
            ]
          },
          "branding": {
            "$ref": "#/components/schemas/EmailBranding"
          },
          "defaults": {
            "$ref": "#/components/schemas/EmailBranding"
          }
        }
      },
      "EmailChangeBody": {
        "required": [
          "new_email",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "new_email": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "EmailChangeRequest": {
        "required": [
          "new_email"
        ],
        "type": "object",
        "properties": {
          "new_email": {
            "type": "string"
          }
        }
      },
      "EmailConfig": {
        "required": [
          "instance_id",
          "version",
          "created_at",
          "actor",
          "change",
          "branding",
          "templates"
        ],
        "type": "object",
        "properties": {
          "instance_id": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "created_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "actor": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailActor"
              }
            ]
          },
          "change": {
            "type": [
              "null",
              "string"
            ]
          },
          "branding": {
            "$ref": "#/components/schemas/EmailBranding"
          },
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailTemplateOverride"
            }
          }
        }
      },
      "EmailPreviewRequest": {
        "required": [
          "kind",
          "locale"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "color_scheme": {
            "type": [
              "null",
              "string"
            ]
          },
          "branding": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailBranding"
              }
            ]
          },
          "fields": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailTemplateFields"
              }
            ]
          }
        }
      },
      "EmailPreviewResponse": {
        "required": [
          "subject",
          "html",
          "text"
        ],
        "type": "object",
        "properties": {
          "subject": {
            "type": "string"
          },
          "html": {
            "type": "string"
          },
          "text": {
            "type": "string"
          }
        }
      },
      "EmailRestoreRequest": {
        "required": [
          "expected_version",
          "actor"
        ],
        "type": "object",
        "properties": {
          "expected_version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "actor": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailActor"
              }
            ]
          }
        }
      },
      "EmailSupportRequest": {
        "required": [
          "requestId",
          "userId",
          "organizationId",
          "projectId",
          "databaseId",
          "plan",
          "severity",
          "subject",
          "message"
        ],
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string"
          },
          "userId": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "projectId": {
            "type": [
              "null",
              "string"
            ]
          },
          "databaseId": {
            "type": [
              "null",
              "string"
            ]
          },
          "plan": {
            "type": "string"
          },
          "severity": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "EmailSupportResponse": {
        "required": [
          "status"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "acknowledgementStatus": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "EmailTemplateFields": {
        "type": "object",
        "properties": {
          "subject": {
            "type": [
              "null",
              "string"
            ]
          },
          "preheader": {
            "type": [
              "null",
              "string"
            ]
          },
          "heading": {
            "type": [
              "null",
              "string"
            ]
          },
          "body": {
            "type": [
              "null",
              "string"
            ]
          },
          "button": {
            "type": [
              "null",
              "string"
            ]
          },
          "footnote": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "EmailTemplateListResponse": {
        "required": [
          "version",
          "templates"
        ],
        "type": "object",
        "properties": {
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "templates": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailTemplateSummary"
            }
          }
        }
      },
      "EmailTemplateOverride": {
        "required": [
          "kind",
          "locale",
          "fields"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "fields": {
            "$ref": "#/components/schemas/EmailTemplateFields"
          }
        }
      },
      "EmailTemplateRequest": {
        "required": [
          "expected_version",
          "actor",
          "fields"
        ],
        "type": "object",
        "properties": {
          "expected_version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "actor": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailActor"
              }
            ]
          },
          "fields": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailTemplateFields"
              }
            ]
          }
        }
      },
      "EmailTemplateResponse": {
        "required": [
          "kind",
          "locale",
          "version",
          "overridden",
          "variables",
          "fields",
          "defaults"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "overridden": {
            "type": "boolean"
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "fields": {
            "$ref": "#/components/schemas/EmailTemplateFields"
          },
          "defaults": {
            "$ref": "#/components/schemas/EmailTemplateFields"
          }
        }
      },
      "EmailTemplateSummary": {
        "required": [
          "kind",
          "locale",
          "overridden",
          "variables"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "type": "string"
          },
          "locale": {
            "type": "string"
          },
          "overridden": {
            "type": "boolean"
          },
          "variables": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "EmailTestRequest": {
        "required": [
          "kind",
          "locale",
          "to",
          "actor"
        ],
        "type": "object",
        "properties": {
          "kind": {
            "type": [
              "null",
              "string"
            ]
          },
          "locale": {
            "type": [
              "null",
              "string"
            ]
          },
          "to": {
            "type": [
              "null",
              "string"
            ]
          },
          "actor": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailActor"
              }
            ]
          },
          "branding": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailBranding"
              }
            ]
          },
          "fields": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailTemplateFields"
              }
            ]
          }
        }
      },
      "EmailTestResponse": {
        "required": [
          "to",
          "subject"
        ],
        "type": "object",
        "properties": {
          "to": {
            "type": "string"
          },
          "subject": {
            "type": "string"
          }
        }
      },
      "EmailVersionListResponse": {
        "required": [
          "versions"
        ],
        "type": "object",
        "properties": {
          "versions": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/EmailVersionSummary"
            }
          }
        }
      },
      "EmailVersionSummary": {
        "required": [
          "version",
          "created_at",
          "actor",
          "change"
        ],
        "type": "object",
        "properties": {
          "version": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "created_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "actor": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/EmailActor"
              }
            ]
          },
          "change": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "EmptyRequest": {
        "type": "object"
      },
      "ErrorBody": {
        "required": [
          "error"
        ],
        "type": "object",
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorDetail"
          }
        }
      },
      "ErrorDetail": {
        "required": [
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "FooterLinkBody": {
        "required": [
          "label",
          "url"
        ],
        "type": "object",
        "properties": {
          "label": {
            "type": "string"
          },
          "url": {
            "type": "string"
          }
        }
      },
      "ImpersonationActor": {
        "required": [
          "sub"
        ],
        "type": "object",
        "properties": {
          "sub": {
            "type": "string"
          }
        }
      },
      "ImpersonationBody": {
        "required": [
          "id",
          "user_id",
          "actor_id",
          "actor_email",
          "client_id",
          "reason",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "actor_id": {
            "type": "string"
          },
          "actor_email": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ImpersonationPage": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImpersonationBody"
            }
          }
        }
      },
      "ImpersonationTicket": {
        "required": [
          "id",
          "ticket",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "ticket": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ImportProjectUserRequest": {
        "required": [
          "email"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": "string"
          },
          "password_hash": {
            "type": [
              "null",
              "string"
            ]
          },
          "email_verified": {
            "type": "boolean",
            "default": false
          },
          "first_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "last_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "image_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "external_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "public_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "private_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "unsafe_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          }
        }
      },
      "ImportProjectUsersBody": {
        "required": [
          "items",
          "errors"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportedProjectUser"
            }
          },
          "errors": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserImportError"
            }
          }
        }
      },
      "ImportProjectUsersRequest": {
        "required": [
          "users"
        ],
        "type": "object",
        "properties": {
          "users": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ImportProjectUserRequest"
            }
          }
        }
      },
      "ImportedProjectUser": {
        "required": [
          "index",
          "user"
        ],
        "type": "object",
        "properties": {
          "index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "user": {
            "$ref": "#/components/schemas/ProjectUserBody"
          }
        }
      },
      "InvitationBody": {
        "required": [
          "id",
          "email",
          "role",
          "project_id",
          "invited_by",
          "created_at",
          "expires_at",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "project_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "invited_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "InvitationCreatedBody": {
        "required": [
          "invitation",
          "token"
        ],
        "type": "object",
        "properties": {
          "invitation": {
            "$ref": "#/components/schemas/InvitationBody"
          },
          "token": {
            "type": "string"
          }
        }
      },
      "InvitationLookupBody": {
        "required": [
          "organization",
          "project",
          "email",
          "role",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "organization": {
            "$ref": "#/components/schemas/NamedBody"
          },
          "project": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/NamedBody"
              }
            ]
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "InvitationPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/InvitationBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "InvitationTokenRequest": {
        "required": [
          "token"
        ],
        "type": "object",
        "properties": {
          "token": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "JsonElement": { },
      "LinkedProvidersBody": {
        "required": [
          "providers"
        ],
        "type": "object",
        "properties": {
          "providers": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "MemberBody": {
        "required": [
          "user_id",
          "email",
          "role",
          "joined_at"
        ],
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "joined_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "MemberPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/MemberBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "MethodsBody": {
        "required": [
          "passcode",
          "password",
          "sign_up_mode"
        ],
        "type": "object",
        "properties": {
          "passcode": {
            "type": "boolean"
          },
          "password": {
            "type": "boolean"
          },
          "sign_up_mode": {
            "type": "string"
          },
          "magic_link": {
            "type": "boolean",
            "default": false
          },
          "username": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "MethodsPatch": {
        "required": [
          "passcode",
          "password",
          "sign_up_mode"
        ],
        "type": "object",
        "properties": {
          "passcode": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "password": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "sign_up_mode": {
            "type": [
              "null",
              "string"
            ]
          },
          "magic_link": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "username": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "MfaPolicyRequest": {
        "required": [
          "require_mfa"
        ],
        "type": "object",
        "properties": {
          "require_mfa": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "NameRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "NamedBody": {
        "required": [
          "id",
          "name"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          }
        }
      },
      "OAuth2Configuration": {
        "required": [
          "authorize_url",
          "token_url",
          "userinfo_url",
          "scopes"
        ],
        "type": "object",
        "properties": {
          "authorize_url": {
            "type": "string"
          },
          "token_url": {
            "type": "string"
          },
          "userinfo_url": {
            "type": "string"
          },
          "scopes": {
            "type": "string"
          },
          "id_claim": {
            "type": "string",
            "default": "id"
          },
          "email_claim": {
            "type": "string",
            "default": "email"
          },
          "email_verified_claim": {
            "type": "string",
            "default": "email_verified"
          }
        }
      },
      "OAuthErrorBody": {
        "required": [
          "error",
          "error_description"
        ],
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          },
          "error_description": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OrganizationBody": {
        "required": [
          "id",
          "name",
          "created_by",
          "created_at",
          "role",
          "require_mfa"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          },
          "require_mfa": {
            "type": "boolean"
          }
        }
      },
      "OrganizationPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/OrganizationBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "OwnershipTransferBody": {
        "required": [
          "from_user_id",
          "to_user_id",
          "created_at",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "from_user_id": {
            "type": "string"
          },
          "to_user_id": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PasskeyAssertionInnerRequest": {
        "required": [
          "clientDataJSON",
          "authenticatorData",
          "signature"
        ],
        "type": "object",
        "properties": {
          "clientDataJSON": {
            "type": [
              "null",
              "string"
            ]
          },
          "authenticatorData": {
            "type": [
              "null",
              "string"
            ]
          },
          "signature": {
            "type": [
              "null",
              "string"
            ]
          },
          "userHandle": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PasskeyAssertionRequest": {
        "required": [
          "id",
          "rawId",
          "type",
          "response"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "rawId": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "response": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PasskeyAssertionInnerRequest"
              }
            ]
          }
        }
      },
      "PasskeyAttestationInnerRequest": {
        "required": [
          "clientDataJSON",
          "attestationObject",
          "transports"
        ],
        "type": "object",
        "properties": {
          "clientDataJSON": {
            "type": [
              "null",
              "string"
            ]
          },
          "attestationObject": {
            "type": [
              "null",
              "string"
            ]
          },
          "transports": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          }
        }
      },
      "PasskeyAttestationRequest": {
        "required": [
          "id",
          "rawId",
          "type",
          "response"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": [
              "null",
              "string"
            ]
          },
          "rawId": {
            "type": [
              "null",
              "string"
            ]
          },
          "type": {
            "type": [
              "null",
              "string"
            ]
          },
          "response": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PasskeyAttestationInnerRequest"
              }
            ]
          }
        }
      },
      "PasskeyEnrolledBody": {
        "required": [
          "id",
          "name",
          "aaguid",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "aaguid": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "PasskeyItemBody": {
        "required": [
          "id",
          "name",
          "aaguid",
          "createdAt",
          "lastUsedAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "aaguid": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "lastUsedAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "PasskeyListBody": {
        "required": [
          "passkeys"
        ],
        "type": "object",
        "properties": {
          "passkeys": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PasskeyItemBody"
            }
          }
        }
      },
      "PasskeyOptionsBody": {
        "required": [
          "challenge",
          "options"
        ],
        "type": "object",
        "properties": {
          "challenge": {
            "type": "string"
          },
          "options": {
            "$ref": "#/components/schemas/JsonElement"
          }
        }
      },
      "PasskeyRenameRequest": {
        "required": [
          "name"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "PasskeySignInRequest": {
        "required": [
          "challenge",
          "email"
        ],
        "type": "object",
        "properties": {
          "challenge": {
            "type": [
              "null",
              "string"
            ]
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          },
          "response": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PasskeyAssertionRequest"
              }
            ]
          }
        }
      },
      "PasskeyVerifyRequest": {
        "required": [
          "challenge",
          "name",
          "response"
        ],
        "type": "object",
        "properties": {
          "challenge": {
            "type": [
              "null",
              "string"
            ]
          },
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "response": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PasskeyAttestationRequest"
              }
            ]
          }
        }
      },
      "ProjectBody": {
        "required": [
          "id",
          "organization_id",
          "name",
          "issuer",
          "created_by",
          "created_at",
          "role",
          "allowed_cidrs"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "issuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "created_by": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "role": {
            "type": "string"
          },
          "allowed_cidrs": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "ProjectDomainRequest": {
        "required": [
          "domain"
        ],
        "type": "object",
        "properties": {
          "domain": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProjectInvitationBody": {
        "required": [
          "id",
          "email",
          "redirect_url",
          "created_at",
          "expires_at",
          "status"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "redirect_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string"
          }
        }
      },
      "ProjectInvitationPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectInvitationBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProjectInvitationRequest": {
        "required": [
          "email",
          "role"
        ],
        "type": "object",
        "properties": {
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          },
          "inviter_name": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProjectMemberBody": {
        "required": [
          "user_id",
          "email",
          "role",
          "granted_at"
        ],
        "type": "object",
        "properties": {
          "user_id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "granted_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectMemberPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectMemberBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProjectMembershipPage": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectOrganizationMembership"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProjectMembershipRequest": {
        "required": [
          "user_id",
          "role"
        ],
        "type": "object",
        "properties": {
          "user_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "role": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProjectOrganizationBody": {
        "required": [
          "id",
          "name",
          "slug",
          "image_url",
          "public_metadata",
          "private_metadata",
          "max_members",
          "domain_join",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "slug": {
            "type": "string"
          },
          "image_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "public_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "private_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "max_members": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "domain_join": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectOrganizationDomainBody": {
        "required": [
          "domain",
          "record_name",
          "record_value",
          "verified_at"
        ],
        "type": "object",
        "properties": {
          "domain": {
            "type": "string"
          },
          "record_name": {
            "type": "string"
          },
          "record_value": {
            "type": "string"
          },
          "verified_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "ProjectOrganizationDomainPage": {
        "required": [
          "items"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectOrganizationDomainBody"
            }
          }
        }
      },
      "ProjectOrganizationInvitationBody": {
        "required": [
          "id",
          "email",
          "role",
          "status",
          "created_at",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectOrganizationInvitationPage": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectOrganizationInvitationBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProjectOrganizationMembership": {
        "required": [
          "project_id",
          "organization_id",
          "user_id",
          "role",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string"
          },
          "organization_id": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "role": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectOrganizationPage": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectOrganizationBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProjectOrganizationRequest": {
        "required": [
          "name",
          "slug",
          "admin_user_id"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "slug": {
            "type": [
              "null",
              "string"
            ]
          },
          "admin_user_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "image_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "public_metadata": { },
          "private_metadata": { },
          "max_members": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "domain_join": {
            "type": "string",
            "default": "off"
          }
        }
      },
      "ProjectPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProjectSessionBody": {
        "required": [
          "id",
          "user_id",
          "email",
          "created_at",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectSessionPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectSessionBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProjectStepUpBody": {
        "required": [
          "proof",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "proof": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ProjectStepUpRequest": {
        "required": [
          "client_id"
        ],
        "type": "object",
        "properties": {
          "client_id": {
            "type": "string"
          },
          "password": {
            "type": [
              "null",
              "string"
            ]
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "challenge": {
            "type": [
              "null",
              "string"
            ]
          },
          "passkey": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/PasskeyAssertionRequest"
              }
            ]
          }
        }
      },
      "ProjectUserBody": {
        "required": [
          "id",
          "email",
          "created_at",
          "disabled",
          "first_name",
          "last_name",
          "image_url",
          "external_id",
          "email_verified",
          "public_metadata",
          "private_metadata",
          "unsafe_metadata",
          "custom_claims"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "disabled": {
            "type": "boolean"
          },
          "first_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "last_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "image_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "external_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "email_verified": {
            "type": "boolean"
          },
          "public_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "private_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "unsafe_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "custom_claims": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          }
        }
      },
      "ProjectUserPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProjectUserBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "ProviderBody": {
        "required": [
          "provider",
          "configured",
          "client_id",
          "issuer",
          "team_id",
          "key_id",
          "callback_url"
        ],
        "type": "object",
        "properties": {
          "provider": {
            "type": "string"
          },
          "configured": {
            "type": "boolean"
          },
          "client_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "issuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "team_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "key_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "callback_url": {
            "type": "string"
          },
          "tenant": {
            "type": [
              "null",
              "string"
            ]
          },
          "oauth2": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OAuth2Configuration"
              }
            ]
          }
        }
      },
      "ReadyBody": {
        "required": [
          "status",
          "version",
          "region"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "region": {
            "type": [
              "null",
              "string"
            ]
          },
          "error": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RestrictionsBody": {
        "required": [
          "allowlist",
          "blocklist"
        ],
        "type": "object",
        "properties": {
          "allowlist": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "blocklist": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "block_disposable_emails": {
            "type": "boolean",
            "default": false
          },
          "block_email_aliases": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "RoleRequest": {
        "required": [
          "role"
        ],
        "type": "object",
        "properties": {
          "role": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "RotateAgentIdClientRequest": {
        "required": [
          "graceSeconds"
        ],
        "type": "object",
        "properties": {
          "graceSeconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RotateApiKeyRequest": {
        "type": "object",
        "properties": {
          "previous_secret_ttl": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "RotateClientRequest": {
        "required": [
          "grace_seconds"
        ],
        "type": "object",
        "properties": {
          "grace_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          }
        }
      },
      "ScopedKeyBody": {
        "required": [
          "key",
          "id",
          "project_id",
          "database",
          "access",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": "string"
          },
          "id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "database": {
            "type": "string"
          },
          "access": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "ScopedKeyRequest": {
        "required": [
          "project",
          "database",
          "access"
        ],
        "type": "object",
        "properties": {
          "project": {
            "type": [
              "null",
              "string"
            ]
          },
          "database": {
            "type": [
              "null",
              "string"
            ]
          },
          "access": {
            "type": [
              "null",
              "string"
            ]
          },
          "ttl_seconds": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          }
        }
      },
      "SelfProfileBody": {
        "required": [
          "id",
          "email",
          "first_name",
          "last_name",
          "image_url",
          "public_metadata",
          "unsafe_metadata"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "first_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "last_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "image_url": {
            "type": [
              "null",
              "string"
            ]
          },
          "public_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "unsafe_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          }
        }
      },
      "SelfProfilePatch": {
        "type": "object",
        "properties": {
          "first_name": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "last_name": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "unsafe_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          }
        }
      },
      "SetProviderRequest": {
        "required": [
          "client_id",
          "client_secret"
        ],
        "type": "object",
        "properties": {
          "client_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "client_secret": {
            "type": [
              "null",
              "string"
            ]
          },
          "issuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "team_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "key_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "tenant": {
            "type": [
              "null",
              "string"
            ]
          },
          "oauth2": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/OAuth2Configuration"
              }
            ]
          }
        }
      },
      "SettingsBody": {
        "required": [
          "project_id",
          "issuer",
          "discovery_url",
          "sign_in_url",
          "methods",
          "branding",
          "counts",
          "providers"
        ],
        "type": "object",
        "properties": {
          "project_id": {
            "type": "string"
          },
          "issuer": {
            "type": "string"
          },
          "discovery_url": {
            "type": "string"
          },
          "sign_in_url": {
            "type": "string"
          },
          "methods": {
            "$ref": "#/components/schemas/MethodsBody"
          },
          "branding": {
            "$ref": "#/components/schemas/BrandingBody"
          },
          "counts": {
            "$ref": "#/components/schemas/CountsBody"
          },
          "providers": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/ProviderBody"
            }
          },
          "configuration": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationBody"
              }
            ]
          },
          "attack_protection": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AttackProtectionStatus"
              }
            ]
          },
          "restrictions": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RestrictionsBody"
              }
            ]
          },
          "organization_picker": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "SsoConnectionBody": {
        "required": [
          "organization_id",
          "domain",
          "domain_verified",
          "verified_at",
          "verification",
          "protocol",
          "default_role",
          "oidc",
          "created_at",
          "updated_at"
        ],
        "type": "object",
        "properties": {
          "organization_id": {
            "type": "string"
          },
          "domain": {
            "type": "string"
          },
          "domain_verified": {
            "type": "boolean"
          },
          "verified_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "verification": {
            "$ref": "#/components/schemas/SsoVerificationBody"
          },
          "protocol": {
            "type": "string"
          },
          "default_role": {
            "type": "string"
          },
          "oidc": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SsoOidcBody"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "SsoConnectionRequest": {
        "required": [
          "domain",
          "protocol",
          "default_role",
          "oidc"
        ],
        "type": "object",
        "properties": {
          "domain": {
            "type": [
              "null",
              "string"
            ]
          },
          "protocol": {
            "type": [
              "null",
              "string"
            ]
          },
          "default_role": {
            "type": [
              "null",
              "string"
            ]
          },
          "oidc": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/SsoOidcRequest"
              }
            ]
          }
        }
      },
      "SsoOidcBody": {
        "required": [
          "issuer",
          "client_id",
          "client_secret_set",
          "redirect_uri"
        ],
        "type": "object",
        "properties": {
          "issuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "client_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "client_secret_set": {
            "type": "boolean"
          },
          "redirect_uri": {
            "type": "string"
          }
        }
      },
      "SsoOidcRequest": {
        "required": [
          "issuer",
          "client_id",
          "client_secret"
        ],
        "type": "object",
        "properties": {
          "issuer": {
            "type": [
              "null",
              "string"
            ]
          },
          "client_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "client_secret": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "SsoVerificationBody": {
        "required": [
          "type",
          "name",
          "value"
        ],
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "value": {
            "type": "string"
          }
        }
      },
      "StartAgentEnrollmentRequest": {
        "required": [
          "name",
          "requestedScopes",
          "publicJwk"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "requestedScopes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "publicJwk": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "allowSelfSubject": {
            "type": "boolean",
            "default": false
          }
        }
      },
      "StartImpersonationRequest": {
        "required": [
          "reason",
          "client_id"
        ],
        "type": "object",
        "properties": {
          "reason": {
            "type": "string"
          },
          "client_id": {
            "type": "string"
          }
        }
      },
      "StartTransferRequest": {
        "required": [
          "user_id"
        ],
        "type": "object",
        "properties": {
          "user_id": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "StatusBody": {
        "required": [
          "status",
          "version"
        ],
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "version": {
            "type": "string"
          }
        }
      },
      "StepUpBody": {
        "required": [
          "proof",
          "step_up_url",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "proof": {
            "type": "string"
          },
          "step_up_url": {
            "type": "string"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time"
          }
        }
      },
      "StepUpGrantBody": {
        "required": [
          "operation_grant"
        ],
        "type": "object",
        "properties": {
          "operation_grant": {
            "type": "string"
          }
        }
      },
      "StepUpRequest": {
        "required": [
          "purpose",
          "audience",
          "return_uri"
        ],
        "type": "object",
        "properties": {
          "purpose": {
            "type": "string"
          },
          "audience": {
            "type": "string"
          },
          "return_uri": {
            "type": "string"
          },
          "organization_id": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TokenBody": {
        "required": [
          "access_token",
          "token_type",
          "expires_in",
          "scope",
          "id_token",
          "refresh_token"
        ],
        "type": "object",
        "properties": {
          "access_token": {
            "type": "string"
          },
          "token_type": {
            "type": "string"
          },
          "expires_in": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "scope": {
            "type": [
              "null",
              "string"
            ]
          },
          "id_token": {
            "type": [
              "null",
              "string"
            ]
          },
          "refresh_token": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "TokenRequestForm": {
        "required": [
          "grant_type"
        ],
        "type": "object",
        "properties": {
          "grant_type": {
            "type": "string"
          },
          "client_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "client_secret": {
            "type": [
              "null",
              "string"
            ]
          },
          "code": {
            "type": [
              "null",
              "string"
            ]
          },
          "redirect_uri": {
            "type": [
              "null",
              "string"
            ]
          },
          "code_verifier": {
            "type": [
              "null",
              "string"
            ]
          },
          "refresh_token": {
            "type": [
              "null",
              "string"
            ]
          },
          "device_code": {
            "type": [
              "null",
              "string"
            ]
          },
          "subject_token": {
            "type": [
              "null",
              "string"
            ]
          },
          "subject_token_type": {
            "type": [
              "null",
              "string"
            ]
          },
          "scope": {
            "type": [
              "null",
              "string"
            ]
          },
          "resource": {
            "type": [
              "null",
              "string"
            ]
          },
          "ts_refresh_expires_at": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int64"
          },
          "assertion": {
            "type": [
              "null",
              "string"
            ]
          },
          "requested_subject": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UnlinkProviderRequest": {
        "required": [
          "code"
        ],
        "type": "object",
        "properties": {
          "code": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UpdateClientRequest": {
        "required": [
          "name",
          "redirect_uris"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "redirect_uris": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "allowed_scopes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "allowed_audiences": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "token_lifetime_minutes": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "allowed_origins": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "allow_anonymous": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UpdateSettingsRequest": {
        "required": [
          "methods",
          "branding"
        ],
        "type": "object",
        "properties": {
          "methods": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/MethodsPatch"
              }
            ]
          },
          "branding": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/BrandingBody"
              }
            ]
          },
          "configuration": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ConfigurationBody"
              }
            ]
          },
          "attack_protection": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/AttackProtectionSettings"
              }
            ]
          },
          "restrictions": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/RestrictionsBody"
              }
            ]
          },
          "organization_picker": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UserApiKeyBody": {
        "required": [
          "id",
          "user_id",
          "name",
          "prefix",
          "scopes",
          "created_at",
          "expires_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "user_id": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "prefix": {
            "type": "string"
          },
          "scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "expires_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "key": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UserApiKeyPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/UserApiKeyBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "UserApiKeyPolicyBody": {
        "required": [
          "allowed_scopes"
        ],
        "type": "object",
        "properties": {
          "allowed_scopes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        }
      },
      "UserApiKeyRequest": {
        "required": [
          "name",
          "scopes"
        ],
        "type": "object",
        "properties": {
          "name": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "expires_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "UserImportError": {
        "required": [
          "index",
          "code",
          "message"
        ],
        "type": "object",
        "properties": {
          "index": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          }
        }
      },
      "UserInfoBody": {
        "required": [
          "sub",
          "email",
          "email_verified",
          "given_name",
          "family_name",
          "picture",
          "public_metadata"
        ],
        "type": "object",
        "properties": {
          "sub": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "email_verified": {
            "type": [
              "null",
              "boolean"
            ]
          },
          "given_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "family_name": {
            "type": [
              "null",
              "string"
            ]
          },
          "picture": {
            "type": [
              "null",
              "string"
            ]
          },
          "public_metadata": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/JsonElement"
              }
            ]
          },
          "act": {
            "oneOf": [
              {
                "type": "null"
              },
              {
                "$ref": "#/components/schemas/ImpersonationActor"
              }
            ]
          },
          "is_anonymous": {
            "type": [
              "null",
              "boolean"
            ]
          }
        }
      },
      "UserProfilePatch": {
        "type": "object",
        "properties": {
          "first_name": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "last_name": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "image_url": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "external_id": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "public_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "private_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "unsafe_metadata": {
            "$ref": "#/components/schemas/JsonElement"
          },
          "custom_claims": {
            "$ref": "#/components/schemas/JsonElement"
          }
        }
      },
      "VerifyUserApiKeyBody": {
        "required": [
          "valid"
        ],
        "type": "object",
        "properties": {
          "valid": {
            "type": "boolean"
          },
          "user_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "scopes": {
            "type": [
              "null",
              "array"
            ],
            "items": {
              "type": "string"
            }
          },
          "key_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "expires_at": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "VerifyUserApiKeyRequest": {
        "required": [
          "key"
        ],
        "type": "object",
        "properties": {
          "key": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WaitlistPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WaitlistRecord"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WaitlistRecord": {
        "required": [
          "id",
          "project_id",
          "email",
          "created_at"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "project_id": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "created_at": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string",
            "default": "pending"
          }
        }
      },
      "WebhookAttemptRecord": {
        "required": [
          "id",
          "deliveryId",
          "projectId",
          "createdAt",
          "status",
          "latencyMs",
          "responseCode",
          "responseBody"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "deliveryId": {
            "type": "string"
          },
          "projectId": {
            "type": "string"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "status": {
            "type": "string"
          },
          "latencyMs": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "responseCode": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "null",
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "responseBody": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WebhookDeliveryBody": {
        "required": [
          "id",
          "eventId",
          "status",
          "attempts",
          "nextAttemptAt",
          "recentAttempts"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "eventId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "attempts": {
            "pattern": "^-?(?:0|[1-9]\\d*)$",
            "type": [
              "integer",
              "string"
            ],
            "format": "int32"
          },
          "nextAttemptAt": {
            "type": "string",
            "format": "date-time"
          },
          "recentAttempts": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookAttemptRecord"
            }
          }
        }
      },
      "WebhookDeliveryPage": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookDeliveryBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WebhookEndpointBody": {
        "required": [
          "id",
          "url",
          "eventTypes",
          "createdAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "url": {
            "type": "string"
          },
          "eventTypes": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "secret": {
            "type": [
              "null",
              "string"
            ]
          },
          "previousSecretExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          },
          "disabledAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      },
      "WebhookEndpointPageBody": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEndpointBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WebhookEventBody": {
        "required": [
          "id",
          "type",
          "timestamp",
          "data"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "type": {
            "type": "string"
          },
          "timestamp": {
            "type": "string",
            "format": "date-time"
          },
          "data": {
            "$ref": "#/components/schemas/WebhookEventData"
          }
        }
      },
      "WebhookEventData": {
        "required": [
          "userId",
          "email",
          "provider",
          "sessionId",
          "endpointId"
        ],
        "type": "object",
        "properties": {
          "userId": {
            "type": "string"
          },
          "email": {
            "type": [
              "null",
              "string"
            ]
          },
          "provider": {
            "type": [
              "null",
              "string"
            ]
          },
          "sessionId": {
            "type": [
              "null",
              "string"
            ]
          },
          "endpointId": {
            "type": [
              "null",
              "string"
            ]
          },
          "actorId": {
            "type": [
              "null",
              "string"
            ]
          },
          "reason": {
            "type": [
              "null",
              "string"
            ]
          },
          "organizationId": {
            "type": [
              "null",
              "string"
            ]
          },
          "organizationRole": {
            "type": [
              "null",
              "string"
            ]
          },
          "agent_id": {
            "type": [
              "null",
              "string"
            ]
          },
          "agent_key_id": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WebhookEventPage": {
        "required": [
          "items",
          "next"
        ],
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/WebhookEventBody"
            }
          },
          "next": {
            "type": [
              "null",
              "string"
            ]
          }
        }
      },
      "WebhookSecretBody": {
        "required": [
          "id",
          "secret",
          "previousSecretExpiresAt"
        ],
        "type": "object",
        "properties": {
          "id": {
            "type": "string"
          },
          "secret": {
            "type": "string"
          },
          "previousSecretExpiresAt": {
            "type": [
              "null",
              "string"
            ],
            "format": "date-time"
          }
        }
      }
    },
    "securitySchemes": {
      "OAuthAccessBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "SessionCookie": {
        "type": "apiKey",
        "name": "tsauth_session",
        "in": "cookie"
      },
      "accountDeletionReceipt": {
        "type": "apiKey",
        "name": "X-TerraScale-Deletion-Receipt",
        "in": "header"
      },
      "apiKeyToken": {
        "type": "http",
        "description": "An access token the token endpoint issued for an API key (client credentials), carrying key_id, key_gen and, when the key expires, key_exp.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "clientBasic": {
        "type": "http",
        "scheme": "basic"
      },
      "mailAdmission": {
        "type": "http",
        "description": "Domain-separated ts-alerts admission credential; no dashboard or authentication authority.",
        "scheme": "bearer"
      },
      "platformUser": {
        "type": "http",
        "description": "A sign-in access token of the terrascale tenant (typ at+jwt, aud including the issuer), with the user's current authentication epoch. Primary-only tokens for active MFA accounts are refused; unavailable or corrupt MFA state fails closed. Organization, project, API key and service tokens are refused.",
        "scheme": "bearer",
        "bearerFormat": "JWT"
      },
      "projectManagement": {
        "type": "http",
        "description": "A terrascale sign-in access token with the required project role, or an unrestricted secret API key belonging to this project. GET requires auth:read; changes require auth:write. Keys are checked against storage on every request, including revocation and expiry. Both key and project IP allowlists apply.",
        "scheme": "bearer"
      },
      "userKeyVerifier": {
        "type": "http",
        "description": "Unrestricted project secret API key with auth:read; backend user-key verification only.",
        "scheme": "bearer"
      }
    }
  },
  "tags": [
    {
      "name": "API keys",
      "description": "Client credentials owned by an organization or project, exchanged at the token endpoint for short-lived tokens."
    },
    {
      "name": "Account",
      "description": "The signed-in platform account's linked sign-in providers and reauthenticated unlinking."
    },
    {
      "name": "Admin",
      "description": "Hosted administrator portal and its bundled assets."
    },
    {
      "name": "Agents",
      "description": "AI agents owned by a project user or a TerraScale account, holding their own public keys, and the project agent scope policy."
    },
    {
      "name": "Audit",
      "description": "Audit events of an organization's identity changes."
    },
    {
      "name": "Custom tokens",
      "description": "Short-lived end-user tokens a project backend mints with a project API key, for TerraBase rules."
    },
    {
      "name": "Email",
      "description": "Email branding, copy, previews, test sends and version history, for the ts-dashboard client (HTTP Basic)."
    },
    {
      "name": "Impersonation",
      "description": "Project-admin support sessions, single-use client-bound tickets and hosted session termination."
    },
    {
      "name": "Invitations",
      "description": "Email invitations to an organization role or to one project's role."
    },
    {
      "name": "Members",
      "description": "Organization members and their organization roles (viewer, member, admin, owner)."
    },
    {
      "name": "OAuth",
      "description": "OpenID Connect provider for the issuer {public origin}/{slug} (authorization code with S256 PKCE, rotating refresh tokens)."
    },
    {
      "name": "Observability",
      "description": "Liveness and readiness probes."
    },
    {
      "name": "Organizations",
      "description": "Organizations of the terrascale tenant (TS-598). The caller is a signed-in platform user."
    },
    {
      "name": "Ownership transfer",
      "description": "Handing an organization's ownership to another member, confirmed by the nominee."
    },
    {
      "name": "Project members",
      "description": "Explicit project roles (viewer, member, admin), for organization members and collaborators."
    },
    {
      "name": "Project tenants",
      "description": "A project tenant's end users, live sessions, OAuth clients and sign-in settings, for the project's platform members (viewer reads, admin changes)."
    },
    {
      "name": "Projects",
      "description": "Projects of an organization. Each project is also the tenant of its end users."
    },
    {
      "name": "Security",
      "description": "Hosted account security pages: authenticator (TOTP) enrolment, recovery codes and removal."
    },
    {
      "name": "Sign in as agent",
      "description": "The public OpenID Connect provider at {origin}/agents: any app learns which agent of a TerraScale account signs in, and who owns it."
    },
    {
      "name": "Sign-in",
      "description": "Hosted email passcode and verified-provider sign-in pages."
    },
    {
      "name": "Single sign-on",
      "description": "An organization's OpenID Connect identity provider and the email domain it proves by DNS: admins read the connection, owners change, verify and delete it."
    },
    {
      "name": "User API keys",
      "description": "End-user-owned opaque credentials, project scope policies and backend verification."
    }
  ]
}