{
  "openapi": "3.1.0",
  "info": {
    "title": "Agent Account HTTP API",
    "version": "1.0.0",
    "description": "Protected organization account reads used by the CLI's local stdio MCP server. This is an HTTP adapter reference, not a remote MCP transport."
  },
  "servers": [
    {
      "url": "https://{apiHost}",
      "description": "Actual approved API origin. An OAuth resource audience containing /mcp is not the HTTP base URL.",
      "variables": {
        "apiHost": {
          "default": "example.invalid"
        }
      }
    }
  ],
  "paths": {
    "/mcp/members": {
      "get": {
        "summary": "Read the organization membership directory",
        "security": [
          {
            "mcpBearer": []
          }
        ],
        "x-appportal-required-oauth-scopes": [
          "mcp:account.read"
        ],
        "x-appportal-current-authority": "Current governed CLI connection with all-app organization access and no denied apps. Admin role; AppOwner alone cannot list members. Organization selectors confer no new authority.",
        "parameters": [
          {
            "name": "X-AppPortal-Organization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Select a currently permitted organization on a portfolio connection. App/environment/platform/target headers do not narrow this organization-wide read or bypass the all-app requirement."
          },
          {
            "name": "status",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "Active",
                "Invited"
              ]
            },
            "description": "Case-insensitive canonical name; numeric aliases are rejected."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 25
            },
            "description": "One bounded positive integer."
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Opaque protected continuation from the preceding page; cannot retarget subject, organization or status."
          }
        ],
        "responses": {
          "200": {
            "description": "Authorized sanitized membership page. A null totalCount is unknown.",
            "x-appportal-body-optional": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountMembers"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query or organization selection. Query validation supports problem JSON. Framework and authorization failures can be bodyless. Include application/problem+json in Accept to request a support trace and machine-readable code.",
            "x-appportal-body-optional": true,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountError"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountProblem"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              },
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              }
            }
          },
          "401": {
            "description": "Missing, expired, revoked or wrong-audience authentication; body may be absent."
          },
          "403": {
            "description": "Current scope, consent, all-app access or required role is missing; body may be absent."
          },
          "404": {
            "description": "Organization does not exist, is operationally unavailable or is hidden by current authority/plan eligibility; body may be absent."
          },
          "429": {
            "description": "Current ingress/connection budget exceeded; respect Retry-After when supplied."
          },
          "501": {
            "description": "The provider does not support this read. Include application/problem+json in Accept to request a support trace and machine-readable code.",
            "x-appportal-body-optional": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountUnavailable"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountIncompleteProblem"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              },
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              }
            }
          },
          "503": {
            "description": "The account source is unavailable. Include application/problem+json in Accept to request a support trace and machine-readable code.",
            "x-appportal-body-optional": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountUnavailable"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountIncompleteProblem"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              },
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              }
            }
          }
        },
        "description": "Bounded membership page containing protected member handles, sanitized display names and membership state. No contacts, raw user IDs or credentials are returned. Continuations bind the subject, organization and status filter. This operation does not negotiate account V2."
      }
    },
    "/mcp/plan": {
      "get": {
        "summary": "Read the organization's pinned offering",
        "security": [
          {
            "mcpBearer": []
          }
        ],
        "x-appportal-required-oauth-scopes": [
          "mcp:account.read"
        ],
        "x-appportal-current-authority": "Current governed CLI connection with all-app organization access and no denied apps. Admin or AppOwner role. Organization selectors confer no new authority.",
        "parameters": [
          {
            "name": "X-AppPortal-Organization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Select a currently permitted organization on a portfolio connection. App/environment/platform/target headers do not narrow this organization-wide read or bypass the all-app requirement."
          },
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Use application/vnd.appportal.mcp-account.v2+json to opt into account-offering.v2; wildcards alone retain legacy JSON."
          }
        ],
        "responses": {
          "200": {
            "description": "Selected account representation; V2 preserves exact Int64 number tokens and explicit null slots.",
            "x-appportal-body-optional": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountLegacy"
                }
              },
              "application/vnd.appportal.mcp-account.v2+json": {
                "schema": {
                  "$ref": "#/components/schemas/McpAccountV2Response"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query or organization selection. Query validation supports problem JSON. Framework and authorization failures can be bodyless. Include application/problem+json in Accept to request a support trace and machine-readable code.",
            "x-appportal-body-optional": true,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountError"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountProblem"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              },
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              }
            }
          },
          "401": {
            "description": "Missing, expired, revoked or wrong-audience authentication; body may be absent."
          },
          "403": {
            "description": "Current scope, consent, all-app access or required role is missing; body may be absent."
          },
          "404": {
            "description": "Organization does not exist, is operationally unavailable or is hidden by current authority/plan eligibility; body may be absent."
          },
          "406": {
            "description": "No supported success representation was requested. The error preserves the incomplete result. Include application/problem+json in Accept to request a support trace and machine-readable code.",
            "x-appportal-body-optional": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpAccountV2Error"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountIncompleteProblem"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              },
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              }
            }
          },
          "429": {
            "description": "Current ingress/connection budget exceeded; respect Retry-After when supplied."
          },
          "501": {
            "description": "The provider does not support this read. Include application/problem+json in Accept to request a support trace and machine-readable code.",
            "x-appportal-body-optional": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountUnavailable"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountIncompleteProblem"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              },
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              }
            }
          },
          "503": {
            "description": "The account source is unavailable. Include application/problem+json in Accept to request a support trace and machine-readable code.",
            "x-appportal-body-optional": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountUnavailable"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountIncompleteProblem"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              },
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              }
            }
          }
        },
        "description": "No query parameters are accepted. Absent Accept, application/json and wildcards select legacy JSON. A vendor representation requires an explicit media range with positive quality and takes precedence over legacy JSON at equal quality. Only UTF-8 charset and valid q parameters are supported. An unsupported success representation returns 406. Include application/problem+json to request a structured error. quota is null in both representations. A missing allowance anchor leaves period/reset unknown."
      }
    },
    "/mcp/quota": {
      "get": {
        "summary": "Read organization allowance usage",
        "security": [
          {
            "mcpBearer": []
          }
        ],
        "x-appportal-required-oauth-scopes": [
          "mcp:account.read"
        ],
        "x-appportal-current-authority": "Current governed CLI connection with all-app organization access and no denied apps. Admin or AppOwner role. Organization selectors confer no new authority.",
        "parameters": [
          {
            "name": "X-AppPortal-Organization",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Select a currently permitted organization on a portfolio connection. App/environment/platform/target headers do not narrow this organization-wide read or bypass the all-app requirement."
          },
          {
            "name": "Accept",
            "in": "header",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Select application/vnd.appportal.mcp-account.v2+json for account allowances or application/vnd.appportal.mcp-messaging-usage.v1+json for posted messaging usage."
          }
        ],
        "responses": {
          "200": {
            "description": "Selected account representation; V2 preserves exact Int64 number tokens and explicit null slots.",
            "x-appportal-body-optional": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountLegacy"
                }
              },
              "application/vnd.appportal.mcp-account.v2+json": {
                "schema": {
                  "$ref": "#/components/schemas/McpAccountV2Response"
                }
              },
              "application/vnd.appportal.mcp-messaging-usage.v1+json": {
                "schema": {
                  "$ref": "#/components/schemas/McpMessagingQuota"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              }
            }
          },
          "400": {
            "description": "Invalid query or organization selection. Query validation supports problem JSON. Framework and authorization failures can be bodyless. Include application/problem+json in Accept to request a support trace and machine-readable code.",
            "x-appportal-body-optional": true,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountError"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountProblem"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              },
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              }
            }
          },
          "401": {
            "description": "Missing, expired, revoked or wrong-audience authentication; body may be absent."
          },
          "403": {
            "description": "Current scope, consent, all-app access or required role is missing; body may be absent."
          },
          "404": {
            "description": "Organization does not exist, is operationally unavailable or is hidden by current authority/plan eligibility; body may be absent."
          },
          "406": {
            "description": "No supported success representation was requested. The error preserves the incomplete result. Include application/problem+json in Accept to request a support trace and machine-readable code.",
            "x-appportal-body-optional": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpAccountV2Error"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountIncompleteProblem"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              },
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              }
            }
          },
          "429": {
            "description": "Current ingress/connection budget exceeded; respect Retry-After when supplied."
          },
          "501": {
            "description": "The provider does not support this read. Include application/problem+json in Accept to request a support trace and machine-readable code.",
            "x-appportal-body-optional": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountUnavailable"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountIncompleteProblem"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              },
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              }
            }
          },
          "503": {
            "description": "The account source is unavailable. Include application/problem+json in Accept to request a support trace and machine-readable code.",
            "x-appportal-body-optional": false,
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountUnavailable"
                }
              },
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/AgentAccountIncompleteProblem"
                }
              }
            },
            "headers": {
              "Cache-Control": {
                "schema": {
                  "const": "no-store, private"
                }
              },
              "Pragma": {
                "schema": {
                  "const": "no-cache"
                }
              },
              "X-Content-Type-Options": {
                "schema": {
                  "const": "nosniff"
                }
              },
              "X-AppPortal-Diagnostic-Classification": {
                "schema": {
                  "const": "sanitized"
                }
              },
              "Vary": {
                "schema": {
                  "const": "Accept"
                }
              },
              "X-AppPortal-TraceId": {
                "$ref": "#/components/headers/ManagementProblemTraceId"
              }
            }
          }
        },
        "description": "No query parameters are accepted. Absent Accept, application/json and wildcards select legacy JSON. A vendor representation requires an explicit media range with positive quality and takes precedence over legacy JSON at equal quality. Only UTF-8 charset and valid q parameters are supported. An unsupported success representation returns 406. Include application/problem+json to request a structured error. Inspect each V2 metric's coverage and authoritativeForQuota. The V2 quota response remains partial. Messaging usage returns posted wallet balances and observed provider acceptances. It wins an equal-quality tie with V2."
      }
    }
  },
  "components": {
    "schemas": {
      "McpAccountV2Response": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "captureComplete": {
            "type": "boolean"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "plan": {
            "type": "object",
            "properties": {
              "key": {
                "type": "string"
              },
              "name": {
                "type": "string"
              },
              "maxApps": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "maxMonthlyActiveUsers": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "monthlyPushQuota": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "monthlyMessagingCredits": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "dataRetentionDays": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "paidMessagingEnabled": {
                "type": [
                  "boolean",
                  "null"
                ]
              },
              "telemetryPolicyVersion": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "identitySource": {
                "type": "string"
              },
              "allowanceBasis": {
                "type": "string"
              }
            },
            "required": [
              "key",
              "name",
              "maxApps",
              "maxMonthlyActiveUsers",
              "monthlyPushQuota",
              "monthlyMessagingCredits",
              "dataRetentionDays",
              "paidMessagingEnabled",
              "telemetryPolicyVersion",
              "identitySource",
              "allowanceBasis"
            ],
            "additionalProperties": false
          },
          "contentTruncated": {
            "type": "boolean"
          },
          "allowancePeriod": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "startsAt": {
                "type": "string",
                "format": "date-time"
              },
              "endsAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "startsAt",
              "endsAt"
            ],
            "additionalProperties": false
          },
          "nextResetAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "allowancePeriodStatus": {
            "type": "string"
          },
          "allowancePeriodReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "creditPeriod": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "startsAt": {
                "type": "string",
                "format": "date-time"
              },
              "endsAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "startsAt",
              "endsAt"
            ],
            "additionalProperties": false
          },
          "subscriptionStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "quota": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "apps": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "unit": {
                    "type": "string"
                  },
                  "period": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "startsAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "endsAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "startsAt",
                      "endsAt"
                    ],
                    "additionalProperties": false
                  },
                  "limit": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "reserved": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "remaining": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "coverage": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string"
                      },
                      "observedAt": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "date-time"
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "status",
                      "observedAt",
                      "reason"
                    ],
                    "additionalProperties": false
                  },
                  "authoritativeForQuota": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "status",
                  "unit",
                  "period",
                  "limit",
                  "used",
                  "reserved",
                  "remaining",
                  "coverage",
                  "authoritativeForQuota"
                ],
                "additionalProperties": false
              },
              "operators": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "unit": {
                    "type": "string"
                  },
                  "period": {
                    "$ref": "#/components/schemas/McpAccountV2Response/properties/quota/properties/apps/properties/period"
                  },
                  "limit": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "reserved": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "remaining": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "coverage": {
                    "$ref": "#/components/schemas/McpAccountV2Response/properties/quota/properties/apps/properties/coverage"
                  },
                  "authoritativeForQuota": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "status",
                  "unit",
                  "period",
                  "limit",
                  "used",
                  "reserved",
                  "remaining",
                  "coverage",
                  "authoritativeForQuota"
                ],
                "additionalProperties": false
              },
              "telemetry": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "unit": {
                    "type": "string"
                  },
                  "period": {
                    "type": [
                      "object",
                      "null"
                    ],
                    "properties": {
                      "startsAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "endsAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    },
                    "required": [
                      "startsAt",
                      "endsAt"
                    ],
                    "additionalProperties": false
                  },
                  "limit": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "accepted": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "reserved": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "publishing": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "uncertain": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "remaining": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "coverage": {
                    "type": "object",
                    "properties": {
                      "status": {
                        "type": "string"
                      },
                      "observedAt": {
                        "type": [
                          "string",
                          "null"
                        ],
                        "format": "date-time"
                      },
                      "reason": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "status",
                      "observedAt",
                      "reason"
                    ],
                    "additionalProperties": false
                  },
                  "authoritativeForQuota": {
                    "type": "boolean"
                  }
                },
                "required": [
                  "status",
                  "unit",
                  "period",
                  "limit",
                  "accepted",
                  "reserved",
                  "publishing",
                  "uncertain",
                  "remaining",
                  "coverage",
                  "authoritativeForQuota"
                ],
                "additionalProperties": false
              },
              "monthlyActiveUsers": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "unit": {
                    "type": "string"
                  },
                  "limit": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "remaining": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "percentUsed": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "authoritativeForQuota": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "status",
                  "unit",
                  "limit",
                  "used",
                  "remaining",
                  "percentUsed",
                  "authoritativeForQuota",
                  "reason"
                ],
                "additionalProperties": false
              },
              "push": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "unit": {
                    "type": "string"
                  },
                  "limit": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "remaining": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "percentUsed": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "authoritativeForQuota": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "status",
                  "unit",
                  "limit",
                  "used",
                  "remaining",
                  "percentUsed",
                  "authoritativeForQuota",
                  "reason"
                ],
                "additionalProperties": false
              },
              "messagingCredits": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "unit": {
                    "type": "string"
                  },
                  "limit": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "used": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "remaining": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "percentUsed": {
                    "type": [
                      "number",
                      "null"
                    ]
                  },
                  "authoritativeForQuota": {
                    "type": "boolean"
                  },
                  "reason": {
                    "type": "string"
                  }
                },
                "required": [
                  "status",
                  "unit",
                  "limit",
                  "used",
                  "remaining",
                  "percentUsed",
                  "authoritativeForQuota",
                  "reason"
                ],
                "additionalProperties": false
              },
              "transport": {
                "type": "object",
                "additionalProperties": {
                  "type": [
                    "object",
                    "null"
                  ],
                  "properties": {
                    "status": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string"
                    },
                    "unit": {
                      "type": "string"
                    },
                    "limit": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "used": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "remaining": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "percentUsed": {
                      "type": [
                        "number",
                        "null"
                      ]
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "status",
                    "mode",
                    "unit",
                    "limit",
                    "used",
                    "remaining",
                    "percentUsed",
                    "reason"
                  ],
                  "additionalProperties": false
                }
              },
              "observations": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string"
                  },
                  "authoritativeForQuota": {
                    "type": "boolean"
                  },
                  "from": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "to": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "events": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "sessions": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "logs": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "monthlyActiveUsers": {
                    "type": [
                      "integer",
                      "null"
                    ]
                  },
                  "identityAvailable": {
                    "type": [
                      "boolean",
                      "null"
                    ]
                  }
                },
                "required": [
                  "status",
                  "reason",
                  "authoritativeForQuota",
                  "from",
                  "to",
                  "events",
                  "sessions",
                  "logs",
                  "monthlyActiveUsers",
                  "identityAvailable"
                ],
                "additionalProperties": false
              }
            },
            "required": [
              "apps",
              "operators",
              "telemetry",
              "monthlyActiveUsers",
              "push",
              "messagingCredits",
              "transport",
              "observations"
            ],
            "additionalProperties": false
          },
          "enforcementStatus": {
            "type": "string"
          },
          "contractVersion": {
            "type": "string"
          }
        },
        "required": [
          "organizationId",
          "status",
          "captureComplete",
          "generatedAt",
          "plan",
          "contentTruncated",
          "allowancePeriod",
          "nextResetAt",
          "allowancePeriodStatus",
          "allowancePeriodReason",
          "creditPeriod",
          "subscriptionStatus",
          "quota",
          "enforcementStatus",
          "contractVersion"
        ],
        "additionalProperties": false,
        "description": "Explicitly negotiated account-offering.v2. All null slots are written. Int64 counters are exact JSON number tokens; consumers must preserve their full range. Coverage and authoritativeForQuota govern each metric independently. Quota remains partial at the top level; unavailable counters are null, never zero or unlimited. enforcementStatus is not_evaluated."
      },
      "McpAccountV2Plan": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "key": {
            "type": "string"
          },
          "name": {
            "type": "string"
          },
          "maxApps": {
            "type": [
              "integer",
              "null"
            ]
          },
          "maxMonthlyActiveUsers": {
            "type": [
              "integer",
              "null"
            ]
          },
          "monthlyPushQuota": {
            "type": [
              "integer",
              "null"
            ]
          },
          "monthlyMessagingCredits": {
            "type": [
              "integer",
              "null"
            ]
          },
          "dataRetentionDays": {
            "type": [
              "integer",
              "null"
            ]
          },
          "paidMessagingEnabled": {
            "type": [
              "boolean",
              "null"
            ]
          },
          "telemetryPolicyVersion": {
            "type": [
              "string",
              "null"
            ]
          },
          "identitySource": {
            "type": "string"
          },
          "allowanceBasis": {
            "type": "string"
          }
        },
        "required": [
          "key",
          "name",
          "maxApps",
          "maxMonthlyActiveUsers",
          "monthlyPushQuota",
          "monthlyMessagingCredits",
          "dataRetentionDays",
          "paidMessagingEnabled",
          "telemetryPolicyVersion",
          "identitySource",
          "allowanceBasis"
        ],
        "additionalProperties": false
      },
      "McpAccountV2Quota": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "apps": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "period": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "startsAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "endsAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "startsAt",
                  "endsAt"
                ],
                "additionalProperties": false
              },
              "limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "used": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "reserved": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "remaining": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "coverage": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "observedAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "status",
                  "observedAt",
                  "reason"
                ],
                "additionalProperties": false
              },
              "authoritativeForQuota": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "unit",
              "period",
              "limit",
              "used",
              "reserved",
              "remaining",
              "coverage",
              "authoritativeForQuota"
            ],
            "additionalProperties": false
          },
          "operators": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "period": {
                "$ref": "#/components/schemas/McpAccountV2Quota/properties/apps/properties/period"
              },
              "limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "used": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "reserved": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "remaining": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "coverage": {
                "$ref": "#/components/schemas/McpAccountV2Quota/properties/apps/properties/coverage"
              },
              "authoritativeForQuota": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "unit",
              "period",
              "limit",
              "used",
              "reserved",
              "remaining",
              "coverage",
              "authoritativeForQuota"
            ],
            "additionalProperties": false
          },
          "telemetry": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "period": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "startsAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "endsAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "startsAt",
                  "endsAt"
                ],
                "additionalProperties": false
              },
              "limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "accepted": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "reserved": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "publishing": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "uncertain": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "remaining": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "coverage": {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string"
                  },
                  "observedAt": {
                    "type": [
                      "string",
                      "null"
                    ],
                    "format": "date-time"
                  },
                  "reason": {
                    "type": [
                      "string",
                      "null"
                    ]
                  }
                },
                "required": [
                  "status",
                  "observedAt",
                  "reason"
                ],
                "additionalProperties": false
              },
              "authoritativeForQuota": {
                "type": "boolean"
              }
            },
            "required": [
              "status",
              "unit",
              "period",
              "limit",
              "accepted",
              "reserved",
              "publishing",
              "uncertain",
              "remaining",
              "coverage",
              "authoritativeForQuota"
            ],
            "additionalProperties": false
          },
          "monthlyActiveUsers": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "used": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "remaining": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "percentUsed": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "authoritativeForQuota": {
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "status",
              "unit",
              "limit",
              "used",
              "remaining",
              "percentUsed",
              "authoritativeForQuota",
              "reason"
            ],
            "additionalProperties": false
          },
          "push": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "used": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "remaining": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "percentUsed": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "authoritativeForQuota": {
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "status",
              "unit",
              "limit",
              "used",
              "remaining",
              "percentUsed",
              "authoritativeForQuota",
              "reason"
            ],
            "additionalProperties": false
          },
          "messagingCredits": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "unit": {
                "type": "string"
              },
              "limit": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "used": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "remaining": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "percentUsed": {
                "type": [
                  "number",
                  "null"
                ]
              },
              "authoritativeForQuota": {
                "type": "boolean"
              },
              "reason": {
                "type": "string"
              }
            },
            "required": [
              "status",
              "unit",
              "limit",
              "used",
              "remaining",
              "percentUsed",
              "authoritativeForQuota",
              "reason"
            ],
            "additionalProperties": false
          },
          "transport": {
            "type": "object",
            "additionalProperties": {
              "type": [
                "object",
                "null"
              ],
              "properties": {
                "status": {
                  "type": "string"
                },
                "mode": {
                  "type": "string"
                },
                "unit": {
                  "type": "string"
                },
                "limit": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "used": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "remaining": {
                  "type": [
                    "integer",
                    "null"
                  ]
                },
                "percentUsed": {
                  "type": [
                    "number",
                    "null"
                  ]
                },
                "reason": {
                  "type": "string"
                }
              },
              "required": [
                "status",
                "mode",
                "unit",
                "limit",
                "used",
                "remaining",
                "percentUsed",
                "reason"
              ],
              "additionalProperties": false
            }
          },
          "observations": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              },
              "authoritativeForQuota": {
                "type": "boolean"
              },
              "from": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "to": {
                "type": "string",
                "format": "date-time"
              },
              "events": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "sessions": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "logs": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "monthlyActiveUsers": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "identityAvailable": {
                "type": [
                  "boolean",
                  "null"
                ]
              }
            },
            "required": [
              "status",
              "reason",
              "authoritativeForQuota",
              "from",
              "to",
              "events",
              "sessions",
              "logs",
              "monthlyActiveUsers",
              "identityAvailable"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "apps",
          "operators",
          "telemetry",
          "monthlyActiveUsers",
          "push",
          "messagingCredits",
          "transport",
          "observations"
        ],
        "additionalProperties": false
      },
      "McpAccountV2Presence": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "period": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "startsAt": {
                "type": "string",
                "format": "date-time"
              },
              "endsAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "startsAt",
              "endsAt"
            ],
            "additionalProperties": false
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ]
          },
          "used": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reserved": {
            "type": [
              "integer",
              "null"
            ]
          },
          "remaining": {
            "type": [
              "integer",
              "null"
            ]
          },
          "coverage": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "observedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "status",
              "observedAt",
              "reason"
            ],
            "additionalProperties": false
          },
          "authoritativeForQuota": {
            "type": "boolean"
          }
        },
        "required": [
          "status",
          "unit",
          "period",
          "limit",
          "used",
          "reserved",
          "remaining",
          "coverage",
          "authoritativeForQuota"
        ],
        "additionalProperties": false
      },
      "McpAccountV2Telemetry": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "period": {
            "type": [
              "object",
              "null"
            ],
            "properties": {
              "startsAt": {
                "type": "string",
                "format": "date-time"
              },
              "endsAt": {
                "type": "string",
                "format": "date-time"
              }
            },
            "required": [
              "startsAt",
              "endsAt"
            ],
            "additionalProperties": false
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ]
          },
          "accepted": {
            "type": [
              "integer",
              "null"
            ]
          },
          "reserved": {
            "type": [
              "integer",
              "null"
            ]
          },
          "publishing": {
            "type": [
              "integer",
              "null"
            ]
          },
          "uncertain": {
            "type": [
              "integer",
              "null"
            ]
          },
          "remaining": {
            "type": [
              "integer",
              "null"
            ]
          },
          "coverage": {
            "type": "object",
            "properties": {
              "status": {
                "type": "string"
              },
              "observedAt": {
                "type": [
                  "string",
                  "null"
                ],
                "format": "date-time"
              },
              "reason": {
                "type": [
                  "string",
                  "null"
                ]
              }
            },
            "required": [
              "status",
              "observedAt",
              "reason"
            ],
            "additionalProperties": false
          },
          "authoritativeForQuota": {
            "type": "boolean"
          }
        },
        "required": [
          "status",
          "unit",
          "period",
          "limit",
          "accepted",
          "reserved",
          "publishing",
          "uncertain",
          "remaining",
          "coverage",
          "authoritativeForQuota"
        ],
        "additionalProperties": false
      },
      "McpAccountV2Coverage": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "observedAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "reason": {
            "type": [
              "string",
              "null"
            ]
          }
        },
        "required": [
          "status",
          "observedAt",
          "reason"
        ],
        "additionalProperties": false
      },
      "McpAccountV2LegacyScalar": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ]
          },
          "used": {
            "type": [
              "integer",
              "null"
            ]
          },
          "remaining": {
            "type": [
              "integer",
              "null"
            ]
          },
          "percentUsed": {
            "type": [
              "number",
              "null"
            ]
          },
          "authoritativeForQuota": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "unit",
          "limit",
          "used",
          "remaining",
          "percentUsed",
          "authoritativeForQuota",
          "reason"
        ],
        "additionalProperties": false
      },
      "McpAccountV2LegacyTransport": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "mode": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "limit": {
            "type": [
              "integer",
              "null"
            ]
          },
          "used": {
            "type": [
              "integer",
              "null"
            ]
          },
          "remaining": {
            "type": [
              "integer",
              "null"
            ]
          },
          "percentUsed": {
            "type": [
              "number",
              "null"
            ]
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "mode",
          "unit",
          "limit",
          "used",
          "remaining",
          "percentUsed",
          "reason"
        ],
        "additionalProperties": false
      },
      "McpAccountV2Observations": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "reason": {
            "type": "string"
          },
          "authoritativeForQuota": {
            "type": "boolean"
          },
          "from": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "to": {
            "type": "string",
            "format": "date-time"
          },
          "events": {
            "type": [
              "integer",
              "null"
            ]
          },
          "sessions": {
            "type": [
              "integer",
              "null"
            ]
          },
          "logs": {
            "type": [
              "integer",
              "null"
            ]
          },
          "monthlyActiveUsers": {
            "type": [
              "integer",
              "null"
            ]
          },
          "identityAvailable": {
            "type": [
              "boolean",
              "null"
            ]
          }
        },
        "required": [
          "status",
          "reason",
          "authoritativeForQuota",
          "from",
          "to",
          "events",
          "sessions",
          "logs",
          "monthlyActiveUsers",
          "identityAvailable"
        ],
        "additionalProperties": false
      },
      "McpAccountV2Error": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "status": {
            "type": "string"
          },
          "captureComplete": {
            "type": "boolean"
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "captureComplete",
          "reason"
        ],
        "additionalProperties": false
      },
      "McpMessagingQuota": {
        "type": [
          "object",
          "null"
        ],
        "properties": {
          "contractVersion": {
            "type": "string"
          },
          "organizationId": {
            "type": "string"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "push": {
            "type": "object",
            "properties": {
              "period": {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "startsAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "endsAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "startsAt",
                  "endsAt"
                ],
                "additionalProperties": false
              },
              "includedDevices": {
                "type": "integer"
              },
              "recordedAcceptedDevices": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "recordedPublishingDevices": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "recordedUncertainDevices": {
                "type": [
                  "integer",
                  "null"
                ]
              },
              "coverage": {
                "type": "string"
              },
              "remaining": {
                "type": [
                  "integer",
                  "null"
                ]
              }
            },
            "required": [
              "period",
              "includedDevices",
              "recordedAcceptedDevices",
              "recordedPublishingDevices",
              "recordedUncertainDevices",
              "coverage",
              "remaining"
            ],
            "additionalProperties": false
          },
          "messagingCredits": {
            "type": "object",
            "properties": {
              "period": {
                "type": "object",
                "properties": {
                  "startsAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "endsAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "startsAt",
                  "endsAt"
                ],
                "additionalProperties": false
              },
              "postedBalance": {
                "type": "string"
              },
              "postedDraws": {
                "type": "string"
              },
              "postedGrants": {
                "type": "string"
              }
            },
            "required": [
              "period",
              "postedBalance",
              "postedDraws",
              "postedGrants"
            ],
            "additionalProperties": false
          }
        },
        "required": [
          "contractVersion",
          "organizationId",
          "generatedAt",
          "push",
          "messagingCredits"
        ],
        "additionalProperties": false
      },
      "AgentAccountError": {
        "type": "object",
        "properties": {
          "error": {
            "type": "string"
          }
        },
        "required": [
          "error"
        ],
        "additionalProperties": false,
        "description": "Default account HTTP query validation response."
      },
      "AgentAccountProblem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "traceId": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "code",
          "message",
          "error",
          "traceId"
        ],
        "additionalProperties": false
      },
      "AgentAccountIncompleteProblem": {
        "type": "object",
        "properties": {
          "type": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "code": {
            "type": "string"
          },
          "message": {
            "type": "string"
          },
          "error": {
            "type": "string"
          },
          "traceId": {
            "type": "string"
          },
          "sourceStatus": {
            "enum": [
              "unsupported",
              "unavailable"
            ]
          },
          "captureComplete": {
            "const": false
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "type",
          "title",
          "status",
          "detail",
          "instance",
          "code",
          "message",
          "error",
          "traceId",
          "sourceStatus",
          "captureComplete",
          "reason"
        ],
        "additionalProperties": false
      },
      "AgentAccountUnavailable": {
        "type": "object",
        "properties": {
          "status": {
            "enum": [
              "unsupported",
              "unavailable"
            ]
          },
          "captureComplete": {
            "const": false
          },
          "reason": {
            "enum": [
              "unsupported_provider",
              "account_data_unavailable"
            ]
          }
        },
        "required": [
          "status",
          "captureComplete",
          "reason"
        ],
        "additionalProperties": false
      },
      "AgentAccountMember": {
        "type": "object",
        "properties": {
          "memberId": {
            "type": "string"
          },
          "displayName": {
            "type": [
              "string",
              "null"
            ]
          },
          "status": {
            "type": "string"
          },
          "userActive": {
            "type": "boolean"
          },
          "createdAt": {
            "type": "string",
            "format": "date-time"
          },
          "contentTruncated": {
            "type": "boolean"
          }
        },
        "required": [
          "memberId",
          "displayName",
          "status",
          "userActive",
          "createdAt",
          "contentTruncated"
        ],
        "additionalProperties": false
      },
      "AgentAccountMembers": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "captureComplete": {
            "type": "boolean"
          },
          "returnedCount": {
            "type": "integer"
          },
          "totalCount": {
            "type": [
              "integer",
              "null"
            ]
          },
          "totalCountStatus": {
            "type": "string"
          },
          "hasMore": {
            "type": "boolean"
          },
          "continuationAvailable": {
            "type": "boolean"
          },
          "nextCursor": {
            "type": [
              "string",
              "null"
            ]
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "members": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/AgentAccountMember"
            }
          }
        },
        "required": [
          "organizationId",
          "status",
          "captureComplete",
          "returnedCount",
          "totalCount",
          "totalCountStatus",
          "hasMore",
          "continuationAvailable",
          "nextCursor",
          "generatedAt",
          "members"
        ],
        "additionalProperties": false
      },
      "AgentAccountLegacyPlan": {
        "type": "object",
        "properties": {
          "key": {
            "type": [
              "string",
              "null"
            ]
          },
          "name": {
            "type": [
              "string",
              "null"
            ]
          },
          "maxApps": {
            "type": "integer"
          },
          "maxMonthlyActiveUsers": {
            "type": "integer"
          },
          "monthlyPushQuota": {
            "type": [
              "integer",
              "null"
            ]
          },
          "monthlyMessagingCredits": {
            "type": "null"
          },
          "dataRetentionDays": {
            "type": "integer"
          },
          "paidMessagingEnabled": {
            "type": "boolean"
          },
          "telemetryPolicyVersion": {
            "type": "null"
          }
        },
        "required": [
          "key",
          "name",
          "maxApps",
          "maxMonthlyActiveUsers",
          "monthlyPushQuota",
          "monthlyMessagingCredits",
          "dataRetentionDays",
          "paidMessagingEnabled",
          "telemetryPolicyVersion"
        ],
        "additionalProperties": false
      },
      "AgentAccountLegacyApps": {
        "type": "object",
        "properties": {
          "status": {
            "type": "string"
          },
          "unit": {
            "type": "string"
          },
          "limit": {
            "type": "integer"
          },
          "used": {
            "type": [
              "integer",
              "null"
            ]
          },
          "remaining": {
            "type": "null"
          },
          "percentUsed": {
            "type": "null"
          },
          "authoritativeForQuota": {
            "const": false
          },
          "reason": {
            "type": "string"
          }
        },
        "required": [
          "status",
          "unit",
          "limit",
          "used",
          "remaining",
          "percentUsed",
          "authoritativeForQuota",
          "reason"
        ],
        "additionalProperties": false
      },
      "AgentAccountLegacyQuota": {
        "type": "object",
        "properties": {
          "apps": {
            "$ref": "#/components/schemas/AgentAccountLegacyApps"
          },
          "monthlyActiveUsers": {
            "$ref": "#/components/schemas/McpAccountV2LegacyScalar"
          },
          "push": {
            "$ref": "#/components/schemas/McpAccountV2LegacyScalar"
          },
          "messagingCredits": {
            "$ref": "#/components/schemas/McpAccountV2LegacyScalar"
          },
          "transport": {
            "type": "object",
            "additionalProperties": {
              "$ref": "#/components/schemas/McpAccountV2LegacyTransport"
            }
          },
          "observations": {
            "$ref": "#/components/schemas/McpAccountV2Observations"
          }
        },
        "required": [
          "apps",
          "monthlyActiveUsers",
          "push",
          "messagingCredits",
          "transport",
          "observations"
        ],
        "additionalProperties": false
      },
      "AgentAccountLegacy": {
        "type": "object",
        "properties": {
          "organizationId": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "captureComplete": {
            "type": "boolean"
          },
          "generatedAt": {
            "type": "string",
            "format": "date-time"
          },
          "plan": {
            "$ref": "#/components/schemas/AgentAccountLegacyPlan"
          },
          "contentTruncated": {
            "type": "boolean"
          },
          "allowancePeriod": {
            "anyOf": [
              {
                "type": [
                  "object",
                  "null"
                ],
                "properties": {
                  "startsAt": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "endsAt": {
                    "type": "string",
                    "format": "date-time"
                  }
                },
                "required": [
                  "startsAt",
                  "endsAt"
                ]
              },
              {
                "type": "null"
              }
            ]
          },
          "nextResetAt": {
            "type": [
              "string",
              "null"
            ],
            "format": "date-time"
          },
          "allowancePeriodStatus": {
            "type": "string"
          },
          "allowancePeriodReason": {
            "type": [
              "string",
              "null"
            ]
          },
          "creditPeriod": {
            "type": "null"
          },
          "subscriptionStatus": {
            "type": [
              "string",
              "null"
            ]
          },
          "quota": {
            "anyOf": [
              {
                "$ref": "#/components/schemas/AgentAccountLegacyQuota"
              },
              {
                "type": "null"
              }
            ]
          },
          "enforcementStatus": {
            "const": "not_evaluated"
          }
        },
        "required": [
          "organizationId",
          "status",
          "captureComplete",
          "generatedAt",
          "plan",
          "contentTruncated",
          "allowancePeriod",
          "nextResetAt",
          "allowancePeriodStatus",
          "allowancePeriodReason",
          "creditPeriod",
          "subscriptionStatus",
          "quota",
          "enforcementStatus"
        ],
        "additionalProperties": false,
        "description": "Default legacy JSON representation. Retained directory and usage observations are not authoritative allowance-period counters. The legacy projection has no pooled telemetry, operators, plan identitySource/allowanceBasis or contractVersion fields. It does not project tenant agreements. Monthly messaging credits and telemetryPolicyVersion are null; per-signal transport allowances are unconfigured. Missing allowance anchors remain unavailable."
      }
    },
    "securitySchemes": {
      "mcpBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Current explicitly consented MCP-audience CLI OAuth connection. Current organization membership, plan eligibility and role are required. SDK/server/upload keys and Dashboard cookies do not substitute for this token."
      }
    },
    "headers": {
      "ManagementProblemTraceId": {
        "description": "Opaque error correlation; matches the shared problem body's traceId.",
        "schema": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128,
          "pattern": "^[A-Za-z0-9_.:-]+$"
        }
      }
    }
  },
  "x-appportal-contract-coverage": "typed-existing-agent-account-http",
  "x-appportal-source": [
    "src/AppPortal.Api/Endpoints/McpAccountEndpoints.cs",
    "src/AppPortal.Api/Endpoints/McpAccountContract.cs",
    "src/AppPortal.Api/Endpoints/McpAccountV2Accept.cs",
    "src/AppPortal.Api/Endpoints/McpAccountV2Serializer.cs"
  ],
  "x-appportal-related-contract": {
    "door": "agent-telemetry",
    "description": "Existing overview, crash, log, build and release metadata reads retain their separate telemetry contract."
  },
  "x-appportal-reference-source": "8bda8e8302d4ea5bd005ef1132f7267e82e6337c"
}
