{
  "openapi": "3.1.0",
  "info": {
    "title": "Azums real service: identity and commercial payments",
    "version": "1.0.0",
    "description": "Unavailable financial providers are excluded. Membership purchases never authorize custody or signing. Automatic recurring charges are not enabled."
  },
  "servers": [
    {
      "url": "https://app.getazums.com"
    },
    {
      "url": "https://staging.getazums.com"
    }
  ],
  "paths": {
    "/v1/auth/register": {
      "post": {
        "summary": "Create local-fixture account and limited pre-MFA session",
        "operationId": "post_v1_auth_register",
        "responses": {
          "201": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Register"
              }
            }
          }
        }
      }
    },
    "/v1/auth/login": {
      "post": {
        "summary": "Password authentication; MFA still required",
        "operationId": "post_v1_auth_login",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [],
        "parameters": [
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Login"
              }
            }
          }
        }
      }
    },
    "/v1/auth/logout": {
      "post": {
        "summary": "Immediately revoke current session",
        "operationId": "post_v1_auth_logout",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ]
      }
    },
    "/v1/auth/verify-email": {
      "post": {
        "summary": "Consume local verification token; does not certify real mail delivery",
        "operationId": "post_v1_auth_verify-email",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Token"
              }
            }
          }
        }
      }
    },
    "/v1/auth/resend-verification": {
      "post": {
        "summary": "Replace local verification challenge",
        "operationId": "post_v1_auth_resend-verification",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ]
      }
    },
    "/v1/auth/mfa/enroll": {
      "post": {
        "summary": "Return a new pending authenticator seed once",
        "operationId": "post_v1_auth_mfa_enroll",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ]
      }
    },
    "/v1/auth/mfa/confirm": {
      "post": {
        "summary": "Confirm enrollment and return one-time recovery codes",
        "operationId": "post_v1_auth_mfa_confirm",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/EnrollmentConfirm"
              }
            }
          }
        }
      }
    },
    "/v1/auth/mfa/verify": {
      "post": {
        "summary": "Verify a fresh OTP or consume one recovery code and rotate the session",
        "operationId": "post_v1_auth_mfa_verify",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MfaCode"
              }
            }
          }
        }
      }
    },
    "/v1/auth/me": {
      "get": {
        "summary": "Own account state; organizations hidden until MFA",
        "operationId": "get_v1_auth_me",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": []
      }
    },
    "/v1/organizations": {
      "get": {
        "summary": "List only active memberships after verified email/MFA",
        "operationId": "get_v1_organizations",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": []
      },
      "post": {
        "summary": "Create sandbox organization with pending legal status",
        "operationId": "post_v1_organizations",
        "responses": {
          "201": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/OrganizationCreate"
              }
            }
          }
        }
      }
    },
    "/v1/invitations/accept": {
      "post": {
        "summary": "Accept only the verified recipient?s unexpired invitation",
        "operationId": "post_v1_invitations_accept",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/Token"
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{org}": {
      "get": {
        "summary": "Read authorized organization metadata",
        "operationId": "get_v1_organizations_org",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "sandboxKey": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/organizations/{org}/members": {
      "get": {
        "summary": "List own organization members",
        "operationId": "get_v1_organizations_org_members",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "sandboxKey": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/organizations/{org}/members/{member}": {
      "patch": {
        "summary": "Change a non-owner membership; owner/admin policy applies",
        "operationId": "patch_v1_organizations_org_members_member",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "member",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/MemberChange"
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{org}/invitations": {
      "post": {
        "summary": "Create recipient-bound local-fixture invitation",
        "operationId": "post_v1_organizations_org_invitations",
        "responses": {
          "201": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/InvitationCreate"
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{org}/keys": {
      "get": {
        "summary": "List permitted key metadata, never full secrets",
        "operationId": "get_v1_organizations_org_keys",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "post": {
        "summary": "Issue a sandbox key no broader than current role",
        "operationId": "post_v1_organizations_org_keys",
        "responses": {
          "201": {
            "description": "One-time credential",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OneTimeKey"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/KeyCreate"
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{org}/keys/{key}": {
      "delete": {
        "summary": "Revoke immediately; repeated revocation is idempotent",
        "operationId": "delete_v1_organizations_org_keys_key",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ]
      }
    },
    "/v1/organizations/{org}/keys/{key}/rotate": {
      "post": {
        "summary": "Atomically replace an unexpired key, preserving expiry",
        "operationId": "post_v1_organizations_org_keys_key_rotate",
        "responses": {
          "201": {
            "description": "One-time credential",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/OneTimeKey"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "key",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "X-Azums-CSRF",
            "in": "header",
            "description": "Required for browser/password-session mutations; value 1. Bearer-key clients do not require it.",
            "schema": {
              "type": "string",
              "enum": [
                "1"
              ]
            }
          }
        ]
      }
    },
    "/v1/organizations/{org}/audit": {
      "get": {
        "summary": "Latest 100 tenant audit events",
        "operationId": "get_v1_organizations_org_audit",
        "responses": {
          "200": {
            "description": "Successful authorized operation",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Envelope"
                }
              }
            }
          },
          "default": {
            "description": "Bounded problem response. 401 invalid/expired credential; 403 missing MFA, role/scope, production denial or CSRF; 404 foreign/missing object; 409 conflict; 429 rate limited; 503 persistence unavailable.",
            "headers": {
              "X-Request-ID": {
                "schema": {
                  "type": "string",
                  "format": "uuid"
                }
              },
              "Cache-Control": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        },
        "security": [
          {
            "sessionCookie": []
          },
          {
            "sandboxKey": []
          },
          {
            "SandboxSession": []
          }
        ],
        "parameters": [
          {
            "name": "org",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/organizations/{org}/billing/plans": {
      "get": {
        "operationId": "get_v1_organizations_org_billing_plans",
        "summary": "Real Azums commercial plans",
        "security": [
          {
            "BrowserSession": []
          }
        ],
        "x-permissions": [
          "organization:read",
          "billing:read"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative server response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "configured": {
                      "type": "boolean"
                    },
                    "catalog_version": {
                      "type": "string"
                    },
                    "plans": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "currency": {
                            "type": "string",
                            "enum": [
                              "NGN",
                              "USD",
                              "GHS",
                              "ZAR",
                              "KES"
                            ]
                          },
                          "amount_minor": {
                            "type": "string",
                            "pattern": "^[1-9][0-9]*$",
                            "description": "Exact positive unsigned 64-bit minor units; never JSON floating point"
                          },
                          "interval": {
                            "type": "string",
                            "enum": [
                              "monthly",
                              "annually"
                            ]
                          },
                          "renewal": {
                            "const": "manual"
                          },
                          "features": {
                            "type": "array",
                            "items": {
                              "type": "string",
                              "enum": [
                                "api_keys",
                                "team_management"
                              ]
                            }
                          }
                        },
                        "required": [
                          "id",
                          "name",
                          "currency",
                          "amount_minor",
                          "interval",
                          "renewal",
                          "features"
                        ]
                      }
                    },
                    "environment": {
                      "enum": [
                        "staging",
                        "production"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "configured",
                    "plans",
                    "environment"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Tenant, MFA or permission denied"
          },
          "409": {
            "description": "Original request or provider evidence conflict"
          },
          "503": {
            "description": "Genuine provider not configured or outcome unresolved"
          }
        }
      }
    },
    "/v1/organizations/{org}/billing/status": {
      "get": {
        "operationId": "get_v1_organizations_org_billing_status",
        "summary": "Real Azums commercial status",
        "security": [
          {
            "BrowserSession": []
          }
        ],
        "x-permissions": [
          "organization:read",
          "billing:read"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative server response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "environment": {
                      "enum": [
                        "staging",
                        "production"
                      ]
                    },
                    "grants": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "plan": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "currency": {
                                "type": "string",
                                "enum": [
                                  "NGN",
                                  "USD",
                                  "GHS",
                                  "ZAR",
                                  "KES"
                                ]
                              },
                              "amount_minor": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]*$",
                                "description": "Exact positive unsigned 64-bit minor units; never JSON floating point"
                              },
                              "interval": {
                                "type": "string",
                                "enum": [
                                  "monthly",
                                  "annually"
                                ]
                              },
                              "renewal": {
                                "const": "manual"
                              },
                              "features": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "api_keys",
                                    "team_management"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "currency",
                              "amount_minor",
                              "interval",
                              "renewal",
                              "features"
                            ]
                          },
                          "valid_from": {
                            "type": "string"
                          },
                          "valid_until": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "plan",
                          "valid_from",
                          "valid_until"
                        ]
                      }
                    }
                  },
                  "required": [
                    "environment",
                    "grants"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Tenant, MFA or permission denied"
          },
          "409": {
            "description": "Original request or provider evidence conflict"
          },
          "503": {
            "description": "Genuine provider not configured or outcome unresolved"
          }
        }
      }
    },
    "/v1/organizations/{org}/billing/checkout": {
      "post": {
        "operationId": "post_v1_organizations_org_billing_checkout",
        "summary": "Real Azums commercial checkout",
        "security": [
          {
            "BrowserSession": []
          }
        ],
        "x-permissions": [
          "organization:read",
          "billing:read",
          "billing:write",
          "human_mfa"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{8,80}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative server response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "plan": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string",
                          "enum": [
                            "NGN",
                            "USD",
                            "GHS",
                            "ZAR",
                            "KES"
                          ]
                        },
                        "amount_minor": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]*$",
                          "description": "Exact positive unsigned 64-bit minor units; never JSON floating point"
                        },
                        "interval": {
                          "type": "string",
                          "enum": [
                            "monthly",
                            "annually"
                          ]
                        },
                        "renewal": {
                          "const": "manual"
                        },
                        "features": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "api_keys",
                              "team_management"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "currency",
                        "amount_minor",
                        "interval",
                        "renewal",
                        "features"
                      ]
                    },
                    "amount_minor": {
                      "type": "string",
                      "pattern": "^[1-9][0-9]*$",
                      "description": "Exact positive unsigned 64-bit minor units; never JSON floating point"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "state": {
                      "enum": [
                        "initializing",
                        "ready",
                        "initialization_unknown",
                        "pending",
                        "paid",
                        "failed",
                        "reversed"
                      ]
                    },
                    "reference": {
                      "type": "string"
                    },
                    "authorization_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "plan",
                    "amount_minor",
                    "currency",
                    "state",
                    "reference",
                    "authorization_url",
                    "created_at"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Tenant, MFA or permission denied"
          },
          "409": {
            "description": "Original request or provider evidence conflict"
          },
          "503": {
            "description": "Genuine provider not configured or outcome unresolved"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "plan_id": {
                    "type": "string"
                  },
                  "catalog_version": {
                    "type": "string"
                  }
                },
                "required": [
                  "plan_id",
                  "catalog_version"
                ],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{org}/billing/checkouts": {
      "get": {
        "operationId": "get_v1_organizations_org_billing_checkouts",
        "summary": "Real Azums commercial checkouts",
        "security": [
          {
            "BrowserSession": []
          }
        ],
        "x-permissions": [
          "organization:read",
          "billing:read"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative server response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "checkouts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "plan": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              },
                              "currency": {
                                "type": "string",
                                "enum": [
                                  "NGN",
                                  "USD",
                                  "GHS",
                                  "ZAR",
                                  "KES"
                                ]
                              },
                              "amount_minor": {
                                "type": "string",
                                "pattern": "^[1-9][0-9]*$",
                                "description": "Exact positive unsigned 64-bit minor units; never JSON floating point"
                              },
                              "interval": {
                                "type": "string",
                                "enum": [
                                  "monthly",
                                  "annually"
                                ]
                              },
                              "renewal": {
                                "const": "manual"
                              },
                              "features": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "enum": [
                                    "api_keys",
                                    "team_management"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "id",
                              "name",
                              "currency",
                              "amount_minor",
                              "interval",
                              "renewal",
                              "features"
                            ]
                          },
                          "amount_minor": {
                            "type": "string",
                            "pattern": "^[1-9][0-9]*$",
                            "description": "Exact positive unsigned 64-bit minor units; never JSON floating point"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "state": {
                            "enum": [
                              "initializing",
                              "ready",
                              "initialization_unknown",
                              "pending",
                              "paid",
                              "failed",
                              "reversed"
                            ]
                          },
                          "reference": {
                            "type": "string"
                          },
                          "authorization_url": {
                            "type": [
                              "string",
                              "null"
                            ],
                            "format": "uri"
                          },
                          "created_at": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "plan",
                          "amount_minor",
                          "currency",
                          "state",
                          "reference",
                          "authorization_url",
                          "created_at"
                        ]
                      }
                    }
                  },
                  "required": [
                    "checkouts"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Tenant, MFA or permission denied"
          },
          "409": {
            "description": "Original request or provider evidence conflict"
          },
          "503": {
            "description": "Genuine provider not configured or outcome unresolved"
          }
        }
      }
    },
    "/v1/organizations/{org}/billing/checkouts/{id}": {
      "get": {
        "operationId": "get_v1_organizations_org_billing_checkouts_id",
        "summary": "Real Azums commercial checkouts/{id}",
        "security": [
          {
            "BrowserSession": []
          }
        ],
        "x-permissions": [
          "organization:read",
          "billing:read"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative server response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "plan": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string",
                          "enum": [
                            "NGN",
                            "USD",
                            "GHS",
                            "ZAR",
                            "KES"
                          ]
                        },
                        "amount_minor": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]*$",
                          "description": "Exact positive unsigned 64-bit minor units; never JSON floating point"
                        },
                        "interval": {
                          "type": "string",
                          "enum": [
                            "monthly",
                            "annually"
                          ]
                        },
                        "renewal": {
                          "const": "manual"
                        },
                        "features": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "api_keys",
                              "team_management"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "currency",
                        "amount_minor",
                        "interval",
                        "renewal",
                        "features"
                      ]
                    },
                    "amount_minor": {
                      "type": "string",
                      "pattern": "^[1-9][0-9]*$",
                      "description": "Exact positive unsigned 64-bit minor units; never JSON floating point"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "state": {
                      "enum": [
                        "initializing",
                        "ready",
                        "initialization_unknown",
                        "pending",
                        "paid",
                        "failed",
                        "reversed"
                      ]
                    },
                    "reference": {
                      "type": "string"
                    },
                    "authorization_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "plan",
                    "amount_minor",
                    "currency",
                    "state",
                    "reference",
                    "authorization_url",
                    "created_at"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Tenant, MFA or permission denied"
          },
          "409": {
            "description": "Original request or provider evidence conflict"
          },
          "503": {
            "description": "Genuine provider not configured or outcome unresolved"
          }
        }
      }
    },
    "/v1/organizations/{org}/billing/checkouts/{id}/verify": {
      "post": {
        "operationId": "post_v1_organizations_org_billing_checkouts_id_verify",
        "summary": "Real Azums commercial checkouts/{id}/verify",
        "security": [
          {
            "BrowserSession": []
          }
        ],
        "x-permissions": [
          "organization:read",
          "billing:read",
          "billing:write",
          "human_mfa"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative server response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "plan": {
                      "type": "object",
                      "properties": {
                        "id": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        },
                        "currency": {
                          "type": "string",
                          "enum": [
                            "NGN",
                            "USD",
                            "GHS",
                            "ZAR",
                            "KES"
                          ]
                        },
                        "amount_minor": {
                          "type": "string",
                          "pattern": "^[1-9][0-9]*$",
                          "description": "Exact positive unsigned 64-bit minor units; never JSON floating point"
                        },
                        "interval": {
                          "type": "string",
                          "enum": [
                            "monthly",
                            "annually"
                          ]
                        },
                        "renewal": {
                          "const": "manual"
                        },
                        "features": {
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": [
                              "api_keys",
                              "team_management"
                            ]
                          }
                        }
                      },
                      "required": [
                        "id",
                        "name",
                        "currency",
                        "amount_minor",
                        "interval",
                        "renewal",
                        "features"
                      ]
                    },
                    "amount_minor": {
                      "type": "string",
                      "pattern": "^[1-9][0-9]*$",
                      "description": "Exact positive unsigned 64-bit minor units; never JSON floating point"
                    },
                    "currency": {
                      "type": "string"
                    },
                    "state": {
                      "enum": [
                        "initializing",
                        "ready",
                        "initialization_unknown",
                        "pending",
                        "paid",
                        "failed",
                        "reversed"
                      ]
                    },
                    "reference": {
                      "type": "string"
                    },
                    "authorization_url": {
                      "type": [
                        "string",
                        "null"
                      ],
                      "format": "uri"
                    },
                    "created_at": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "plan",
                    "amount_minor",
                    "currency",
                    "state",
                    "reference",
                    "authorization_url",
                    "created_at"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Tenant, MFA or permission denied"
          },
          "409": {
            "description": "Original request or provider evidence conflict"
          },
          "503": {
            "description": "Genuine provider not configured or outcome unresolved"
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {},
                "required": [],
                "additionalProperties": false
              }
            }
          }
        }
      }
    },
    "/v1/organizations/{org}/billing/receipts": {
      "get": {
        "operationId": "get_v1_organizations_org_billing_receipts",
        "summary": "Real Azums commercial receipts",
        "security": [
          {
            "BrowserSession": []
          }
        ],
        "x-permissions": [
          "organization:read",
          "billing:read"
        ],
        "parameters": [
          {
            "in": "path",
            "name": "org",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Authoritative server response",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "receipts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "checkout_id": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "provider_transaction_id": {
                            "type": "string"
                          },
                          "provider_reference": {
                            "type": "string"
                          },
                          "amount_minor": {
                            "type": "string",
                            "pattern": "^[1-9][0-9]*$",
                            "description": "Exact positive unsigned 64-bit minor units; never JSON floating point"
                          },
                          "currency": {
                            "type": "string"
                          },
                          "fees_minor": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "verified_at": {
                            "type": "string"
                          },
                          "reversed": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "id",
                          "checkout_id",
                          "provider_transaction_id",
                          "provider_reference",
                          "amount_minor",
                          "currency",
                          "fees_minor",
                          "verified_at",
                          "reversed"
                        ]
                      }
                    }
                  },
                  "required": [
                    "receipts"
                  ]
                }
              }
            }
          },
          "401": {
            "description": "Authentication required"
          },
          "403": {
            "description": "Tenant, MFA or permission denied"
          },
          "409": {
            "description": "Original request or provider evidence conflict"
          },
          "503": {
            "description": "Genuine provider not configured or outcome unresolved"
          }
        }
      }
    },
    "/v1/billing/paystack/webhook": {
      "post": {
        "operationId": "post_v1_billing_paystack_webhook",
        "summary": "Provider only: authenticate exact raw bytes, persist inbox, then reconcile",
        "security": [],
        "x-authentication": "Paystack timestamped HMAC-SHA512 signing secret; legacy only without configured modern secret",
        "responses": {
          "200": {
            "description": "Durably accepted"
          },
          "401": {
            "description": "Invalid signature"
          },
          "503": {
            "description": "Not accepted; provider should retry"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "EnrollmentConfirm": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true
          }
        },
        "required": [
          "code"
        ]
      },
      "Envelope": {
        "type": "object",
        "required": [
          "request_id"
        ],
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": true
      },
      "InvitationCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "developer",
              "operator",
              "finance",
              "approver",
              "auditor"
            ]
          }
        },
        "required": [
          "email",
          "role"
        ]
      },
      "KeyCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 80
          },
          "scopes": {
            "type": "array",
            "minItems": 1,
            "maxItems": 27,
            "items": {
              "type": "string",
              "enum": [
                "organization:read",
                "members:read",
                "jobs:read",
                "jobs:write",
                "audit:read",
                "signers:read",
                "signers:write",
                "wallets:read",
                "wallets:write",
                "destinations:read",
                "destinations:write",
                "solana:read",
                "solana:write",
                "base:read",
                "base:write",
                "collections:read",
                "collections:write",
                "webhooks:read",
                "webhooks:write",
                "orders:read",
                "orders:write",
                "payouts:read",
                "payouts:write",
                "outcomes:read",
                "outcomes:write",
                "billing:read",
                "support:read"
              ]
            }
          },
          "environment": {
            "type": "string",
            "enum": [
              "sandbox"
            ]
          },
          "expires_in_seconds": {
            "type": "integer",
            "minimum": 60,
            "maximum": 7776000
          }
        },
        "required": [
          "name",
          "scopes",
          "environment",
          "expires_in_seconds"
        ]
      },
      "Login": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "password": {
            "type": "string",
            "writeOnly": true
          }
        },
        "required": [
          "email",
          "password"
        ]
      },
      "MemberChange": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "role": {
            "type": "string",
            "enum": [
              "admin",
              "developer",
              "operator",
              "finance",
              "approver",
              "auditor"
            ]
          },
          "active": {
            "type": "boolean"
          }
        },
        "required": [
          "role",
          "active"
        ]
      },
      "MfaCode": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[0-9]{6}$",
            "writeOnly": true
          },
          "recovery_code": {
            "type": "string",
            "writeOnly": true
          }
        },
        "required": [],
        "oneOf": [
          {
            "required": [
              "code"
            ],
            "not": {
              "required": [
                "recovery_code"
              ]
            }
          },
          {
            "required": [
              "recovery_code"
            ],
            "not": {
              "required": [
                "code"
              ]
            }
          }
        ]
      },
      "OneTimeKey": {
        "type": "object",
        "required": [
          "id",
          "secret",
          "shown_once",
          "environment",
          "request_id"
        ],
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid"
          },
          "secret": {
            "type": "string",
            "readOnly": true,
            "description": "Returned exactly at issuance/rotation; never available from list/audit."
          },
          "shown_once": {
            "const": true
          },
          "environment": {
            "enum": [
              "sandbox",
              "staging",
              "production"
            ]
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          }
        },
        "additionalProperties": true
      },
      "OrganizationCreate": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 80
          }
        },
        "required": [
          "name"
        ]
      },
      "Problem": {
        "type": "object",
        "required": [
          "code",
          "message",
          "request_id"
        ],
        "properties": {
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "request_id": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "Register": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "email": {
            "type": "string",
            "format": "email"
          },
          "password": {
            "type": "string",
            "minLength": 12,
            "maxLength": 256,
            "writeOnly": true,
            "description": "Maximum 256 UTF-8 bytes."
          },
          "display_name": {
            "type": "string",
            "minLength": 2,
            "maxLength": 80
          }
        },
        "required": [
          "email",
          "password",
          "display_name"
        ]
      },
      "Token": {
        "type": "object",
        "additionalProperties": false,
        "properties": {
          "token": {
            "type": "string",
            "writeOnly": true
          }
        },
        "required": [
          "token"
        ]
      }
    },
    "securitySchemes": {
      "BrowserSession": {
        "type": "apiKey",
        "in": "cookie",
        "name": "__Host-azums_session",
        "description": "Production host-only secure HttpOnly session. Staging uses __Host-azums_staging_session. Email verification, MFA, exact Origin and X-Azums-CSRF: 1 required for browser mutations."
      },
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "Environment-scoped API key; active membership and paid API access required. Keys cannot purchase plans."
      }
    }
  }
}
