{
  "openapi": "3.1.0",
  "info": {
    "title": "PopCloud API",
    "version": "0.1.0"
  },
  "paths": {
    "/health": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Health",
        "operationId": "health_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HealthResponse"
                }
              }
            }
          }
        }
      }
    },
    "/ready": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Ready",
        "description": "DB reachability gates readiness — both the shared pool and the metering\npool. The metering engine is created lazily, so this probe is also what\nproves the metering pool's configuration is valid on first deploy.",
        "operationId": "ready_ready_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          }
        }
      }
    },
    "/version": {
      "get": {
        "tags": [
          "system"
        ],
        "summary": "Version",
        "operationId": "version_version_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VersionResponse"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/signup": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Signup",
        "operationId": "signup_v1_auth_signup_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SignupRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/verify-email": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Verify Email",
        "operationId": "verify_email_v1_auth_verify_email_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/VerifyEmailRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/login": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Login",
        "operationId": "login_v1_auth_login_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LoginRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenPairResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/refresh": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Refresh",
        "operationId": "refresh_v1_auth_refresh_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/RefreshRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenPairResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/logout": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Logout",
        "operationId": "logout_v1_auth_logout_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/LogoutRequest"
                  },
                  {
                    "type": "null"
                  }
                ],
                "title": "Body"
              }
            }
          }
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/switch-org": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Switch Org",
        "operationId": "switch_org_v1_auth_switch_org_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SwitchOrganizationRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TokenPairResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/auth/invitations/accept": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Accept Organization Invitation",
        "operationId": "accept_organization_invitation_v1_auth_invitations_accept_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AcceptOrganizationInviteRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/password/forgot": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Forgot Password",
        "operationId": "forgot_password_v1_auth_password_forgot_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ForgotPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/auth/password/reset": {
      "post": {
        "tags": [
          "auth"
        ],
        "summary": "Reset Password",
        "operationId": "reset_password_v1_auth_password_reset_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ResetPasswordRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/me": {
      "get": {
        "tags": [
          "me"
        ],
        "summary": "Me",
        "operationId": "me_v1_me_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/org": {
      "get": {
        "tags": [
          "org"
        ],
        "summary": "Get Org",
        "operationId": "get_org_v1_org_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrgProfileResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/org/provisioning/retry": {
      "post": {
        "tags": [
          "org"
        ],
        "summary": "Retry Provisioning",
        "operationId": "retry_provisioning_v1_org_provisioning_retry_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ProvisioningRetryResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/organizations": {
      "get": {
        "tags": [
          "org"
        ],
        "summary": "List Organizations",
        "operationId": "list_organizations_v1_organizations_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OrganizationListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/org/team": {
      "get": {
        "tags": [
          "org"
        ],
        "summary": "List Team",
        "operationId": "list_team_v1_org_team_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/org/invitations": {
      "post": {
        "tags": [
          "org"
        ],
        "summary": "Invite Member",
        "operationId": "invite_member_v1_org_invitations_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InviteMemberRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamInvitationResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/org/invitations/{invitation_id}": {
      "delete": {
        "tags": [
          "org"
        ],
        "summary": "Revoke Invitation",
        "operationId": "revoke_invitation_v1_org_invitations__invitation_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "invitation_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Invitation Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/org/members/{user_id}": {
      "patch": {
        "tags": [
          "org"
        ],
        "summary": "Update Member Role",
        "operationId": "update_member_role_v1_org_members__user_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "User Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateMemberRoleRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TeamMemberResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "org"
        ],
        "summary": "Remove Member",
        "operationId": "remove_member_v1_org_members__user_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "user_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "User Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/credentials": {
      "get": {
        "tags": [
          "credentials"
        ],
        "summary": "List Credentials",
        "operationId": "list_credentials_v1_credentials_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "credentials"
        ],
        "summary": "Create Credential",
        "operationId": "create_credential_v1_credentials_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCredentialRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialPairResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/credentials/{credential_id}": {
      "get": {
        "tags": [
          "credentials"
        ],
        "summary": "Get Credential",
        "operationId": "get_credential_v1_credentials__credential_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "credential_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Credential Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "credentials"
        ],
        "summary": "Update Credential Label",
        "operationId": "update_credential_label_v1_credentials__credential_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "credential_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Credential Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateCredentialLabelRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialSummary"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/credentials/{credential_id}/rotate": {
      "post": {
        "tags": [
          "credentials"
        ],
        "summary": "Rotate Credential",
        "operationId": "rotate_credential_v1_credentials__credential_id__rotate_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "credential_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Credential Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialPairResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/credentials/{credential_id}/revoke": {
      "post": {
        "tags": [
          "credentials"
        ],
        "summary": "Revoke Credential",
        "operationId": "revoke_credential_v1_credentials__credential_id__revoke_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "credential_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Credential Id"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/credentials/claim": {
      "post": {
        "tags": [
          "credentials"
        ],
        "summary": "Claim Credential",
        "description": "Grandfathered one-time reveal for the provisioning-minted default\ncredential — see ``CredentialService.claim``. Every credential created\nthrough this router already delivered its secret in the create/rotate\nresponse, so this 409s the moment nothing is left unclaimed.",
        "operationId": "claim_credential_v1_credentials_claim_post",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CredentialPairResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/buckets": {
      "get": {
        "tags": [
          "files"
        ],
        "summary": "List Buckets",
        "operationId": "list_buckets_v1_buckets_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "files"
        ],
        "summary": "Create Bucket",
        "operationId": "create_bucket_v1_buckets_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BucketCreateRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/buckets/{bucket}": {
      "patch": {
        "tags": [
          "files"
        ],
        "summary": "Update Bucket",
        "description": "The bucket settings page (Phase 4-02) — visibility and default\nencryption, each independently. Object Lock is out of scope for this\nphase and deliberately has no field here (see the phase doc's D3).",
        "operationId": "update_bucket_v1_buckets__bucket__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/BucketUpdateRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BucketResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "files"
        ],
        "summary": "Delete Bucket",
        "operationId": "delete_bucket_v1_buckets__bucket__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/buckets/{bucket}/objects": {
      "get": {
        "tags": [
          "files"
        ],
        "summary": "List Objects",
        "operationId": "list_objects_v1_buckets__bucket__objects_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          },
          {
            "name": "prefix",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "",
              "title": "Prefix"
            }
          },
          {
            "name": "delimiter",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "default": "/",
              "title": "Delimiter"
            }
          },
          {
            "name": "token",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Token"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 1000,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "files"
        ],
        "summary": "Delete Object",
        "operationId": "delete_object_v1_buckets__bucket__objects_delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          },
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/buckets/{bucket}/objects/metadata": {
      "get": {
        "tags": [
          "files"
        ],
        "summary": "Object Metadata",
        "description": "B4: the metadata panel. A GET rather than a HEAD because the response\nbody is the point.",
        "operationId": "object_metadata_v1_buckets__bucket__objects_metadata_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          },
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObjectMetadataResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/buckets/{bucket}/cors": {
      "get": {
        "tags": [
          "files"
        ],
        "summary": "Get Cors",
        "description": "CORS runs on the storage account's master key, not the customer's\nown credential: a bucket-level setting is outside what that credential\ncan change.",
        "operationId": "get_cors_v1_buckets__bucket__cors_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorsRulesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "files"
        ],
        "summary": "Put Cors",
        "operationId": "put_cors_v1_buckets__bucket__cors_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CorsRulesRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/CorsRulesResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/buckets/{bucket}/lifecycle": {
      "get": {
        "tags": [
          "files"
        ],
        "summary": "Get Lifecycle",
        "description": "Read automatic cleanup for retained versions and abandoned uploads.",
        "operationId": "get_lifecycle_v1_buckets__bucket__lifecycle_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifecycleSettingsModel"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "put": {
        "tags": [
          "files"
        ],
        "summary": "Put Lifecycle",
        "description": "Set daily cleanup; null keeps that storage indefinitely.",
        "operationId": "put_lifecycle_v1_buckets__bucket__lifecycle_put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "bucket",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/LifecycleSettingsModel"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LifecycleSettingsModel"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/files/presign": {
      "post": {
        "tags": [
          "files"
        ],
        "summary": "Presign Download",
        "description": "Download, or long-lived streaming for video (trap #3: a 15-minute URL\ndies halfway through a feature film).",
        "operationId": "presign_download_v1_files_presign_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/PresignRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresignResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/files/upload-url": {
      "post": {
        "tags": [
          "files"
        ],
        "summary": "Presign Upload",
        "description": "Single-PUT uploads only. The uploader switches to multipart well below\nthe Cloudflare plan's body cap (trap #1), so nothing this mints can 413.",
        "operationId": "presign_upload_v1_files_upload_url_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresignResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/files/multipart": {
      "post": {
        "tags": [
          "files"
        ],
        "summary": "Create Multipart",
        "operationId": "create_multipart_v1_files_multipart_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UploadRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MultipartCreateResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/files/multipart/{upload_id}/sign": {
      "post": {
        "tags": [
          "files"
        ],
        "summary": "Sign Part",
        "operationId": "sign_part_v1_files_multipart__upload_id__sign_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Upload Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MultipartSignRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PresignResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/files/multipart/{upload_id}/parts": {
      "get": {
        "tags": [
          "files"
        ],
        "summary": "List Parts",
        "description": "What the uploader needs to resume rather than restart an interrupted\nmulti-gigabyte upload.",
        "operationId": "list_parts_v1_files_multipart__upload_id__parts_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Upload Id"
            }
          },
          {
            "name": "bucket",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          },
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PartListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/files/multipart/{upload_id}/complete": {
      "post": {
        "tags": [
          "files"
        ],
        "summary": "Complete Multipart",
        "operationId": "complete_multipart_v1_files_multipart__upload_id__complete_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Upload Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MultipartCompleteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MultipartCompleteResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/files/multipart/{upload_id}": {
      "delete": {
        "tags": [
          "files"
        ],
        "summary": "Abort Multipart",
        "description": "Cancelling in the browser must actually abort upstream — unfinished\nparts are billed as storage.",
        "operationId": "abort_multipart_v1_files_multipart__upload_id__delete",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "upload_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Upload Id"
            }
          },
          {
            "name": "bucket",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Bucket"
            }
          },
          {
            "name": "key",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Key"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/pricing": {
      "get": {
        "tags": [
          "pricing"
        ],
        "summary": "Pricing Catalog",
        "operationId": "pricing_catalog_v1_pricing_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricingCatalogResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/usage": {
      "get": {
        "tags": [
          "usage"
        ],
        "summary": "Get Usage",
        "operationId": "get_usage_v1_usage_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Start"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/summary": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Billing Summary",
        "operationId": "billing_summary_v1_billing_summary_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingSummaryResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/billing/ledger": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Billing Ledger",
        "operationId": "billing_ledger_v1_billing_ledger_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LedgerListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/billing/runs": {
      "get": {
        "tags": [
          "billing"
        ],
        "summary": "Billing Runs",
        "operationId": "billing_runs_v1_billing_runs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 366,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingRunListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payments/checkout": {
      "post": {
        "tags": [
          "payments"
        ],
        "summary": "Create Checkout",
        "operationId": "create_checkout_v1_payments_checkout_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 160,
              "title": "Idempotency-Key"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateCheckoutRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTransactionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payments": {
      "get": {
        "tags": [
          "payments"
        ],
        "summary": "List Payments",
        "operationId": "list_payments_v1_payments_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTransactionListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payments/{transaction_id}": {
      "get": {
        "tags": [
          "payments"
        ],
        "summary": "Get Payment",
        "operationId": "get_payment_v1_payments__transaction_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "transaction_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Transaction Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTransactionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/payments/{transaction_id}/refresh": {
      "post": {
        "tags": [
          "payments"
        ],
        "summary": "Refresh Payment",
        "operationId": "refresh_payment_v1_payments__transaction_id__refresh_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "transaction_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Transaction Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentTransactionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/subscriptions": {
      "get": {
        "tags": [
          "events"
        ],
        "summary": "List Event Subscriptions",
        "operationId": "list_event_subscriptions_v1_events_subscriptions_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscriptionListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "events"
        ],
        "summary": "Create Event Subscription",
        "operationId": "create_event_subscription_v1_events_subscriptions_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateEventSubscriptionRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscriptionCreatedResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/events/subscriptions/{subscription_id}": {
      "patch": {
        "tags": [
          "events"
        ],
        "summary": "Update Event Subscription",
        "operationId": "update_event_subscription_v1_events_subscriptions__subscription_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Subscription Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/UpdateEventSubscriptionRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventSubscriptionResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/subscriptions/{subscription_id}/rotate-secret": {
      "post": {
        "tags": [
          "events"
        ],
        "summary": "Rotate Event Subscription Secret",
        "operationId": "rotate_event_subscription_secret_v1_events_subscriptions__subscription_id__rotate_secret_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Subscription Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/RotateEventSecretResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/subscriptions/{subscription_id}/test": {
      "post": {
        "tags": [
          "events"
        ],
        "summary": "Test Event Subscription",
        "operationId": "test_event_subscription_v1_events_subscriptions__subscription_id__test_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "subscription_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Subscription Id"
            }
          }
        ],
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/events/deliveries": {
      "get": {
        "tags": [
          "events"
        ],
        "summary": "List Event Deliveries",
        "operationId": "list_event_deliveries_v1_events_deliveries_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "subscription_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Subscription Id"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/EventDeliveryListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/ping": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Ping",
        "operationId": "ping_v1_admin_ping_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/admin/orgs": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Create Org",
        "operationId": "create_org_v1_admin_orgs_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminCreateOrgRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminOrgResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Orgs",
        "operationId": "list_orgs_v1_admin_orgs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Query"
            }
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "$ref": "#/components/schemas/OrgStatus"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Status"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminOrgListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/storage/validate": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Validate Storage Credential",
        "description": "The admin create-org form's \"Validate\" action — checks one tier's key\nlive without creating anything.",
        "operationId": "validate_storage_credential_v1_admin_storage_validate_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ValidateStorageCredentialRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/admin/storage-pools": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Storage Pools",
        "operationId": "list_storage_pools_v1_admin_storage_pools_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminStoragePoolListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Create Storage Pool",
        "operationId": "create_storage_pool_v1_admin_storage_pools_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminCreateStoragePoolRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminStoragePoolResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/admin/storage-pools/{pool_id}": {
      "patch": {
        "tags": [
          "admin"
        ],
        "summary": "Update Storage Pool",
        "operationId": "update_storage_pool_v1_admin_storage_pools__pool_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "pool_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Pool Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminUpdateStoragePoolRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminStoragePoolResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/orgs/{org_id}/reprovision": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Reprovision Org",
        "operationId": "reprovision_org_v1_admin_orgs__org_id__reprovision_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminOrgResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/orgs/{org_id}/invite": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Resend Invite",
        "operationId": "resend_invite_v1_admin_orgs__org_id__invite_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MessageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/orgs/{org_id}/storage/{tier}": {
      "put": {
        "tags": [
          "admin"
        ],
        "summary": "Replace Storage Credentials",
        "operationId": "replace_storage_credentials_v1_admin_orgs__org_id__storage__tier__put",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org Id"
            }
          },
          {
            "name": "tier",
            "in": "path",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/StorageTier"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceStorageCredentialsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminStorageAccountResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/orgs/{org_id}/buckets/import": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Preview Bucket Import",
        "description": "Bucket names that already exist in this org's storage account but have\nno row here yet — Phase 5's on-ramp for Tall Tale, whose account already\nhas buckets. Import itself happens through POST /v1/buckets/import.",
        "operationId": "preview_bucket_import_v1_admin_orgs__org_id__buckets_import_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org Id"
            }
          },
          {
            "name": "tier",
            "in": "query",
            "required": true,
            "schema": {
              "$ref": "#/components/schemas/StorageTier"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "string"
                  },
                  "title": "Response Preview Bucket Import V1 Admin Orgs  Org Id  Buckets Import Get"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/regions": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Regions",
        "operationId": "list_regions_v1_admin_regions_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminRegionListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/admin/storage-accounts/unhealthy": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Unhealthy Storage Accounts",
        "description": "G4's per-org replacement for the old region-level key-pool view: a\ndead master key is one customer's problem now, not the platform's.",
        "operationId": "list_unhealthy_storage_accounts_v1_admin_storage_accounts_unhealthy_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminUnhealthyStorageAccountListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/admin/data-plane": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Data Plane Health",
        "description": "I1 (basic): probe each region's public endpoint from here.\n\nThe canary is an unauthenticated GET at the bucket root. A *live* Worker\nanswers it with our own sanitized 403 and stamps ``x-popcloud-region`` —\nso \"403 with our header\" is the healthy signal, and a 200, a gateway error,\nor a missing header all mean something else is answering on that hostname.\nProbing the real customer-facing host is the point: it covers DNS, TLS, the\nroute binding and the Worker in one call.",
        "operationId": "data_plane_health_v1_admin_data_plane_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminDataPlaneListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/admin/pricing/plans": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Pricing Plans",
        "operationId": "list_pricing_plans_v1_admin_pricing_plans_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminPricingPlanListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      },
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Create Pricing Plan",
        "operationId": "create_pricing_plan_v1_admin_pricing_plans_post",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminCreatePricingPlanRequest"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricingPlanResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/admin/pricing/plans/{code}": {
      "patch": {
        "tags": [
          "admin"
        ],
        "summary": "Update Pricing Plan",
        "operationId": "update_pricing_plan_v1_admin_pricing_plans__code__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "code",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "title": "Code"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminUpdatePricingPlanRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PricingPlanResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/reconciliation/daily/{usage_date}": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Reconcile Daily",
        "operationId": "reconcile_daily_v1_admin_reconciliation_daily__usage_date__post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "usage_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Usage Date"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReconciliationRunResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/reconciliation/supplier-imports": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Import Supplier Usage",
        "operationId": "import_supplier_usage_v1_admin_reconciliation_supplier_imports_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/SupplierUsageImportRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReconciliationRunResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Supplier Imports",
        "operationId": "list_supplier_imports_v1_admin_reconciliation_supplier_imports_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SupplierUsageImportListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/reconciliation/runs": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Reconciliation Runs",
        "operationId": "list_reconciliation_runs_v1_admin_reconciliation_runs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 100,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ReconciliationRunListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/usage/organizations/{org_id}": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Get Organization Usage",
        "operationId": "get_organization_usage_v1_admin_usage_organizations__org_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org Id"
            }
          },
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Start"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/usage/rollup-runs": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Rollup Runs",
        "operationId": "list_rollup_runs_v1_admin_usage_rollup_runs_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "start",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Start"
            }
          },
          {
            "name": "end",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "title": "End"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UsageRollupRunListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/usage/scheduled-jobs": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Scheduled Jobs",
        "description": "Production job freshness and failures for staff operations.",
        "operationId": "list_scheduled_jobs_v1_admin_usage_scheduled_jobs_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ScheduledJobListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/admin/usage/queue-health": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Queue Health",
        "description": "Best-effort backlog and dead-letter visibility from Cloudflare.",
        "operationId": "queue_health_v1_admin_usage_queue_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/QueueHealthResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/admin/usage/health": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Get Metering Health",
        "operationId": "get_metering_health_v1_admin_usage_health_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MeteringHealthResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/admin/billing/accounts": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Billing Accounts",
        "operationId": "list_billing_accounts_v1_admin_billing_accounts_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminBillingAccountListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/billing/organizations/{org_id}": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "Get Billing Account",
        "operationId": "get_billing_account_v1_admin_billing_organizations__org_id__get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminBillingAccountResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      },
      "patch": {
        "tags": [
          "admin"
        ],
        "summary": "Update Billing Account",
        "operationId": "update_billing_account_v1_admin_billing_organizations__org_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminBillingSettingsRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminBillingAccountResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/billing/organizations/{org_id}/adjustments": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Create Ledger Adjustment",
        "operationId": "create_ledger_adjustment_v1_admin_billing_organizations__org_id__adjustments_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminLedgerAdjustmentRequest"
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingBalanceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/billing/organizations/{org_id}/runs/{usage_date}": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Calculate Billing Run",
        "operationId": "calculate_billing_run_v1_admin_billing_organizations__org_id__runs__usage_date__post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org Id"
            }
          },
          {
            "name": "usage_date",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date",
              "title": "Usage Date"
            }
          },
          {
            "name": "post",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Post"
            }
          },
          {
            "name": "missing_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean",
              "default": false,
              "title": "Missing Only"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingRunResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/billing/organizations/{org_id}/enforce": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Enforce Billing Account",
        "operationId": "enforce_billing_account_v1_admin_billing_organizations__org_id__enforce_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "org_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Org Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/BillingBalanceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/payments/webhook-events": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Webhook Events",
        "operationId": "list_webhook_events_v1_admin_payments_webhook_events_get",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 500,
              "minimum": 1,
              "default": 200,
              "title": "Limit"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PaymentWebhookEventListResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/events/sources": {
      "get": {
        "tags": [
          "admin"
        ],
        "summary": "List Event Sources",
        "operationId": "list_event_sources_v1_admin_events_sources_get",
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminEventSourceListResponse"
                }
              }
            }
          }
        },
        "security": [
          {
            "HTTPBearer": []
          }
        ]
      }
    },
    "/v1/admin/events/sources/{source_id}/rotate-secret": {
      "post": {
        "tags": [
          "admin"
        ],
        "summary": "Rotate Event Source",
        "operationId": "rotate_event_source_v1_admin_events_sources__source_id__rotate_secret_post",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "source_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Source Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminRotateEventSourceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/v1/admin/events/sources/{source_id}": {
      "patch": {
        "tags": [
          "admin"
        ],
        "summary": "Update Event Source",
        "operationId": "update_event_source_v1_admin_events_sources__source_id__patch",
        "security": [
          {
            "HTTPBearer": []
          }
        ],
        "parameters": [
          {
            "name": "source_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Source Id"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdminEventSourceStatusRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdminEventSourceResponse"
                }
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/internal/metering/events": {
      "post": {
        "tags": [
          "internal"
        ],
        "summary": "Ingest Metering Events",
        "description": "Persist one event, or a batch of them.\n\nBoth shapes are accepted on purpose. The live Worker posts a single bare\nevent; the array is what a batching transport (a queue consumer, or a\nWorker that accumulates) would post, and accepting it now means that change\nnever has to touch this endpoint or its schema.",
        "operationId": "ingest_metering_events_internal_metering_events_post",
        "parameters": [
          {
            "name": "authorization",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Authorization"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "anyOf": [
                  {
                    "$ref": "#/components/schemas/MeteringEvent"
                  },
                  {
                    "$ref": "#/components/schemas/MeteringEventBatch"
                  }
                ],
                "title": "Payload"
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/cinevision-payment": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Cinevision Payment Webhook",
        "operationId": "cinevision_payment_webhook_webhooks_cinevision_payment_post",
        "parameters": [
          {
            "name": "X-Platform-Signature",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Platform-Signature"
            }
          },
          {
            "name": "X-Platform-Event",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Platform-Event"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Successful Response"
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    },
    "/webhooks/storage-events/{source_id}": {
      "post": {
        "tags": [
          "webhooks"
        ],
        "summary": "Storage Event Webhook",
        "operationId": "storage_event_webhook_webhooks_storage_events__source_id__post",
        "parameters": [
          {
            "name": "source_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Source Id"
            }
          },
          {
            "name": "X-Bz-Event-Notification-Signature",
            "in": "header",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "title": "X-Bz-Event-Notification-Signature"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {}
              }
            }
          },
          "422": {
            "description": "Validation Error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/HTTPValidationError"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "AcceptOrganizationInviteRequest": {
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 512,
            "minLength": 1,
            "title": "Token"
          },
          "password": {
            "type": "string",
            "maxLength": 256,
            "minLength": 8,
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "token",
          "password"
        ],
        "title": "AcceptOrganizationInviteRequest"
      },
      "AdminBillingAccountListResponse": {
        "properties": {
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/AdminBillingAccountResponse"
            },
            "type": "array",
            "title": "Accounts"
          }
        },
        "type": "object",
        "required": [
          "accounts"
        ],
        "title": "AdminBillingAccountListResponse"
      },
      "AdminBillingAccountResponse": {
        "properties": {
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id"
          },
          "org_name": {
            "type": "string",
            "title": "Org Name"
          },
          "org_status": {
            "type": "string",
            "title": "Org Status"
          },
          "currency": {
            "type": "string",
            "const": "USD",
            "title": "Currency"
          },
          "balance_micros": {
            "type": "integer",
            "title": "Balance Micros"
          },
          "balance_usd": {
            "type": "string",
            "title": "Balance Usd"
          },
          "low_balance_threshold_micros": {
            "type": "integer",
            "title": "Low Balance Threshold Micros"
          },
          "low_balance_threshold_usd": {
            "type": "string",
            "title": "Low Balance Threshold Usd"
          },
          "low_balance": {
            "type": "boolean",
            "title": "Low Balance"
          },
          "billing_enabled": {
            "type": "boolean",
            "title": "Billing Enabled"
          },
          "enforcement_enabled": {
            "type": "boolean",
            "title": "Enforcement Enabled"
          },
          "suspended_by_billing": {
            "type": "boolean",
            "title": "Suspended By Billing"
          },
          "pricing_plan_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Plan Code"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "org_name",
          "org_status",
          "currency",
          "balance_micros",
          "balance_usd",
          "low_balance_threshold_micros",
          "low_balance_threshold_usd",
          "low_balance",
          "billing_enabled",
          "enforcement_enabled",
          "suspended_by_billing",
          "pricing_plan_code",
          "created_at"
        ],
        "title": "AdminBillingAccountResponse"
      },
      "AdminBillingSettingsRequest": {
        "properties": {
          "billing_enabled": {
            "type": "boolean",
            "title": "Billing Enabled"
          },
          "enforcement_enabled": {
            "type": "boolean",
            "title": "Enforcement Enabled"
          },
          "low_balance_threshold_micros": {
            "type": "integer",
            "minimum": 0,
            "title": "Low Balance Threshold Micros"
          },
          "pricing_plan_code": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64,
                "minLength": 3
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Plan Code"
          }
        },
        "type": "object",
        "required": [
          "billing_enabled",
          "enforcement_enabled",
          "low_balance_threshold_micros"
        ],
        "title": "AdminBillingSettingsRequest"
      },
      "AdminCreateOrgRequest": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          },
          "owner_email": {
            "type": "string",
            "format": "email",
            "title": "Owner Email"
          },
          "region": {
            "type": "string",
            "title": "Region",
            "default": "canada"
          },
          "hot": {
            "$ref": "#/components/schemas/TierCredentialModel"
          },
          "cool": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TierCredentialModel"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "name",
          "owner_email",
          "hot"
        ],
        "title": "AdminCreateOrgRequest"
      },
      "AdminCreatePricingPlanRequest": {
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[a-z0-9][a-z0-9-]{2,63}$",
            "title": "Code"
          },
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 2,
            "title": "Name"
          },
          "category": {
            "type": "string",
            "enum": [
              "supplier",
              "retail"
            ],
            "title": "Category"
          },
          "effective_from": {
            "type": "string",
            "format": "date",
            "title": "Effective From"
          },
          "effective_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective To"
          },
          "active": {
            "type": "boolean",
            "title": "Active",
            "default": true
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default",
            "default": false
          },
          "notes": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "rates": {
            "items": {
              "$ref": "#/components/schemas/AdminPricingTierRateRequest"
            },
            "type": "array",
            "maxItems": 2,
            "minItems": 1,
            "title": "Rates"
          }
        },
        "type": "object",
        "required": [
          "code",
          "name",
          "category",
          "effective_from",
          "rates"
        ],
        "title": "AdminCreatePricingPlanRequest"
      },
      "AdminCreateStoragePoolRequest": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Name"
          },
          "region": {
            "type": "string",
            "title": "Region",
            "default": "canada"
          },
          "tier": {
            "$ref": "#/components/schemas/StorageTier",
            "default": "hot"
          },
          "credential": {
            "$ref": "#/components/schemas/TierCredentialModel"
          },
          "bucket_limit": {
            "type": "integer",
            "maximum": 100000,
            "minimum": 1,
            "title": "Bucket Limit",
            "default": 100
          }
        },
        "type": "object",
        "required": [
          "name",
          "credential"
        ],
        "title": "AdminCreateStoragePoolRequest"
      },
      "AdminDataPlaneListResponse": {
        "properties": {
          "regions": {
            "items": {
              "$ref": "#/components/schemas/AdminDataPlaneResponse"
            },
            "type": "array",
            "title": "Regions"
          }
        },
        "type": "object",
        "required": [
          "regions"
        ],
        "title": "AdminDataPlaneListResponse"
      },
      "AdminDataPlaneResponse": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "endpoint_url": {
            "type": "string",
            "title": "Endpoint Url"
          },
          "worker_reachable": {
            "type": "boolean",
            "title": "Worker Reachable"
          },
          "latency_ms": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latency Ms"
          },
          "detail": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Detail"
          }
        },
        "type": "object",
        "required": [
          "code",
          "enabled",
          "endpoint_url",
          "worker_reachable",
          "latency_ms",
          "detail"
        ],
        "title": "AdminDataPlaneResponse",
        "description": "I1 (basic): is the Worker answering on this region's public endpoint."
      },
      "AdminEventSourceListResponse": {
        "properties": {
          "sources": {
            "items": {
              "$ref": "#/components/schemas/AdminEventSourceResponse"
            },
            "type": "array",
            "title": "Sources"
          }
        },
        "type": "object",
        "required": [
          "sources"
        ],
        "title": "AdminEventSourceListResponse"
      },
      "AdminEventSourceResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id"
          },
          "bucket_id": {
            "type": "string",
            "format": "uuid",
            "title": "Bucket Id"
          },
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "bucket_label": {
            "type": "string",
            "title": "Bucket Label"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_activation",
              "active",
              "failed",
              "disabled"
            ],
            "title": "Status"
          },
          "provider_rule_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rule Name"
          },
          "target_url": {
            "type": "string",
            "title": "Target Url"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "org_id",
          "bucket_id",
          "bucket",
          "bucket_label",
          "status",
          "provider_rule_name",
          "target_url",
          "last_error",
          "created_at"
        ],
        "title": "AdminEventSourceResponse"
      },
      "AdminEventSourceStatusRequest": {
        "properties": {
          "status": {
            "type": "string",
            "enum": [
              "active",
              "failed",
              "disabled"
            ],
            "title": "Status"
          },
          "provider_rule_name": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 63,
                "minLength": 6
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rule Name"
          },
          "error": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 2000
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "AdminEventSourceStatusRequest"
      },
      "AdminLedgerAdjustmentRequest": {
        "properties": {
          "amount_micros": {
            "type": "integer",
            "title": "Amount Micros"
          },
          "reference_id": {
            "type": "string",
            "maxLength": 160,
            "minLength": 3,
            "pattern": "^[A-Za-z0-9._:-]+$",
            "title": "Reference Id"
          },
          "description": {
            "type": "string",
            "maxLength": 500,
            "minLength": 3,
            "title": "Description"
          }
        },
        "type": "object",
        "required": [
          "amount_micros",
          "reference_id",
          "description"
        ],
        "title": "AdminLedgerAdjustmentRequest"
      },
      "AdminOrgListResponse": {
        "properties": {
          "orgs": {
            "items": {
              "$ref": "#/components/schemas/AdminOrgResponse"
            },
            "type": "array",
            "title": "Orgs"
          }
        },
        "type": "object",
        "required": [
          "orgs"
        ],
        "title": "AdminOrgListResponse"
      },
      "AdminOrgResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "$ref": "#/components/schemas/OrgStatus"
          },
          "region_code": {
            "type": "string",
            "title": "Region Code"
          },
          "internal_id": {
            "type": "string",
            "title": "Internal Id"
          },
          "provisioned_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provisioned At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "provisioning": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProvisioningRunInfo"
              },
              {
                "type": "null"
              }
            ]
          },
          "storage_accounts": {
            "items": {
              "$ref": "#/components/schemas/AdminStorageAccountResponse"
            },
            "type": "array",
            "title": "Storage Accounts"
          },
          "bucket_count": {
            "type": "integer",
            "title": "Bucket Count"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "region_code",
          "internal_id",
          "provisioned_at",
          "created_at",
          "provisioning",
          "storage_accounts",
          "bucket_count"
        ],
        "title": "AdminOrgResponse"
      },
      "AdminPricingPlanListResponse": {
        "properties": {
          "plans": {
            "items": {
              "$ref": "#/components/schemas/PricingPlanResponse"
            },
            "type": "array",
            "title": "Plans"
          }
        },
        "type": "object",
        "required": [
          "plans"
        ],
        "title": "AdminPricingPlanListResponse"
      },
      "AdminPricingTierRateRequest": {
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "hot",
              "cool"
            ],
            "title": "Tier"
          },
          "storage_micros_per_tb_month": {
            "type": "integer",
            "minimum": 0,
            "title": "Storage Micros Per Tb Month"
          },
          "included_egress_basis_points": {
            "type": "integer",
            "minimum": 0,
            "title": "Included Egress Basis Points"
          },
          "egress_overage_micros_per_gb": {
            "type": "integer",
            "minimum": 0,
            "title": "Egress Overage Micros Per Gb"
          },
          "api_b_micros_per_10k": {
            "type": "integer",
            "minimum": 0,
            "title": "Api B Micros Per 10K"
          },
          "api_c_micros_per_1k": {
            "type": "integer",
            "minimum": 0,
            "title": "Api C Micros Per 1K"
          },
          "api_b_free_per_day": {
            "type": "integer",
            "minimum": 0,
            "title": "Api B Free Per Day",
            "default": 2500
          },
          "api_c_free_per_day": {
            "type": "integer",
            "minimum": 0,
            "title": "Api C Free Per Day",
            "default": 2500
          },
          "cdn_micros_per_gb": {
            "type": "integer",
            "minimum": 0,
            "title": "Cdn Micros Per Gb"
          }
        },
        "type": "object",
        "required": [
          "tier",
          "storage_micros_per_tb_month",
          "included_egress_basis_points",
          "egress_overage_micros_per_gb",
          "api_b_micros_per_10k",
          "api_c_micros_per_1k",
          "cdn_micros_per_gb"
        ],
        "title": "AdminPricingTierRateRequest"
      },
      "AdminRegionListResponse": {
        "properties": {
          "regions": {
            "items": {
              "$ref": "#/components/schemas/AdminRegionResponse"
            },
            "type": "array",
            "title": "Regions"
          }
        },
        "type": "object",
        "required": [
          "regions"
        ],
        "title": "AdminRegionListResponse"
      },
      "AdminRegionResponse": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "popcloud_endpoint": {
            "type": "string",
            "title": "Popcloud Endpoint"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          }
        },
        "type": "object",
        "required": [
          "code",
          "popcloud_endpoint",
          "enabled"
        ],
        "title": "AdminRegionResponse",
        "description": "G4: which regions are open for new storage accounts. Key-pool health\nis per storage account now (see /v1/admin/storage-accounts) — a dead\ninfrastructure key is one customer's problem, not a platform-wide region flag."
      },
      "AdminRotateEventSourceResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id"
          },
          "bucket_id": {
            "type": "string",
            "format": "uuid",
            "title": "Bucket Id"
          },
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "bucket_label": {
            "type": "string",
            "title": "Bucket Label"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending_activation",
              "active",
              "failed",
              "disabled"
            ],
            "title": "Status"
          },
          "provider_rule_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Rule Name"
          },
          "target_url": {
            "type": "string",
            "title": "Target Url"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "signing_secret": {
            "type": "string",
            "title": "Signing Secret"
          }
        },
        "type": "object",
        "required": [
          "id",
          "org_id",
          "bucket_id",
          "bucket",
          "bucket_label",
          "status",
          "provider_rule_name",
          "target_url",
          "last_error",
          "created_at",
          "signing_secret"
        ],
        "title": "AdminRotateEventSourceResponse"
      },
      "AdminStorageAccountResponse": {
        "properties": {
          "tier": {
            "$ref": "#/components/schemas/StorageTier"
          },
          "region_code": {
            "type": "string",
            "title": "Region Code"
          },
          "healthy": {
            "type": "boolean",
            "title": "Healthy"
          },
          "last_health_check_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Health Check At"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "dataplane_ready": {
            "type": "boolean",
            "title": "Dataplane Ready"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "tier",
          "region_code",
          "healthy",
          "last_health_check_at",
          "last_error",
          "dataplane_ready",
          "created_at"
        ],
        "title": "AdminStorageAccountResponse",
        "description": "Never the credential itself — only whether it currently works."
      },
      "AdminStoragePoolListResponse": {
        "properties": {
          "pools": {
            "items": {
              "$ref": "#/components/schemas/AdminStoragePoolResponse"
            },
            "type": "array",
            "title": "Pools"
          }
        },
        "type": "object",
        "required": [
          "pools"
        ],
        "title": "AdminStoragePoolListResponse"
      },
      "AdminStoragePoolResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "region": {
            "type": "string",
            "title": "Region"
          },
          "tier": {
            "$ref": "#/components/schemas/StorageTier"
          },
          "backend_account_id": {
            "type": "string",
            "title": "Backend Account Id"
          },
          "enabled": {
            "type": "boolean",
            "title": "Enabled"
          },
          "healthy": {
            "type": "boolean",
            "title": "Healthy"
          },
          "bucket_count": {
            "type": "integer",
            "title": "Bucket Count"
          },
          "allocated_org_count": {
            "type": "integer",
            "title": "Allocated Org Count"
          },
          "unmanaged_bucket_count": {
            "type": "integer",
            "title": "Unmanaged Bucket Count"
          },
          "capacity_used": {
            "type": "integer",
            "title": "Capacity Used"
          },
          "bucket_limit": {
            "type": "integer",
            "title": "Bucket Limit"
          },
          "last_health_check_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Health Check At"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "region",
          "tier",
          "backend_account_id",
          "enabled",
          "healthy",
          "bucket_count",
          "allocated_org_count",
          "unmanaged_bucket_count",
          "capacity_used",
          "bucket_limit",
          "last_health_check_at",
          "last_error",
          "created_at"
        ],
        "title": "AdminStoragePoolResponse"
      },
      "AdminUnhealthyStorageAccountListResponse": {
        "properties": {
          "accounts": {
            "items": {
              "$ref": "#/components/schemas/AdminUnhealthyStorageAccountResponse"
            },
            "type": "array",
            "title": "Accounts"
          }
        },
        "type": "object",
        "required": [
          "accounts"
        ],
        "title": "AdminUnhealthyStorageAccountListResponse"
      },
      "AdminUnhealthyStorageAccountResponse": {
        "properties": {
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id"
          },
          "org_name": {
            "type": "string",
            "title": "Org Name"
          },
          "tier": {
            "$ref": "#/components/schemas/StorageTier"
          },
          "region_code": {
            "type": "string",
            "title": "Region Code"
          },
          "last_health_check_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Health Check At"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "org_name",
          "tier",
          "region_code",
          "last_health_check_at",
          "last_error"
        ],
        "title": "AdminUnhealthyStorageAccountResponse",
        "description": "G4's replacement for the old region-level health view: every storage\naccount currently failing its health check, across every org."
      },
      "AdminUpdatePricingPlanRequest": {
        "properties": {
          "active": {
            "type": "boolean",
            "title": "Active"
          }
        },
        "type": "object",
        "required": [
          "active"
        ],
        "title": "AdminUpdatePricingPlanRequest"
      },
      "AdminUpdateStoragePoolRequest": {
        "properties": {
          "enabled": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Enabled"
          },
          "bucket_limit": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 100000,
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Bucket Limit"
          },
          "credential": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/TierCredentialModel"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "title": "AdminUpdateStoragePoolRequest"
      },
      "BillingBalanceResponse": {
        "properties": {
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id"
          },
          "balance_micros": {
            "type": "integer",
            "title": "Balance Micros"
          },
          "balance_usd": {
            "type": "string",
            "title": "Balance Usd"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "balance_micros",
          "balance_usd"
        ],
        "title": "BillingBalanceResponse"
      },
      "BillingRunListResponse": {
        "properties": {
          "runs": {
            "items": {
              "$ref": "#/components/schemas/BillingRunResponse"
            },
            "type": "array",
            "title": "Runs"
          }
        },
        "type": "object",
        "required": [
          "runs"
        ],
        "title": "BillingRunListResponse"
      },
      "BillingRunResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id"
          },
          "usage_date": {
            "type": "string",
            "format": "date",
            "title": "Usage Date"
          },
          "status": {
            "type": "string",
            "enum": [
              "preview",
              "posted",
              "posted_warning",
              "skipped",
              "blocked",
              "failed"
            ],
            "title": "Status"
          },
          "revision": {
            "type": "integer",
            "title": "Revision"
          },
          "storage_charge_micros": {
            "type": "integer",
            "title": "Storage Charge Micros"
          },
          "api_charge_micros": {
            "type": "integer",
            "title": "Api Charge Micros"
          },
          "egress_charge_micros": {
            "type": "integer",
            "title": "Egress Charge Micros"
          },
          "total_charge_micros": {
            "type": "integer",
            "title": "Total Charge Micros"
          },
          "posted_charge_micros": {
            "type": "integer",
            "title": "Posted Charge Micros"
          },
          "total_charge_usd": {
            "type": "string",
            "title": "Total Charge Usd"
          },
          "posted_charge_usd": {
            "type": "string",
            "title": "Posted Charge Usd"
          },
          "source_request_count": {
            "type": "integer",
            "title": "Source Request Count"
          },
          "source_snapshot_count": {
            "type": "integer",
            "title": "Source Snapshot Count"
          },
          "warnings": {
            "items": {
              "additionalProperties": true,
              "type": "object"
            },
            "type": "array",
            "title": "Warnings"
          },
          "calculated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Calculated At"
          },
          "posted_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Posted At"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "id",
          "org_id",
          "usage_date",
          "status",
          "revision",
          "storage_charge_micros",
          "api_charge_micros",
          "egress_charge_micros",
          "total_charge_micros",
          "posted_charge_micros",
          "total_charge_usd",
          "posted_charge_usd",
          "source_request_count",
          "source_snapshot_count",
          "warnings",
          "calculated_at",
          "posted_at",
          "error"
        ],
        "title": "BillingRunResponse"
      },
      "BillingSummaryResponse": {
        "properties": {
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id"
          },
          "org_name": {
            "type": "string",
            "title": "Org Name"
          },
          "org_status": {
            "type": "string",
            "title": "Org Status"
          },
          "currency": {
            "type": "string",
            "const": "USD",
            "title": "Currency"
          },
          "balance_micros": {
            "type": "integer",
            "title": "Balance Micros"
          },
          "balance_usd": {
            "type": "string",
            "title": "Balance Usd"
          },
          "low_balance_threshold_micros": {
            "type": "integer",
            "title": "Low Balance Threshold Micros"
          },
          "low_balance_threshold_usd": {
            "type": "string",
            "title": "Low Balance Threshold Usd"
          },
          "low_balance": {
            "type": "boolean",
            "title": "Low Balance"
          },
          "billing_enabled": {
            "type": "boolean",
            "title": "Billing Enabled"
          },
          "enforcement_enabled": {
            "type": "boolean",
            "title": "Enforcement Enabled"
          },
          "suspended_by_billing": {
            "type": "boolean",
            "title": "Suspended By Billing"
          },
          "pricing_plan_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Pricing Plan Code"
          }
        },
        "type": "object",
        "required": [
          "org_id",
          "org_name",
          "org_status",
          "currency",
          "balance_micros",
          "balance_usd",
          "low_balance_threshold_micros",
          "low_balance_threshold_usd",
          "low_balance",
          "billing_enabled",
          "enforcement_enabled",
          "suspended_by_billing",
          "pricing_plan_code"
        ],
        "title": "BillingSummaryResponse"
      },
      "BucketCreateRequest": {
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 30,
            "minLength": 1,
            "title": "Label"
          },
          "tier": {
            "$ref": "#/components/schemas/StorageTier",
            "default": "hot"
          },
          "visibility": {
            "$ref": "#/components/schemas/BucketVisibility",
            "default": "private"
          },
          "encryption": {
            "type": "boolean",
            "title": "Encryption",
            "default": true
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "BucketCreateRequest"
      },
      "BucketListResponse": {
        "properties": {
          "buckets": {
            "items": {
              "$ref": "#/components/schemas/BucketResponse"
            },
            "type": "array",
            "title": "Buckets"
          }
        },
        "type": "object",
        "required": [
          "buckets"
        ],
        "title": "BucketListResponse"
      },
      "BucketResponse": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "label": {
            "type": "string",
            "title": "Label"
          },
          "tier": {
            "$ref": "#/components/schemas/StorageTier"
          },
          "region": {
            "type": "string",
            "title": "Region"
          },
          "endpoint_url": {
            "type": "string",
            "title": "Endpoint Url"
          },
          "status": {
            "$ref": "#/components/schemas/BucketStatus"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "visibility": {
            "$ref": "#/components/schemas/BucketVisibility"
          },
          "encryption_enabled": {
            "type": "boolean",
            "title": "Encryption Enabled"
          },
          "public_base_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Public Base Url"
          }
        },
        "type": "object",
        "required": [
          "name",
          "label",
          "tier",
          "region",
          "endpoint_url",
          "status",
          "created_at",
          "visibility",
          "encryption_enabled",
          "public_base_url"
        ],
        "title": "BucketResponse"
      },
      "BucketStatus": {
        "type": "string",
        "enum": [
          "creating",
          "active",
          "deleting",
          "deleted"
        ],
        "title": "BucketStatus",
        "description": "A bucket row is the source of truth; CREATING covers both \"not yet\nconfirmed in storage\" and \"a previous attempt failed\" — POST /v1/buckets\nresumes a CREATING row for the same label rather than erroring, the same\ncheckpoint-and-retry discipline as provisioning runs."
      },
      "BucketUpdateRequest": {
        "properties": {
          "visibility": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/BucketVisibility"
              },
              {
                "type": "null"
              }
            ]
          },
          "encryption": {
            "anyOf": [
              {
                "type": "boolean"
              },
              {
                "type": "null"
              }
            ],
            "title": "Encryption"
          }
        },
        "type": "object",
        "title": "BucketUpdateRequest",
        "description": "PATCH /v1/buckets/{bucket} — the reversible settings only (Phase\n4-02). Unset fields are left unchanged; this is not a replace-the-whole-\nresource PUT. Object Lock gets its own endpoint when it ships, by design\n(see the phase doc's D3) — never a field here."
      },
      "BucketVisibility": {
        "type": "string",
        "enum": [
          "private",
          "public"
        ],
        "title": "BucketVisibility",
        "description": "Phase 4-02: who can read a bucket's objects without a signed request.\n\nEnforced entirely at the edge (see ``worker/src/index.js``). The internal\nbucket remains private so every public read still passes through PopCloud\nmetering, billing and access controls."
      },
      "CorsRuleModel": {
        "properties": {
          "name": {
            "type": "string",
            "maxLength": 50,
            "title": "Name"
          },
          "origins": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "maxItems": 20,
            "minItems": 1,
            "title": "Origins"
          },
          "methods": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "minItems": 1,
            "title": "Methods"
          },
          "headers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Headers",
            "default": [
              "*"
            ]
          },
          "expose_headers": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Expose Headers",
            "default": [
              "etag"
            ]
          },
          "max_age_seconds": {
            "type": "integer",
            "maximum": 86400,
            "minimum": 0,
            "title": "Max Age Seconds",
            "default": 3600
          }
        },
        "type": "object",
        "required": [
          "name",
          "origins",
          "methods"
        ],
        "title": "CorsRuleModel",
        "description": "B8: customers add their own app origins. The default dashboard rule set\nat provision time is included in reads and can be replaced here."
      },
      "CorsRulesRequest": {
        "properties": {
          "rules": {
            "items": {
              "$ref": "#/components/schemas/CorsRuleModel"
            },
            "type": "array",
            "maxItems": 20,
            "title": "Rules"
          }
        },
        "type": "object",
        "required": [
          "rules"
        ],
        "title": "CorsRulesRequest"
      },
      "CorsRulesResponse": {
        "properties": {
          "rules": {
            "items": {
              "$ref": "#/components/schemas/CorsRuleModel"
            },
            "type": "array",
            "title": "Rules"
          }
        },
        "type": "object",
        "required": [
          "rules"
        ],
        "title": "CorsRulesResponse"
      },
      "CreateCheckoutRequest": {
        "properties": {
          "amount_minor": {
            "type": "integer",
            "title": "Amount Minor",
            "description": "USD cents"
          }
        },
        "type": "object",
        "required": [
          "amount_minor"
        ],
        "title": "CreateCheckoutRequest"
      },
      "CreateCredentialRequest": {
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Label"
          },
          "scope_all_buckets": {
            "type": "boolean",
            "title": "Scope All Buckets",
            "default": true
          },
          "bucket_names": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Bucket Names"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/CredentialPermission"
            },
            "type": "array",
            "title": "Permissions"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "CreateCredentialRequest"
      },
      "CreateEventSubscriptionRequest": {
        "properties": {
          "bucket": {
            "type": "string",
            "maxLength": 63,
            "minLength": 6,
            "title": "Bucket"
          },
          "name": {
            "type": "string",
            "maxLength": 80,
            "minLength": 3,
            "pattern": "^[A-Za-z0-9][A-Za-z0-9 ._-]+$",
            "title": "Name"
          },
          "endpoint_url": {
            "type": "string",
            "maxLength": 2083,
            "minLength": 1,
            "format": "uri",
            "title": "Endpoint Url"
          },
          "event_types": {
            "items": {
              "type": "string",
              "enum": [
                "object.created",
                "object.deleted",
                "object.hidden"
              ]
            },
            "type": "array",
            "maxItems": 3,
            "minItems": 1,
            "title": "Event Types"
          },
          "object_prefix": {
            "type": "string",
            "maxLength": 1024,
            "title": "Object Prefix",
            "default": ""
          }
        },
        "type": "object",
        "required": [
          "bucket",
          "name",
          "endpoint_url",
          "event_types"
        ],
        "title": "CreateEventSubscriptionRequest"
      },
      "CredentialListResponse": {
        "properties": {
          "credentials": {
            "items": {
              "$ref": "#/components/schemas/CredentialSummary"
            },
            "type": "array",
            "title": "Credentials"
          }
        },
        "type": "object",
        "required": [
          "credentials"
        ],
        "title": "CredentialListResponse"
      },
      "CredentialPairResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "access_key_id": {
            "type": "string",
            "title": "Access Key Id"
          },
          "secret_access_key": {
            "type": "string",
            "title": "Secret Access Key"
          },
          "endpoint_url": {
            "type": "string",
            "title": "Endpoint Url"
          },
          "region": {
            "type": "string",
            "title": "Region"
          }
        },
        "type": "object",
        "required": [
          "id",
          "access_key_id",
          "secret_access_key",
          "endpoint_url",
          "region"
        ],
        "title": "CredentialPairResponse",
        "description": "The one-time payload — the 2 env vars (plus endpoint) that make AWS\nSDK code work. Shown once; store it now."
      },
      "CredentialPermission": {
        "type": "string",
        "enum": [
          "read",
          "write",
          "delete"
        ],
        "title": "CredentialPermission",
        "description": "Phase 4-03. Enforced twice: mapped onto B2 key capabilities (see\n``core/credential_scope.py``) and onto the Worker's method→permission\ncheck (see ``worker/src/index.js``)."
      },
      "CredentialStatus": {
        "type": "string",
        "enum": [
          "pending",
          "active",
          "rotating",
          "expired",
          "revoked"
        ],
        "title": "CredentialStatus",
        "description": "Postgres orders an enum by its declaration order — this order is a\nrough lifecycle, and ``CredentialRepo.list_live`` relies on ACTIVE\nsorting before ROTATING specifically."
      },
      "CredentialSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "label": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Label"
          },
          "access_key_id": {
            "type": "string",
            "title": "Access Key Id"
          },
          "endpoint_url": {
            "type": "string",
            "title": "Endpoint Url"
          },
          "region": {
            "type": "string",
            "title": "Region"
          },
          "status": {
            "$ref": "#/components/schemas/CredentialStatus"
          },
          "scope_all_buckets": {
            "type": "boolean",
            "title": "Scope All Buckets"
          },
          "bucket_names": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Bucket Names"
          },
          "permissions": {
            "items": {
              "$ref": "#/components/schemas/CredentialPermission"
            },
            "type": "array",
            "title": "Permissions"
          },
          "expires_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Expires At"
          },
          "sync_state": {
            "$ref": "#/components/schemas/CredentialSyncState"
          },
          "delivered": {
            "type": "boolean",
            "title": "Delivered"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "label",
          "access_key_id",
          "endpoint_url",
          "region",
          "status",
          "scope_all_buckets",
          "bucket_names",
          "permissions",
          "expires_at",
          "sync_state",
          "delivered",
          "created_at"
        ],
        "title": "CredentialSummary",
        "description": "K3: keyID + endpoint are always re-viewable; the secret never is\n(re-reveal = rotate). ``bucket_names`` is empty when\n``scope_all_buckets`` — bucket *name* (``pc-{internal_id}-{label}``),\nthe same identifier every other bucket-scoped endpoint uses\n(``PATCH /v1/buckets/{bucket}`` etc.), not a UUID the frontend has\nnowhere else to get (``BucketResponse`` doesn't expose one)."
      },
      "CredentialSyncState": {
        "type": "string",
        "enum": [
          "pending",
          "synced",
          "failed",
          "draining"
        ],
        "title": "CredentialSyncState",
        "description": "Phase 4-03. Drives the sync job and the credential's UI badge — not\nto be confused with ``CredentialStatus``, which is the credential's own\nlifecycle. A credential can be ``ACTIVE`` and ``sync_state=failed`` at\nthe same time (still works via whatever it last synced to; the sync job\nkeeps retrying to catch up to its *current* desired scope)."
      },
      "EventDeliveryListResponse": {
        "properties": {
          "deliveries": {
            "items": {
              "$ref": "#/components/schemas/EventDeliveryResponse"
            },
            "type": "array",
            "title": "Deliveries"
          }
        },
        "type": "object",
        "required": [
          "deliveries"
        ],
        "title": "EventDeliveryListResponse"
      },
      "EventDeliveryResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "subscription_id": {
            "type": "string",
            "format": "uuid",
            "title": "Subscription Id"
          },
          "subscription_name": {
            "type": "string",
            "title": "Subscription Name"
          },
          "event_id": {
            "type": "string",
            "format": "uuid",
            "title": "Event Id"
          },
          "event_type": {
            "type": "string",
            "enum": [
              "object.created",
              "object.deleted",
              "object.hidden"
            ],
            "title": "Event Type"
          },
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "object_key": {
            "type": "string",
            "title": "Object Key"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "title": "Occurred At"
          },
          "status": {
            "type": "string",
            "enum": [
              "pending",
              "retrying",
              "delivered",
              "dead"
            ],
            "title": "Status"
          },
          "attempt_count": {
            "type": "integer",
            "title": "Attempt Count"
          },
          "next_attempt_at": {
            "type": "string",
            "format": "date-time",
            "title": "Next Attempt At"
          },
          "last_attempt_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Attempt At"
          },
          "delivered_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Delivered At"
          },
          "response_status": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Response Status"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          }
        },
        "type": "object",
        "required": [
          "id",
          "subscription_id",
          "subscription_name",
          "event_id",
          "event_type",
          "bucket",
          "object_key",
          "occurred_at",
          "status",
          "attempt_count",
          "next_attempt_at",
          "last_attempt_at",
          "delivered_at",
          "response_status",
          "last_error"
        ],
        "title": "EventDeliveryResponse"
      },
      "EventSubscriptionCreatedResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "bucket_id": {
            "type": "string",
            "format": "uuid",
            "title": "Bucket Id"
          },
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "bucket_label": {
            "type": "string",
            "title": "Bucket Label"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "endpoint_url": {
            "type": "string",
            "title": "Endpoint Url"
          },
          "event_types": {
            "items": {
              "type": "string",
              "enum": [
                "object.created",
                "object.deleted",
                "object.hidden"
              ]
            },
            "type": "array",
            "title": "Event Types"
          },
          "object_prefix": {
            "type": "string",
            "title": "Object Prefix"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "source_status": {
            "type": "string",
            "enum": [
              "pending_activation",
              "active",
              "failed",
              "disabled"
            ],
            "title": "Source Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "signing_secret": {
            "type": "string",
            "title": "Signing Secret"
          }
        },
        "type": "object",
        "required": [
          "id",
          "bucket_id",
          "bucket",
          "bucket_label",
          "name",
          "endpoint_url",
          "event_types",
          "object_prefix",
          "active",
          "source_status",
          "created_at",
          "signing_secret"
        ],
        "title": "EventSubscriptionCreatedResponse"
      },
      "EventSubscriptionListResponse": {
        "properties": {
          "subscriptions": {
            "items": {
              "$ref": "#/components/schemas/EventSubscriptionResponse"
            },
            "type": "array",
            "title": "Subscriptions"
          }
        },
        "type": "object",
        "required": [
          "subscriptions"
        ],
        "title": "EventSubscriptionListResponse"
      },
      "EventSubscriptionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "bucket_id": {
            "type": "string",
            "format": "uuid",
            "title": "Bucket Id"
          },
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "bucket_label": {
            "type": "string",
            "title": "Bucket Label"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "endpoint_url": {
            "type": "string",
            "title": "Endpoint Url"
          },
          "event_types": {
            "items": {
              "type": "string",
              "enum": [
                "object.created",
                "object.deleted",
                "object.hidden"
              ]
            },
            "type": "array",
            "title": "Event Types"
          },
          "object_prefix": {
            "type": "string",
            "title": "Object Prefix"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "source_status": {
            "type": "string",
            "enum": [
              "pending_activation",
              "active",
              "failed",
              "disabled"
            ],
            "title": "Source Status"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "bucket_id",
          "bucket",
          "bucket_label",
          "name",
          "endpoint_url",
          "event_types",
          "object_prefix",
          "active",
          "source_status",
          "created_at"
        ],
        "title": "EventSubscriptionResponse"
      },
      "ForgotPasswordRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "ForgotPasswordRequest"
      },
      "HTTPValidationError": {
        "properties": {
          "detail": {
            "items": {
              "$ref": "#/components/schemas/ValidationError"
            },
            "type": "array",
            "title": "Detail"
          }
        },
        "type": "object",
        "title": "HTTPValidationError"
      },
      "HealthResponse": {
        "properties": {
          "status": {
            "type": "string",
            "title": "Status"
          }
        },
        "type": "object",
        "required": [
          "status"
        ],
        "title": "HealthResponse"
      },
      "InviteMemberRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole",
            "default": "member"
          }
        },
        "type": "object",
        "required": [
          "email"
        ],
        "title": "InviteMemberRequest"
      },
      "LedgerEntryResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "reference_id": {
            "type": "string",
            "title": "Reference Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "payment_credit",
              "manual_adjustment",
              "usage_debit",
              "usage_correction",
              "payment_reversal"
            ],
            "title": "Kind"
          },
          "amount_micros": {
            "type": "integer",
            "title": "Amount Micros"
          },
          "amount_usd": {
            "type": "string",
            "title": "Amount Usd"
          },
          "currency": {
            "type": "string",
            "const": "USD",
            "title": "Currency"
          },
          "description": {
            "type": "string",
            "title": "Description"
          },
          "occurred_at": {
            "type": "string",
            "format": "date-time",
            "title": "Occurred At"
          },
          "details": {
            "additionalProperties": true,
            "type": "object",
            "title": "Details"
          }
        },
        "type": "object",
        "required": [
          "id",
          "reference_id",
          "kind",
          "amount_micros",
          "amount_usd",
          "currency",
          "description",
          "occurred_at",
          "details"
        ],
        "title": "LedgerEntryResponse"
      },
      "LedgerListResponse": {
        "properties": {
          "entries": {
            "items": {
              "$ref": "#/components/schemas/LedgerEntryResponse"
            },
            "type": "array",
            "title": "Entries"
          }
        },
        "type": "object",
        "required": [
          "entries"
        ],
        "title": "LedgerListResponse"
      },
      "LifecycleSettingsModel": {
        "properties": {
          "noncurrent_version_days": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 3650,
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Noncurrent Version Days"
          },
          "unfinished_multipart_days": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 3650,
                "minimum": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Unfinished Multipart Days"
          }
        },
        "type": "object",
        "title": "LifecycleSettingsModel",
        "description": "Simple bucket-wide storage housekeeping.\n\nA null value means keep that category indefinitely. Cleanup is applied by\nstorage infrastructure on a daily cadence, so saving a shorter period is\nnot represented as an immediate deletion."
      },
      "LoginRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "maxLength": 256,
            "minLength": 1,
            "title": "Password"
          }
        },
        "type": "object",
        "required": [
          "email",
          "password"
        ],
        "title": "LoginRequest"
      },
      "LogoutRequest": {
        "properties": {
          "refresh_token": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Refresh Token"
          }
        },
        "type": "object",
        "title": "LogoutRequest",
        "description": "Browser clients omit the body — the token rides the httpOnly cookie."
      },
      "MeOrg": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "$ref": "#/components/schemas/OrgStatus"
          },
          "region_code": {
            "type": "string",
            "title": "Region Code"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "region_code",
          "created_at"
        ],
        "title": "MeOrg"
      },
      "MeResponse": {
        "properties": {
          "user": {
            "$ref": "#/components/schemas/MeUser"
          },
          "org": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/MeOrg"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "type": "object",
        "required": [
          "user",
          "org"
        ],
        "title": "MeResponse"
      },
      "MeUser": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole"
          },
          "superadmin": {
            "type": "boolean",
            "title": "Superadmin"
          },
          "email_verified": {
            "type": "boolean",
            "title": "Email Verified"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "role",
          "superadmin",
          "email_verified",
          "created_at"
        ],
        "title": "MeUser"
      },
      "MessageResponse": {
        "properties": {
          "message": {
            "type": "string",
            "title": "Message"
          }
        },
        "type": "object",
        "required": [
          "message"
        ],
        "title": "MessageResponse"
      },
      "MeteringEvent": {
        "properties": {
          "event_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Event Id"
          },
          "ts": {
            "type": "string",
            "format": "date-time",
            "title": "Ts"
          },
          "region": {
            "type": "string",
            "maxLength": 32,
            "title": "Region"
          },
          "bucket": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Bucket"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "tier": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 16
              },
              {
                "type": "null"
              }
            ],
            "title": "Tier"
          },
          "access_key_id": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Access Key Id"
          },
          "operation_class": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^(a|b|c|other)$"
              },
              {
                "type": "null"
              }
            ],
            "title": "Operation Class"
          },
          "operation": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 64
              },
              {
                "type": "null"
              }
            ],
            "title": "Operation"
          },
          "origin_class_a_requests": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2147483647,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Origin Class A Requests"
          },
          "origin_class_b_requests": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2147483647,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Origin Class B Requests"
          },
          "origin_class_c_requests": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2147483647,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Origin Class C Requests"
          },
          "origin_other_requests": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2147483647,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Origin Other Requests"
          },
          "origin_bytes_out": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 9223372036854776000,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Origin Bytes Out"
          },
          "method": {
            "type": "string",
            "maxLength": 10,
            "title": "Method"
          },
          "status": {
            "type": "integer",
            "maximum": 599,
            "minimum": 100,
            "title": "Status"
          },
          "bytes_in": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 9223372036854776000,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Bytes In"
          },
          "bytes_out": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 9223372036854776000,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Bytes Out"
          },
          "duration_ms": {
            "anyOf": [
              {
                "type": "integer",
                "maximum": 2147483647,
                "minimum": 0
              },
              {
                "type": "null"
              }
            ],
            "title": "Duration Ms"
          }
        },
        "type": "object",
        "required": [
          "ts",
          "region",
          "method",
          "status"
        ],
        "title": "MeteringEvent",
        "description": "~200 bytes from the Worker.\n\nDeliberately permissive about the parts the edge cannot always know: a\nchunked response has no content-length, and the difference between \"zero\nbytes\" and \"not measurable\" has to survive all the way to billing (trap\n#10). Hence ``bytes_in``/``bytes_out`` default to ``None`` and are never\ncoerced to 0."
      },
      "MeteringEventBatch": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/MeteringEvent"
            },
            "type": "array",
            "maxItems": 1000,
            "minItems": 1,
            "title": "Events"
          }
        },
        "type": "object",
        "required": [
          "events"
        ],
        "title": "MeteringEventBatch",
        "description": "The batched shape. ``max_length`` is enforced here rather than in the\nhandler so an oversized array is refused during parsing, before it is\nmaterialised."
      },
      "MeteringHealthResponse": {
        "properties": {
          "latest_event_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Event At"
          },
          "latest_event_received_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Event Received At"
          },
          "latest_projection_updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Projection Updated At"
          },
          "latest_rollup_completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Rollup Completed At"
          },
          "latest_storage_sampled_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Storage Sampled At"
          }
        },
        "type": "object",
        "required": [
          "latest_event_at",
          "latest_event_received_at",
          "latest_projection_updated_at",
          "latest_rollup_completed_at",
          "latest_storage_sampled_at"
        ],
        "title": "MeteringHealthResponse"
      },
      "MultipartCompleteRequest": {
        "properties": {
          "bucket": {
            "type": "string",
            "maxLength": 63,
            "title": "Bucket"
          },
          "key": {
            "type": "string",
            "maxLength": 1024,
            "title": "Key"
          },
          "parts": {
            "items": {
              "$ref": "#/components/schemas/PartResponse"
            },
            "type": "array",
            "maxItems": 10000,
            "minItems": 1,
            "title": "Parts"
          }
        },
        "type": "object",
        "required": [
          "bucket",
          "key",
          "parts"
        ],
        "title": "MultipartCompleteRequest"
      },
      "MultipartCompleteResponse": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "location": {
            "type": "string",
            "title": "Location"
          }
        },
        "type": "object",
        "required": [
          "key",
          "location"
        ],
        "title": "MultipartCompleteResponse"
      },
      "MultipartCreateResponse": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "upload_id": {
            "type": "string",
            "title": "Upload Id"
          }
        },
        "type": "object",
        "required": [
          "key",
          "upload_id"
        ],
        "title": "MultipartCreateResponse"
      },
      "MultipartSignRequest": {
        "properties": {
          "bucket": {
            "type": "string",
            "maxLength": 63,
            "title": "Bucket"
          },
          "key": {
            "type": "string",
            "maxLength": 1024,
            "title": "Key"
          },
          "part_number": {
            "type": "integer",
            "maximum": 10000,
            "minimum": 1,
            "title": "Part Number"
          }
        },
        "type": "object",
        "required": [
          "bucket",
          "key",
          "part_number"
        ],
        "title": "MultipartSignRequest"
      },
      "ObjectListResponse": {
        "properties": {
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "prefix": {
            "type": "string",
            "title": "Prefix"
          },
          "objects": {
            "items": {
              "$ref": "#/components/schemas/ObjectSummaryResponse"
            },
            "type": "array",
            "title": "Objects"
          },
          "prefixes": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Prefixes"
          },
          "next_token": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Token"
          }
        },
        "type": "object",
        "required": [
          "bucket",
          "prefix",
          "objects",
          "prefixes",
          "next_token"
        ],
        "title": "ObjectListResponse",
        "description": "One page. ``prefixes`` are the virtual folders the delimiter collapsed;\n``next_token`` is opaque and round-tripped back to us."
      },
      "ObjectMetadataResponse": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "size": {
            "type": "integer",
            "title": "Size"
          },
          "last_modified": {
            "type": "string",
            "format": "date-time",
            "title": "Last Modified"
          },
          "etag": {
            "type": "string",
            "title": "Etag"
          },
          "content_type": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Type"
          },
          "cache_control": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Cache Control"
          },
          "user_metadata": {
            "additionalProperties": {
              "type": "string"
            },
            "type": "object",
            "title": "User Metadata"
          }
        },
        "type": "object",
        "required": [
          "key",
          "size",
          "last_modified",
          "etag",
          "content_type",
          "cache_control",
          "user_metadata"
        ],
        "title": "ObjectMetadataResponse"
      },
      "ObjectSummaryResponse": {
        "properties": {
          "key": {
            "type": "string",
            "title": "Key"
          },
          "size": {
            "type": "integer",
            "title": "Size"
          },
          "last_modified": {
            "type": "string",
            "format": "date-time",
            "title": "Last Modified"
          },
          "etag": {
            "type": "string",
            "title": "Etag"
          }
        },
        "type": "object",
        "required": [
          "key",
          "size",
          "last_modified",
          "etag"
        ],
        "title": "ObjectSummaryResponse"
      },
      "OrgProfileResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "$ref": "#/components/schemas/OrgStatus"
          },
          "region": {
            "type": "string",
            "title": "Region"
          },
          "endpoint_url": {
            "type": "string",
            "title": "Endpoint Url"
          },
          "internal_id": {
            "type": "string",
            "title": "Internal Id"
          },
          "provisioned": {
            "type": "boolean",
            "title": "Provisioned"
          },
          "provisioning_state": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/ProvisioningState"
              },
              {
                "type": "null"
              }
            ]
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "status",
          "region",
          "endpoint_url",
          "internal_id",
          "provisioned",
          "provisioning_state",
          "created_at"
        ],
        "title": "OrgProfileResponse"
      },
      "OrgStatus": {
        "type": "string",
        "enum": [
          "active",
          "suspended",
          "terminated"
        ],
        "title": "OrgStatus"
      },
      "OrganizationListResponse": {
        "properties": {
          "organizations": {
            "items": {
              "$ref": "#/components/schemas/OrganizationSummary"
            },
            "type": "array",
            "title": "Organizations"
          }
        },
        "type": "object",
        "required": [
          "organizations"
        ],
        "title": "OrganizationListResponse"
      },
      "OrganizationSummary": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "region": {
            "type": "string",
            "title": "Region"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole"
          }
        },
        "type": "object",
        "required": [
          "id",
          "name",
          "region",
          "role"
        ],
        "title": "OrganizationSummary"
      },
      "PartListResponse": {
        "properties": {
          "parts": {
            "items": {
              "$ref": "#/components/schemas/PartResponse"
            },
            "type": "array",
            "title": "Parts"
          }
        },
        "type": "object",
        "required": [
          "parts"
        ],
        "title": "PartListResponse"
      },
      "PartResponse": {
        "properties": {
          "part_number": {
            "type": "integer",
            "title": "Part Number"
          },
          "etag": {
            "type": "string",
            "title": "Etag"
          },
          "size": {
            "type": "integer",
            "title": "Size"
          }
        },
        "type": "object",
        "required": [
          "part_number",
          "etag",
          "size"
        ],
        "title": "PartResponse"
      },
      "PaymentTransactionListResponse": {
        "properties": {
          "payments": {
            "items": {
              "$ref": "#/components/schemas/PaymentTransactionResponse"
            },
            "type": "array",
            "title": "Payments"
          }
        },
        "type": "object",
        "required": [
          "payments"
        ],
        "title": "PaymentTransactionListResponse"
      },
      "PaymentTransactionResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "provider_payment_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Payment Id"
          },
          "amount_minor": {
            "type": "integer",
            "title": "Amount Minor"
          },
          "amount_usd": {
            "type": "string",
            "title": "Amount Usd"
          },
          "currency": {
            "type": "string",
            "const": "USD",
            "title": "Currency"
          },
          "gateway": {
            "type": "string",
            "title": "Gateway"
          },
          "status": {
            "type": "string",
            "enum": [
              "creating",
              "creation_failed",
              "requires_payment_method",
              "requires_customer_action",
              "authorised",
              "processing",
              "captured",
              "failed",
              "cancelled",
              "refunded",
              "partially_refunded",
              "expired"
            ],
            "title": "Status"
          },
          "checkout_url": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Checkout Url"
          },
          "credited_micros": {
            "type": "integer",
            "title": "Credited Micros"
          },
          "credited_usd": {
            "type": "string",
            "title": "Credited Usd"
          },
          "captured_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Captured At"
          },
          "last_synced_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Synced At"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "provider_payment_id",
          "amount_minor",
          "amount_usd",
          "currency",
          "gateway",
          "status",
          "checkout_url",
          "credited_micros",
          "credited_usd",
          "captured_at",
          "last_synced_at",
          "error",
          "created_at"
        ],
        "title": "PaymentTransactionResponse"
      },
      "PaymentWebhookEventListResponse": {
        "properties": {
          "events": {
            "items": {
              "$ref": "#/components/schemas/PaymentWebhookEventResponse"
            },
            "type": "array",
            "title": "Events"
          }
        },
        "type": "object",
        "required": [
          "events"
        ],
        "title": "PaymentWebhookEventListResponse"
      },
      "PaymentWebhookEventResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "provider_event_id": {
            "type": "string",
            "title": "Provider Event Id"
          },
          "event_type": {
            "type": "string",
            "title": "Event Type"
          },
          "provider_payment_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Provider Payment Id"
          },
          "received_at": {
            "type": "string",
            "format": "date-time",
            "title": "Received At"
          },
          "processed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Processed At"
          },
          "status": {
            "type": "string",
            "enum": [
              "received",
              "processed",
              "ignored",
              "failed"
            ],
            "title": "Status"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "id",
          "provider_event_id",
          "event_type",
          "provider_payment_id",
          "received_at",
          "processed_at",
          "status",
          "error"
        ],
        "title": "PaymentWebhookEventResponse"
      },
      "PresignRequest": {
        "properties": {
          "bucket": {
            "type": "string",
            "maxLength": 63,
            "title": "Bucket"
          },
          "key": {
            "type": "string",
            "maxLength": 1024,
            "title": "Key"
          },
          "purpose": {
            "type": "string",
            "title": "Purpose",
            "default": "download"
          },
          "filename": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Filename"
          }
        },
        "type": "object",
        "required": [
          "bucket",
          "key"
        ],
        "title": "PresignRequest"
      },
      "PresignResponse": {
        "properties": {
          "url": {
            "type": "string",
            "title": "Url"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          }
        },
        "type": "object",
        "required": [
          "url",
          "expires_at"
        ],
        "title": "PresignResponse"
      },
      "PricingCatalogResponse": {
        "properties": {
          "assigned_plan_code": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Assigned Plan Code"
          },
          "plans": {
            "items": {
              "$ref": "#/components/schemas/PricingPlanResponse"
            },
            "type": "array",
            "title": "Plans"
          }
        },
        "type": "object",
        "required": [
          "assigned_plan_code",
          "plans"
        ],
        "title": "PricingCatalogResponse"
      },
      "PricingPlanResponse": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "name": {
            "type": "string",
            "title": "Name"
          },
          "category": {
            "type": "string",
            "enum": [
              "supplier",
              "retail"
            ],
            "title": "Category"
          },
          "currency": {
            "type": "string",
            "const": "USD",
            "title": "Currency"
          },
          "effective_from": {
            "type": "string",
            "format": "date",
            "title": "Effective From"
          },
          "effective_to": {
            "anyOf": [
              {
                "type": "string",
                "format": "date"
              },
              {
                "type": "null"
              }
            ],
            "title": "Effective To"
          },
          "active": {
            "type": "boolean",
            "title": "Active"
          },
          "is_default": {
            "type": "boolean",
            "title": "Is Default"
          },
          "notes": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Notes"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "rates": {
            "items": {
              "$ref": "#/components/schemas/PricingTierRateResponse"
            },
            "type": "array",
            "title": "Rates"
          }
        },
        "type": "object",
        "required": [
          "code",
          "name",
          "category",
          "currency",
          "effective_from",
          "effective_to",
          "active",
          "is_default",
          "notes",
          "created_at",
          "rates"
        ],
        "title": "PricingPlanResponse"
      },
      "PricingTierRateResponse": {
        "properties": {
          "tier": {
            "type": "string",
            "enum": [
              "hot",
              "cool"
            ],
            "title": "Tier"
          },
          "storage_usd_per_tb_month": {
            "type": "string",
            "title": "Storage Usd Per Tb Month"
          },
          "included_egress_multiplier": {
            "type": "string",
            "title": "Included Egress Multiplier"
          },
          "egress_overage_usd_per_gb": {
            "type": "string",
            "title": "Egress Overage Usd Per Gb"
          },
          "api_b_usd_per_10k": {
            "type": "string",
            "title": "Api B Usd Per 10K"
          },
          "api_c_usd_per_1k": {
            "type": "string",
            "title": "Api C Usd Per 1K"
          },
          "api_b_free_per_day": {
            "type": "integer",
            "title": "Api B Free Per Day"
          },
          "api_c_free_per_day": {
            "type": "integer",
            "title": "Api C Free Per Day"
          },
          "cdn_usd_per_gb": {
            "type": "string",
            "title": "Cdn Usd Per Gb"
          }
        },
        "type": "object",
        "required": [
          "tier",
          "storage_usd_per_tb_month",
          "included_egress_multiplier",
          "egress_overage_usd_per_gb",
          "api_b_usd_per_10k",
          "api_c_usd_per_1k",
          "api_b_free_per_day",
          "api_c_free_per_day",
          "cdn_usd_per_gb"
        ],
        "title": "PricingTierRateResponse"
      },
      "ProvisioningRetryResponse": {
        "properties": {
          "state": {
            "$ref": "#/components/schemas/ProvisioningState"
          },
          "provisioned": {
            "type": "boolean",
            "title": "Provisioned"
          }
        },
        "type": "object",
        "required": [
          "state",
          "provisioned"
        ],
        "title": "ProvisioningRetryResponse"
      },
      "ProvisioningRunInfo": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "state": {
            "$ref": "#/components/schemas/ProvisioningState"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "attempt": {
            "type": "integer",
            "title": "Attempt"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "state",
          "error",
          "attempt",
          "created_at",
          "updated_at"
        ],
        "title": "ProvisioningRunInfo"
      },
      "ProvisioningState": {
        "type": "string",
        "enum": [
          "pending",
          "accounts_verified",
          "dataplane_keys_minted",
          "customer_key_minted",
          "published",
          "completed",
          "failed"
        ],
        "title": "ProvisioningState",
        "description": "Explicit, resumable pipeline states (Phase 4-01). Every step is\nidempotent (it checks the DB before external work), so a failed run\nalways resumes from PENDING rather than a remembered checkpoint — see\n``ProvisioningService._step_through``. External calls fail; half-done\norgs must be visible and repairable, never silent."
      },
      "QueueHealthResponse": {
        "properties": {
          "available": {
            "type": "boolean",
            "title": "Available"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          },
          "queues": {
            "items": {
              "$ref": "#/components/schemas/QueueRegionHealthResponse"
            },
            "type": "array",
            "title": "Queues"
          }
        },
        "type": "object",
        "required": [
          "available",
          "error",
          "queues"
        ],
        "title": "QueueHealthResponse"
      },
      "QueueRegionHealthResponse": {
        "properties": {
          "region": {
            "type": "string",
            "title": "Region"
          },
          "queue_name": {
            "type": "string",
            "title": "Queue Name"
          },
          "backlog_count": {
            "type": "integer",
            "title": "Backlog Count"
          },
          "backlog_bytes": {
            "type": "integer",
            "title": "Backlog Bytes"
          },
          "oldest_message_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Oldest Message At"
          },
          "dead_letter_queue_name": {
            "type": "string",
            "title": "Dead Letter Queue Name"
          },
          "dead_letter_backlog_count": {
            "type": "integer",
            "title": "Dead Letter Backlog Count"
          },
          "dead_letter_backlog_bytes": {
            "type": "integer",
            "title": "Dead Letter Backlog Bytes"
          },
          "dead_letter_oldest_message_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Dead Letter Oldest Message At"
          }
        },
        "type": "object",
        "required": [
          "region",
          "queue_name",
          "backlog_count",
          "backlog_bytes",
          "oldest_message_at",
          "dead_letter_queue_name",
          "dead_letter_backlog_count",
          "dead_letter_backlog_bytes",
          "dead_letter_oldest_message_at"
        ],
        "title": "QueueRegionHealthResponse"
      },
      "ReconciliationIssueResponse": {
        "properties": {
          "code": {
            "type": "string",
            "title": "Code"
          },
          "severity": {
            "type": "string",
            "enum": [
              "warning",
              "error"
            ],
            "title": "Severity"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "details": {
            "additionalProperties": true,
            "type": "object",
            "title": "Details"
          }
        },
        "type": "object",
        "required": [
          "code",
          "severity",
          "message",
          "details"
        ],
        "title": "ReconciliationIssueResponse"
      },
      "ReconciliationRunListResponse": {
        "properties": {
          "runs": {
            "items": {
              "$ref": "#/components/schemas/ReconciliationRunResponse"
            },
            "type": "array",
            "title": "Runs"
          }
        },
        "type": "object",
        "required": [
          "runs"
        ],
        "title": "ReconciliationRunListResponse"
      },
      "ReconciliationRunResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "reference_id": {
            "type": "string",
            "title": "Reference Id"
          },
          "org_id": {
            "anyOf": [
              {
                "type": "string",
                "format": "uuid"
              },
              {
                "type": "null"
              }
            ],
            "title": "Org Id"
          },
          "kind": {
            "type": "string",
            "enum": [
              "daily_integrity",
              "supplier_period"
            ],
            "title": "Kind"
          },
          "period_start": {
            "type": "string",
            "format": "date",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "format": "date",
            "title": "Period End"
          },
          "status": {
            "type": "string",
            "enum": [
              "passed",
              "warning",
              "failed"
            ],
            "title": "Status"
          },
          "completed_at": {
            "type": "string",
            "format": "date-time",
            "title": "Completed At"
          },
          "raw_event_count": {
            "type": "integer",
            "title": "Raw Event Count"
          },
          "rolled_event_count": {
            "type": "integer",
            "title": "Rolled Event Count"
          },
          "unattributed_event_count": {
            "type": "integer",
            "title": "Unattributed Event Count"
          },
          "unknown_byte_event_count": {
            "type": "integer",
            "title": "Unknown Byte Event Count"
          },
          "expected_snapshot_count": {
            "type": "integer",
            "title": "Expected Snapshot Count"
          },
          "complete_snapshot_count": {
            "type": "integer",
            "title": "Complete Snapshot Count"
          },
          "failed_snapshot_count": {
            "type": "integer",
            "title": "Failed Snapshot Count"
          },
          "missing_snapshot_count": {
            "type": "integer",
            "title": "Missing Snapshot Count"
          },
          "invalid_snapshot_count": {
            "type": "integer",
            "title": "Invalid Snapshot Count"
          },
          "unexpected_snapshot_count": {
            "type": "integer",
            "title": "Unexpected Snapshot Count"
          },
          "calculated_cost_micros": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Calculated Cost Micros"
          },
          "supplier_cost_micros": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Supplier Cost Micros"
          },
          "discrepancy_micros": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Discrepancy Micros"
          },
          "details": {
            "additionalProperties": true,
            "type": "object",
            "title": "Details"
          },
          "issues": {
            "items": {
              "$ref": "#/components/schemas/ReconciliationIssueResponse"
            },
            "type": "array",
            "title": "Issues"
          }
        },
        "type": "object",
        "required": [
          "id",
          "reference_id",
          "org_id",
          "kind",
          "period_start",
          "period_end",
          "status",
          "completed_at",
          "raw_event_count",
          "rolled_event_count",
          "unattributed_event_count",
          "unknown_byte_event_count",
          "expected_snapshot_count",
          "complete_snapshot_count",
          "failed_snapshot_count",
          "missing_snapshot_count",
          "invalid_snapshot_count",
          "unexpected_snapshot_count",
          "calculated_cost_micros",
          "supplier_cost_micros",
          "discrepancy_micros",
          "details",
          "issues"
        ],
        "title": "ReconciliationRunResponse"
      },
      "RefreshRequest": {
        "properties": {
          "refresh_token": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 512,
                "minLength": 1
              },
              {
                "type": "null"
              }
            ],
            "title": "Refresh Token"
          }
        },
        "type": "object",
        "title": "RefreshRequest",
        "description": "Browser clients omit the body — the token rides the httpOnly cookie."
      },
      "ReplaceStorageCredentialsRequest": {
        "properties": {
          "credential": {
            "$ref": "#/components/schemas/TierCredentialModel"
          }
        },
        "type": "object",
        "required": [
          "credential"
        ],
        "title": "ReplaceStorageCredentialsRequest"
      },
      "ResetPasswordRequest": {
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 512,
            "minLength": 1,
            "title": "Token"
          },
          "new_password": {
            "type": "string",
            "maxLength": 256,
            "minLength": 8,
            "title": "New Password"
          }
        },
        "type": "object",
        "required": [
          "token",
          "new_password"
        ],
        "title": "ResetPasswordRequest"
      },
      "RotateEventSecretResponse": {
        "properties": {
          "subscription_id": {
            "type": "string",
            "format": "uuid",
            "title": "Subscription Id"
          },
          "signing_secret": {
            "type": "string",
            "title": "Signing Secret"
          }
        },
        "type": "object",
        "required": [
          "subscription_id",
          "signing_secret"
        ],
        "title": "RotateEventSecretResponse"
      },
      "ScheduledJobListResponse": {
        "properties": {
          "jobs": {
            "items": {
              "$ref": "#/components/schemas/ScheduledJobResponse"
            },
            "type": "array",
            "title": "Jobs"
          }
        },
        "type": "object",
        "required": [
          "jobs"
        ],
        "title": "ScheduledJobListResponse"
      },
      "ScheduledJobResponse": {
        "properties": {
          "name": {
            "type": "string",
            "title": "Name"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "next_run_at": {
            "type": "string",
            "format": "date-time",
            "title": "Next Run At"
          },
          "last_started_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Started At"
          },
          "last_completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Completed At"
          },
          "last_succeeded_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Succeeded At"
          },
          "last_error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Error"
          },
          "run_count": {
            "type": "integer",
            "title": "Run Count"
          },
          "failure_count": {
            "type": "integer",
            "title": "Failure Count"
          }
        },
        "type": "object",
        "required": [
          "name",
          "status",
          "next_run_at",
          "last_started_at",
          "last_completed_at",
          "last_succeeded_at",
          "last_error",
          "run_count",
          "failure_count"
        ],
        "title": "ScheduledJobResponse"
      },
      "SignupRequest": {
        "properties": {
          "email": {
            "type": "string",
            "format": "email",
            "title": "Email"
          },
          "password": {
            "type": "string",
            "maxLength": 256,
            "minLength": 8,
            "title": "Password"
          },
          "org_name": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Org Name"
          },
          "region": {
            "type": "string",
            "title": "Region",
            "default": "canada"
          }
        },
        "type": "object",
        "required": [
          "email",
          "password",
          "org_name"
        ],
        "title": "SignupRequest"
      },
      "StorageSnapshotResponse": {
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date"
          },
          "bucket": {
            "type": "string",
            "title": "Bucket"
          },
          "region": {
            "type": "string",
            "title": "Region"
          },
          "tier": {
            "type": "string",
            "title": "Tier"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "measurement_version": {
            "type": "integer",
            "title": "Measurement Version"
          },
          "stored_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Stored Bytes"
          },
          "object_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Object Count"
          },
          "current_stored_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Stored Bytes"
          },
          "current_object_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Object Count"
          },
          "noncurrent_stored_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Noncurrent Stored Bytes"
          },
          "noncurrent_object_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Noncurrent Object Count"
          },
          "incomplete_multipart_bytes": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Incomplete Multipart Bytes"
          },
          "incomplete_multipart_part_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Incomplete Multipart Part Count"
          },
          "incomplete_multipart_upload_count": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Incomplete Multipart Upload Count"
          },
          "sampled_at": {
            "type": "string",
            "format": "date-time",
            "title": "Sampled At"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "date",
          "bucket",
          "region",
          "tier",
          "status",
          "measurement_version",
          "stored_bytes",
          "object_count",
          "current_stored_bytes",
          "current_object_count",
          "noncurrent_stored_bytes",
          "noncurrent_object_count",
          "incomplete_multipart_bytes",
          "incomplete_multipart_part_count",
          "incomplete_multipart_upload_count",
          "sampled_at",
          "error"
        ],
        "title": "StorageSnapshotResponse"
      },
      "StorageTier": {
        "type": "string",
        "enum": [
          "hot",
          "cool"
        ],
        "title": "StorageTier",
        "description": "One org allocation per tier. COOL is optional; HOT is required."
      },
      "SupplierUsageImportListResponse": {
        "properties": {
          "imports": {
            "items": {
              "$ref": "#/components/schemas/SupplierUsageImportResponse"
            },
            "type": "array",
            "title": "Imports"
          }
        },
        "type": "object",
        "required": [
          "imports"
        ],
        "title": "SupplierUsageImportListResponse"
      },
      "SupplierUsageImportRequest": {
        "properties": {
          "supplier": {
            "type": "string",
            "pattern": "^[a-z0-9-]{2,32}$",
            "title": "Supplier",
            "default": "aylo"
          },
          "source_reference": {
            "type": "string",
            "maxLength": 160,
            "minLength": 2,
            "title": "Source Reference"
          },
          "period_start": {
            "type": "string",
            "format": "date",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "format": "date",
            "title": "Period End"
          },
          "region": {
            "type": "string",
            "maxLength": 32,
            "minLength": 2,
            "title": "Region"
          },
          "tier": {
            "type": "string",
            "enum": [
              "hot",
              "cool"
            ],
            "title": "Tier"
          },
          "stored_bytes": {
            "type": "integer",
            "minimum": 0,
            "title": "Stored Bytes"
          },
          "egress_bytes": {
            "type": "integer",
            "minimum": 0,
            "title": "Egress Bytes"
          },
          "class_b_requests": {
            "type": "integer",
            "minimum": 0,
            "title": "Class B Requests"
          },
          "class_c_requests": {
            "type": "integer",
            "minimum": 0,
            "title": "Class C Requests"
          },
          "cdn_bytes": {
            "type": "integer",
            "minimum": 0,
            "title": "Cdn Bytes",
            "default": 0
          },
          "amount_micros": {
            "type": "integer",
            "minimum": 0,
            "title": "Amount Micros"
          },
          "raw_payload": {
            "additionalProperties": true,
            "type": "object",
            "title": "Raw Payload"
          }
        },
        "type": "object",
        "required": [
          "source_reference",
          "period_start",
          "period_end",
          "region",
          "tier",
          "stored_bytes",
          "egress_bytes",
          "class_b_requests",
          "class_c_requests",
          "amount_micros"
        ],
        "title": "SupplierUsageImportRequest"
      },
      "SupplierUsageImportResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "supplier": {
            "type": "string",
            "title": "Supplier"
          },
          "source_reference": {
            "type": "string",
            "title": "Source Reference"
          },
          "period_start": {
            "type": "string",
            "format": "date",
            "title": "Period Start"
          },
          "period_end": {
            "type": "string",
            "format": "date",
            "title": "Period End"
          },
          "region": {
            "type": "string",
            "title": "Region"
          },
          "tier": {
            "type": "string",
            "title": "Tier"
          },
          "amount_micros": {
            "type": "integer",
            "title": "Amount Micros"
          },
          "currency": {
            "type": "string",
            "title": "Currency"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "supplier",
          "source_reference",
          "period_start",
          "period_end",
          "region",
          "tier",
          "amount_micros",
          "currency",
          "created_at"
        ],
        "title": "SupplierUsageImportResponse"
      },
      "SwitchOrganizationRequest": {
        "properties": {
          "org_id": {
            "type": "string",
            "format": "uuid",
            "title": "Org Id"
          }
        },
        "type": "object",
        "required": [
          "org_id"
        ],
        "title": "SwitchOrganizationRequest"
      },
      "TeamInvitationResponse": {
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "title": "Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole"
          },
          "expires_at": {
            "type": "string",
            "format": "date-time",
            "title": "Expires At"
          },
          "created_at": {
            "type": "string",
            "format": "date-time",
            "title": "Created At"
          }
        },
        "type": "object",
        "required": [
          "id",
          "email",
          "role",
          "expires_at",
          "created_at"
        ],
        "title": "TeamInvitationResponse"
      },
      "TeamMemberResponse": {
        "properties": {
          "user_id": {
            "type": "string",
            "format": "uuid",
            "title": "User Id"
          },
          "email": {
            "type": "string",
            "title": "Email"
          },
          "role": {
            "$ref": "#/components/schemas/UserRole"
          },
          "joined_at": {
            "type": "string",
            "format": "date-time",
            "title": "Joined At"
          },
          "is_current_user": {
            "type": "boolean",
            "title": "Is Current User"
          }
        },
        "type": "object",
        "required": [
          "user_id",
          "email",
          "role",
          "joined_at",
          "is_current_user"
        ],
        "title": "TeamMemberResponse"
      },
      "TeamResponse": {
        "properties": {
          "members": {
            "items": {
              "$ref": "#/components/schemas/TeamMemberResponse"
            },
            "type": "array",
            "title": "Members"
          },
          "invitations": {
            "items": {
              "$ref": "#/components/schemas/TeamInvitationResponse"
            },
            "type": "array",
            "title": "Invitations"
          }
        },
        "type": "object",
        "required": [
          "members",
          "invitations"
        ],
        "title": "TeamResponse"
      },
      "TierCredentialModel": {
        "properties": {
          "key_id": {
            "type": "string",
            "maxLength": 64,
            "minLength": 1,
            "title": "Key Id"
          },
          "key": {
            "type": "string",
            "minLength": 1,
            "title": "Key"
          }
        },
        "type": "object",
        "required": [
          "key_id",
          "key"
        ],
        "title": "TierCredentialModel",
        "description": "A storage account's master key pair — write-only. Never appears in a\nresponse; the API accepts it, validates it live, and stores it encrypted."
      },
      "TokenPairResponse": {
        "properties": {
          "access_token": {
            "type": "string",
            "title": "Access Token"
          },
          "refresh_token": {
            "type": "string",
            "title": "Refresh Token"
          },
          "token_type": {
            "type": "string",
            "const": "bearer",
            "title": "Token Type",
            "default": "bearer"
          },
          "expires_in": {
            "type": "integer",
            "title": "Expires In"
          }
        },
        "type": "object",
        "required": [
          "access_token",
          "refresh_token",
          "expires_in"
        ],
        "title": "TokenPairResponse"
      },
      "UpdateCredentialLabelRequest": {
        "properties": {
          "label": {
            "type": "string",
            "maxLength": 120,
            "minLength": 1,
            "title": "Label"
          }
        },
        "type": "object",
        "required": [
          "label"
        ],
        "title": "UpdateCredentialLabelRequest"
      },
      "UpdateEventSubscriptionRequest": {
        "properties": {
          "active": {
            "type": "boolean",
            "title": "Active"
          }
        },
        "type": "object",
        "required": [
          "active"
        ],
        "title": "UpdateEventSubscriptionRequest"
      },
      "UpdateMemberRoleRequest": {
        "properties": {
          "role": {
            "$ref": "#/components/schemas/UserRole"
          }
        },
        "type": "object",
        "required": [
          "role"
        ],
        "title": "UpdateMemberRoleRequest"
      },
      "UploadRequest": {
        "properties": {
          "bucket": {
            "type": "string",
            "maxLength": 63,
            "title": "Bucket"
          },
          "key": {
            "type": "string",
            "maxLength": 1024,
            "title": "Key"
          },
          "content_type": {
            "anyOf": [
              {
                "type": "string",
                "maxLength": 255
              },
              {
                "type": "null"
              }
            ],
            "title": "Content Type"
          }
        },
        "type": "object",
        "required": [
          "bucket",
          "key"
        ],
        "title": "UploadRequest"
      },
      "UsageResponse": {
        "properties": {
          "start": {
            "type": "string",
            "format": "date",
            "title": "Start"
          },
          "end": {
            "type": "string",
            "format": "date",
            "title": "End"
          },
          "rollups": {
            "items": {
              "$ref": "#/components/schemas/UsageRollupResponse"
            },
            "type": "array",
            "title": "Rollups"
          },
          "storage_snapshots": {
            "items": {
              "$ref": "#/components/schemas/StorageSnapshotResponse"
            },
            "type": "array",
            "title": "Storage Snapshots"
          },
          "transfer_updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Transfer Updated At"
          },
          "storage_updated_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Storage Updated At"
          }
        },
        "type": "object",
        "required": [
          "start",
          "end",
          "rollups",
          "storage_snapshots",
          "transfer_updated_at",
          "storage_updated_at"
        ],
        "title": "UsageResponse"
      },
      "UsageRollupResponse": {
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date"
          },
          "bucket": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Bucket"
          },
          "region": {
            "type": "string",
            "title": "Region"
          },
          "tier": {
            "type": "string",
            "title": "Tier"
          },
          "requests": {
            "type": "integer",
            "title": "Requests"
          },
          "successful_requests": {
            "type": "integer",
            "title": "Successful Requests"
          },
          "error_requests": {
            "type": "integer",
            "title": "Error Requests"
          },
          "class_a_requests": {
            "type": "integer",
            "title": "Class A Requests"
          },
          "class_b_requests": {
            "type": "integer",
            "title": "Class B Requests"
          },
          "class_c_requests": {
            "type": "integer",
            "title": "Class C Requests"
          },
          "other_requests": {
            "type": "integer",
            "title": "Other Requests"
          },
          "upload_bytes": {
            "type": "integer",
            "title": "Upload Bytes"
          },
          "download_bytes": {
            "type": "integer",
            "title": "Download Bytes"
          },
          "unknown_upload_events": {
            "type": "integer",
            "title": "Unknown Upload Events"
          },
          "unknown_download_events": {
            "type": "integer",
            "title": "Unknown Download Events"
          },
          "finalized": {
            "type": "boolean",
            "title": "Finalized"
          },
          "accounting_status": {
            "type": "string",
            "title": "Accounting Status"
          },
          "source_last_ts": {
            "type": "string",
            "format": "date-time",
            "title": "Source Last Ts"
          },
          "updated_at": {
            "type": "string",
            "format": "date-time",
            "title": "Updated At"
          }
        },
        "type": "object",
        "required": [
          "date",
          "bucket",
          "region",
          "tier",
          "requests",
          "successful_requests",
          "error_requests",
          "class_a_requests",
          "class_b_requests",
          "class_c_requests",
          "other_requests",
          "upload_bytes",
          "download_bytes",
          "unknown_upload_events",
          "unknown_download_events",
          "finalized",
          "accounting_status",
          "source_last_ts",
          "updated_at"
        ],
        "title": "UsageRollupResponse"
      },
      "UsageRollupRunListResponse": {
        "properties": {
          "runs": {
            "items": {
              "$ref": "#/components/schemas/UsageRollupRunResponse"
            },
            "type": "array",
            "title": "Runs"
          }
        },
        "type": "object",
        "required": [
          "runs"
        ],
        "title": "UsageRollupRunListResponse"
      },
      "UsageRollupRunResponse": {
        "properties": {
          "date": {
            "type": "string",
            "format": "date",
            "title": "Date"
          },
          "status": {
            "type": "string",
            "title": "Status"
          },
          "started_at": {
            "type": "string",
            "format": "date-time",
            "title": "Started At"
          },
          "completed_at": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time"
              },
              {
                "type": "null"
              }
            ],
            "title": "Completed At"
          },
          "source_events": {
            "type": "integer",
            "title": "Source Events"
          },
          "attributed_events": {
            "type": "integer",
            "title": "Attributed Events"
          },
          "unattributed_events": {
            "type": "integer",
            "title": "Unattributed Events"
          },
          "unknown_upload_events": {
            "type": "integer",
            "title": "Unknown Upload Events"
          },
          "unknown_download_events": {
            "type": "integer",
            "title": "Unknown Download Events"
          },
          "unknown_origin_request_events": {
            "type": "integer",
            "title": "Unknown Origin Request Events"
          },
          "unknown_origin_egress_events": {
            "type": "integer",
            "title": "Unknown Origin Egress Events"
          },
          "error": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Error"
          }
        },
        "type": "object",
        "required": [
          "date",
          "status",
          "started_at",
          "completed_at",
          "source_events",
          "attributed_events",
          "unattributed_events",
          "unknown_upload_events",
          "unknown_download_events",
          "unknown_origin_request_events",
          "unknown_origin_egress_events",
          "error"
        ],
        "title": "UsageRollupRunResponse"
      },
      "UserRole": {
        "type": "string",
        "enum": [
          "owner",
          "admin",
          "member"
        ],
        "title": "UserRole",
        "description": "Org-level role. Object-level RBAC is Phase 8."
      },
      "ValidateStorageCredentialRequest": {
        "properties": {
          "region": {
            "type": "string",
            "title": "Region",
            "default": "canada"
          },
          "tier": {
            "$ref": "#/components/schemas/StorageTier"
          },
          "credential": {
            "$ref": "#/components/schemas/TierCredentialModel"
          }
        },
        "type": "object",
        "required": [
          "tier",
          "credential"
        ],
        "title": "ValidateStorageCredentialRequest",
        "description": "The admin UI's \"Validate\" action — checks one tier's key live without\nsubmitting the rest of the create-org form."
      },
      "ValidationError": {
        "properties": {
          "loc": {
            "items": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "integer"
                }
              ]
            },
            "type": "array",
            "title": "Location"
          },
          "msg": {
            "type": "string",
            "title": "Message"
          },
          "type": {
            "type": "string",
            "title": "Error Type"
          },
          "input": {
            "title": "Input"
          },
          "ctx": {
            "type": "object",
            "title": "Context"
          }
        },
        "type": "object",
        "required": [
          "loc",
          "msg",
          "type"
        ],
        "title": "ValidationError"
      },
      "VerifyEmailRequest": {
        "properties": {
          "token": {
            "type": "string",
            "maxLength": 512,
            "minLength": 1,
            "title": "Token"
          }
        },
        "type": "object",
        "required": [
          "token"
        ],
        "title": "VerifyEmailRequest"
      },
      "VersionResponse": {
        "properties": {
          "version": {
            "type": "string",
            "title": "Version"
          },
          "git_sha": {
            "type": "string",
            "title": "Git Sha"
          },
          "env": {
            "type": "string",
            "title": "Env"
          }
        },
        "type": "object",
        "required": [
          "version",
          "git_sha",
          "env"
        ],
        "title": "VersionResponse"
      }
    },
    "securitySchemes": {
      "HTTPBearer": {
        "type": "http",
        "scheme": "bearer"
      }
    }
  }
}
