{
  "openapi": "3.1.0",
  "info": {
    "title": "BizGo.Pro external service API",
    "version": "1.0.0",
    "description": "Integration-only server-to-server API. Explicit scopes; no implicit future permissions. 60 requests/key/minute and 300/owner/minute. BizGo-billed work requires activation, consent, current approved retail version, bounded units, maximum charge and sufficient prepaid balance. Staged AI School direct inference instead uses an explicitly connected customer provider account with separate provider-charge consent, bounded requests/tokens and no BizGo wallet debit; a required dollar cap blocks it without trusted pricing. Polling never repeats provider execution."
  },
  "servers": [
    {
      "url": "/api"
    }
  ],
  "paths": {
    "/v1/school/subjects": {
      "get": {
        "operationId": "getExternalSchoolCatalog",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Limited practice availability and enforced limits, not advertised exam coverage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "additionalProperties": true
                }
              }
            }
          }
        },
        "x-bizgo-scope": "school:catalog"
      }
    },
    "/v1/school/runs": {
      "post": {
        "operationId": "startExternalSchoolPractice",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "name": "Idempotency-Key",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 8,
              "maxLength": 100
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "mode",
                  "confirmed"
                ],
                "properties": {
                  "mode": {
                    "type": "string",
                    "enum": [
                      "direct",
                      "self_submitted"
                    ]
                  },
                  "confirmed": {
                    "type": "boolean",
                    "const": true
                  },
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "description": "Owned connection required for direct mode"
                  },
                  "model": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Declared model required for self-submitted mode"
                  },
                  "providerChargesAccepted": {
                    "type": "boolean",
                    "description": "Must be true for direct mode"
                  },
                  "requireDollarCap": {
                    "type": "boolean",
                    "description": "Must be false for direct mode because trusted pricing is unavailable"
                  },
                  "maximumTokens": {
                    "type": "integer",
                    "minimum": 32,
                    "maximum": 256
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Durable accepted identity, never automatic inference resubmission",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status",
                    "mode",
                    "packVersion",
                    "questions"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string"
                    },
                    "packVersion": {
                      "type": "string"
                    },
                    "questions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "prompt",
                          "answer",
                          "correct"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "prompt": {
                            "type": "string"
                          },
                          "answer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "correct": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "school:practice"
      }
    },
    "/v1/school/runs/{id}": {
      "get": {
        "operationId": "getExternalSchoolReport",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Owner-only practice provenance and report, not certification",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "kind",
                    "mode",
                    "status",
                    "model",
                    "connectionName",
                    "packVersion",
                    "detail",
                    "questions",
                    "correctCount",
                    "maximumTokens",
                    "createdAt",
                    "deadline",
                    "updatedAt",
                    "nextStep"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "mode": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "model": {
                      "type": "string"
                    },
                    "connectionName": {
                      "type": "string"
                    },
                    "packVersion": {
                      "type": "string"
                    },
                    "detail": {
                      "type": "string"
                    },
                    "questions": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "prompt",
                          "answer",
                          "correct"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "prompt": {
                            "type": "string"
                          },
                          "answer": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "correct": {
                            "type": [
                              "boolean",
                              "null"
                            ]
                          }
                        }
                      }
                    },
                    "correctCount": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    },
                    "maximumTokens": {
                      "type": "integer"
                    },
                    "createdAt": {
                      "type": "string"
                    },
                    "deadline": {
                      "type": "string"
                    },
                    "updatedAt": {
                      "type": "string"
                    },
                    "nextStep": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "school:results"
      }
    },
    "/v1/school/runs/{id}/answers": {
      "post": {
        "operationId": "submitExternalSchoolAnswers",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "answers"
                ],
                "properties": {
                  "answers": {
                    "type": "array",
                    "minItems": 4,
                    "maxItems": 4,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "id",
                        "answer"
                      ],
                      "properties": {
                        "id": {
                          "type": "string",
                          "maxLength": 20
                        },
                        "answer": {
                          "type": "string",
                          "maxLength": 200
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved answer identity; result-read permission is separate",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "status"
                  ],
                  "properties": {
                    "id": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "school:practice"
      }
    },
    "/v1/school/runs/{id}/cancel": {
      "post": {
        "operationId": "cancelExternalSchoolRun",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Local cancellation does not reverse submitted provider usage",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "cancelled"
                  ],
                  "properties": {
                    "cancelled": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "school:cancel"
      }
    },
    "/v1/capabilities": {
      "get": {
        "operationId": "getExternalCapabilities",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Key permissions and conservative owner readiness",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "version",
                    "capabilities"
                  ],
                  "properties": {
                    "version": {
                      "type": "string",
                      "enum": [
                        "v1"
                      ]
                    },
                    "capabilities": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "title",
                          "domain",
                          "scope",
                          "method",
                          "path",
                          "availability",
                          "approval",
                          "unit",
                          "reason"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "title": {
                            "type": "string"
                          },
                          "domain": {
                            "type": "string"
                          },
                          "scope": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "method": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "path": {
                            "type": [
                              "string",
                              "null"
                            ]
                          },
                          "availability": {
                            "type": "string",
                            "enum": [
                              "implemented",
                              "blocked",
                              "staged",
                              "unsupported"
                            ]
                          },
                          "approval": {
                            "type": "string",
                            "enum": [
                              "read",
                              "configuration",
                              "paid",
                              "unavailable"
                            ]
                          },
                          "unit": {
                            "type": "string"
                          },
                          "reason": {
                            "type": "string"
                          },
                          "authorized": {
                            "type": "boolean"
                          },
                          "enabledForOwner": {
                            "type": "boolean"
                          },
                          "state": {
                            "type": "string",
                            "enum": [
                              "implemented",
                              "enabled",
                              "blocked",
                              "staged",
                              "unsupported"
                            ]
                          },
                          "blockers": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "capabilities:read"
      }
    },
    "/v1/receptionist": {
      "get": {
        "operationId": "getExternalReceptionist",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Safe owner configuration",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "minProperties": 1,
                      "properties": {
                        "greeting": {
                          "type": "string",
                          "maxLength": 1000
                        },
                        "humanFallback": {
                          "type": "string",
                          "maxLength": 1000
                        },
                        "afterHours": {
                          "type": "string",
                          "maxLength": 1000
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "greeting",
                        "humanFallback",
                        "afterHours",
                        "enabled"
                      ],
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "receptionist:read"
      },
      "patch": {
        "operationId": "configureExternalReceptionist",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "minProperties": 1,
                "properties": {
                  "greeting": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "humanFallback": {
                    "type": "string",
                    "maxLength": 1000
                  },
                  "afterHours": {
                    "type": "string",
                    "maxLength": 1000
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Saved without activation",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "minProperties": 1,
                      "properties": {
                        "greeting": {
                          "type": "string",
                          "maxLength": 1000
                        },
                        "humanFallback": {
                          "type": "string",
                          "maxLength": 1000
                        },
                        "afterHours": {
                          "type": "string",
                          "maxLength": 1000
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "greeting",
                        "humanFallback",
                        "afterHours",
                        "enabled"
                      ],
                      "properties": {
                        "enabled": {
                          "type": "boolean"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "receptionist:write"
      }
    },
    "/v1/knowledge": {
      "get": {
        "operationId": "getExternalKnowledge",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Facts and freshness; excludes private raw website snapshots",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "facts",
                    "pages"
                  ],
                  "properties": {
                    "facts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "category",
                          "question",
                          "answer",
                          "enabled"
                        ],
                        "properties": {
                          "category": {
                            "type": "string",
                            "enum": [
                              "services",
                              "hours",
                              "pricing",
                              "location",
                              "policies",
                              "faq"
                            ]
                          },
                          "question": {
                            "type": "string",
                            "maxLength": 300
                          },
                          "answer": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "pages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "fetchedAt",
                          "included",
                          "expired"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "fetchedAt": {
                            "type": "string"
                          },
                          "included": {
                            "type": "boolean"
                          },
                          "expired": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "knowledge:read"
      },
      "patch": {
        "operationId": "configureExternalKnowledge",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "facts"
                ],
                "properties": {
                  "facts": {
                    "type": "array",
                    "maxItems": 50,
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "category",
                        "question",
                        "answer",
                        "enabled"
                      ],
                      "properties": {
                        "category": {
                          "type": "string",
                          "enum": [
                            "services",
                            "hours",
                            "pricing",
                            "location",
                            "policies",
                            "faq"
                          ]
                        },
                        "question": {
                          "type": "string",
                          "maxLength": 300
                        },
                        "answer": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 2000
                        },
                        "enabled": {
                          "type": "boolean"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Owner facts replaced explicitly; no network fetch",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "facts",
                    "pages"
                  ],
                  "properties": {
                    "facts": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "additionalProperties": false,
                        "required": [
                          "category",
                          "question",
                          "answer",
                          "enabled"
                        ],
                        "properties": {
                          "category": {
                            "type": "string",
                            "enum": [
                              "services",
                              "hours",
                              "pricing",
                              "location",
                              "policies",
                              "faq"
                            ]
                          },
                          "question": {
                            "type": "string",
                            "maxLength": 300
                          },
                          "answer": {
                            "type": "string",
                            "minLength": 1,
                            "maxLength": 2000
                          },
                          "enabled": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "pages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "fetchedAt",
                          "included",
                          "expired"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "fetchedAt": {
                            "type": "string"
                          },
                          "included": {
                            "type": "boolean"
                          },
                          "expired": {
                            "type": "boolean"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "knowledge:write"
      }
    },
    "/v1/inbox/{id}/status": {
      "patch": {
        "operationId": "setExternalInboxStatus",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "status"
                ],
                "properties": {
                  "status": {
                    "type": "string",
                    "enum": [
                      "unread",
                      "read",
                      "resolved"
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Status saved, no reply sent",
            "content": {
              "application/json": {
                "schema": {
                  "allOf": [
                    {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "status"
                      ],
                      "properties": {
                        "status": {
                          "type": "string",
                          "enum": [
                            "unread",
                            "read",
                            "resolved"
                          ]
                        }
                      }
                    },
                    {
                      "type": "object",
                      "required": [
                        "id"
                      ],
                      "properties": {
                        "id": {
                          "type": "integer"
                        }
                      }
                    }
                  ]
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "inbox:write"
      }
    },
    "/v1/numbers": {
      "get": {
        "operationId": "getExternalNumbers",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "description": "Page size, defaults to 50. No repeated, nested or unknown query parameters.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Opaque owner-and-collection-bound X-Next-Cursor from the prior response. Descending timestamp then ID; createdAt for numbers/usage, startedAt for communications, expiresAt for media. Never grants scopes.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "At most 50 assigned numbers",
            "headers": {
              "X-Next-Cursor": {
                "description": "Present only when another page exists. Pass unchanged and URL-encoded as cursor to the same collection using an authorized key for the same owner. Arrays remain unchanged. Not a snapshot; deleted/expired media is excluded on every page. Newer inserts require restarting. Session-secret rotation invalidates cursors. Invalid cursors return 400 INVALID_CURSOR; malformed query parameters return 400 INVALID_INPUT.",
                "schema": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024,
                  "pattern": "^[A-Za-z0-9_-]+$"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "phoneNumber",
                      "active",
                      "capabilities"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "phoneNumber": {
                        "type": "string"
                      },
                      "active": {
                        "type": "boolean"
                      },
                      "capabilities": {
                        "type": "array",
                        "items": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "numbers:read"
      }
    },
    "/v1/communications": {
      "get": {
        "operationId": "getExternalCommunications",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "description": "Page size, defaults to 50. No repeated, nested or unknown query parameters.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Opaque owner-and-collection-bound X-Next-Cursor from the prior response. Descending timestamp then ID; createdAt for numbers/usage, startedAt for communications, expiresAt for media. Never grants scopes.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "At most 50 latest private communication summaries",
            "headers": {
              "X-Next-Cursor": {
                "description": "Present only when another page exists. Pass unchanged and URL-encoded as cursor to the same collection using an authorized key for the same owner. Arrays remain unchanged. Not a snapshot; deleted/expired media is excluded on every page. Newer inserts require restarting. Session-secret rotation invalidates cursors. Invalid cursors return 400 INVALID_CURSOR; malformed query parameters return 400 INVALID_INPUT.",
                "schema": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024,
                  "pattern": "^[A-Za-z0-9_-]+$"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "numberId",
                      "kind",
                      "direction",
                      "state",
                      "startedAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "numberId": {
                        "type": "string"
                      },
                      "kind": {
                        "type": "string"
                      },
                      "direction": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      },
                      "startedAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "communications:read"
      }
    },
    "/v1/media": {
      "get": {
        "operationId": "getExternalMedia",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "description": "Page size, defaults to 50. No repeated, nested or unknown query parameters.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Opaque owner-and-collection-bound X-Next-Cursor from the prior response. Descending timestamp then ID; createdAt for numbers/usage, startedAt for communications, expiresAt for media. Never grants scopes.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "At most 50 unexpired private metadata records; no download URLs",
            "headers": {
              "X-Next-Cursor": {
                "description": "Present only when another page exists. Pass unchanged and URL-encoded as cursor to the same collection using an authorized key for the same owner. Arrays remain unchanged. Not a snapshot; deleted/expired media is excluded on every page. Newer inserts require restarting. Session-secret rotation invalidates cursors. Invalid cursors return 400 INVALID_CURSOR; malformed query parameters return 400 INVALID_INPUT.",
                "schema": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024,
                  "pattern": "^[A-Za-z0-9_-]+$"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "contentType",
                      "size",
                      "expiresAt"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "contentType": {
                        "type": "string"
                      },
                      "size": {
                        "type": "integer"
                      },
                      "expiresAt": {
                        "type": "string",
                        "format": "date-time"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "media:read"
      }
    },
    "/v1/voices": {
      "get": {
        "operationId": "getExternalVoices",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Existing voice library availability, not paid activation",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "voices",
                    "blockers"
                  ],
                  "properties": {
                    "voices": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "name",
                          "provider",
                          "available"
                        ],
                        "properties": {
                          "id": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "provider": {
                            "type": "string"
                          },
                          "available": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "blockers": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "voices:read"
      }
    },
    "/v1/wallet": {
      "get": {
        "operationId": "getExternalWallet",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Private USD nanos as decimal strings",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "currency",
                    "balanceNano",
                    "reservedNano",
                    "availableNano",
                    "frozen"
                  ],
                  "properties": {
                    "currency": {
                      "type": "string",
                      "enum": [
                        "USD"
                      ]
                    },
                    "balanceNano": {
                      "type": "string"
                    },
                    "reservedNano": {
                      "type": "string"
                    },
                    "availableNano": {
                      "type": "string"
                    },
                    "frozen": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "wallet:read"
      }
    },
    "/v1/prices": {
      "get": {
        "operationId": "getExternalPrices",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "description": "Current verified versions for supported AI/SMS adapters only. Visibility never activates a provider or authorizes spending. Withdrawn, future and stale rates are omitted.",
        "responses": {
          "200": {
            "description": "Transient approved retail versions, excluding wholesale costs and evidence",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "rateId",
                      "serviceId",
                      "currency",
                      "retailNano",
                      "unit",
                      "maximumUnits",
                      "verifiedAt",
                      "validUntil"
                    ],
                    "properties": {
                      "provisional": {
                        "type": "boolean",
                        "description": "Owner-approved expected rate; verifiedAt records approval time, not exact supplier verification"
                      },
                      "rateId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "serviceId": {
                        "type": "string",
                        "enum": [
                          "telnyx-sms",
                          "openai-input",
                          "openai-output"
                        ]
                      },
                      "currency": {
                        "type": "string",
                        "enum": [
                          "USD"
                        ]
                      },
                      "retailNano": {
                        "type": "string",
                        "pattern": "^[0-9]+$"
                      },
                      "unit": {
                        "type": "string"
                      },
                      "maximumUnits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 40000
                      },
                      "verifiedAt": {
                        "type": "string",
                        "format": "date-time"
                      },
                      "validUntil": {
                        "type": "string",
                        "format": "date-time",
                        "description": "Refresh this offer after this time; billing still requires the latest approved version, independent of supplier-evidence age"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "prices:read"
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "getExternalUsage",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "description": "Page size, defaults to 50. No repeated, nested or unknown query parameters.",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 50
            }
          },
          {
            "in": "query",
            "name": "cursor",
            "description": "Opaque owner-and-collection-bound X-Next-Cursor from the prior response. Descending timestamp then ID; createdAt for numbers/usage, startedAt for communications, expiresAt for media. Never grants scopes.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1024,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "At most 50 latest usage records, no provider evidence or private payloads",
            "headers": {
              "X-Next-Cursor": {
                "description": "Present only when another page exists. Pass unchanged and URL-encoded as cursor to the same collection using an authorized key for the same owner. Arrays remain unchanged. Not a snapshot; deleted/expired media is excluded on every page. Newer inserts require restarting. Session-secret rotation invalidates cursors. Invalid cursors return 400 INVALID_CURSOR; malformed query parameters return 400 INVALID_INPUT.",
                "schema": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 1024,
                  "pattern": "^[A-Za-z0-9_-]+$"
                }
              }
            },
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "required": [
                      "id",
                      "serviceId",
                      "rateId",
                      "state",
                      "reservedNano",
                      "chargedNano"
                    ],
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "serviceId": {
                        "type": "string"
                      },
                      "rateId": {
                        "type": "string"
                      },
                      "state": {
                        "type": "string"
                      },
                      "reservedNano": {
                        "type": "string"
                      },
                      "chargedNano": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "usage:read"
      }
    },
    "/v1/operations/{id}": {
      "get": {
        "operationId": "getExternalOperation",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Local operation status only; never retries a provider request",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "kind",
                    "state",
                    "detail",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "accepted",
                        "completed",
                        "delivered",
                        "failed",
                        "uncertain",
                        "requested",
                        "rejected",
                        "expired",
                        "verified"
                      ]
                    },
                    "detail": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "answer": {
                      "type": "string"
                    },
                    "actionRequired": {
                      "type": "boolean"
                    },
                    "disclosure": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "operations:read"
      }
    },
    "/v1/ai/answers": {
      "post": {
        "operationId": "requestExternalAnswer",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 100,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "question",
                  "confirmed",
                  "disclosureAccepted",
                  "maximumChargeNano",
                  "inputPrice",
                  "outputPrice"
                ],
                "properties": {
                  "question": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 2000
                  },
                  "confirmed": {
                    "type": "boolean",
                    "const": true
                  },
                  "disclosureAccepted": {
                    "type": "boolean",
                    "const": true
                  },
                  "maximumChargeNano": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{0,17}$"
                  },
                  "inputPrice": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "rateId",
                      "maximumUnits"
                    ],
                    "properties": {
                      "rateId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "maximumUnits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 40000
                      }
                    }
                  },
                  "outputPrice": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "rateId",
                      "maximumUnits"
                    ],
                    "properties": {
                      "rateId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "maximumUnits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 40000
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Operation claimed once; poll its ID without repeating paid execution",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "kind",
                    "state",
                    "detail",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "accepted",
                        "completed",
                        "delivered",
                        "failed",
                        "uncertain",
                        "requested",
                        "rejected",
                        "expired",
                        "verified"
                      ]
                    },
                    "detail": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "answer": {
                      "type": "string"
                    },
                    "actionRequired": {
                      "type": "boolean"
                    },
                    "disclosure": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "ai:answer"
      }
    },
    "/v1/communications/sms": {
      "post": {
        "operationId": "requestExternalSms",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "in": "header",
            "name": "Idempotency-Key",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 16,
              "maxLength": 100,
              "pattern": "^[A-Za-z0-9_-]+$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "numberId",
                  "destination",
                  "text",
                  "confirmed",
                  "consent",
                  "maximumChargeNano",
                  "price"
                ],
                "properties": {
                  "numberId": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "destination": {
                    "type": "string",
                    "pattern": "^\\+[1-9][0-9]{7,14}$"
                  },
                  "text": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 70,
                    "description": "Conservative single-part bound in UTF-16 code units"
                  },
                  "confirmed": {
                    "type": "boolean",
                    "const": true
                  },
                  "consent": {
                    "type": "boolean",
                    "const": true
                  },
                  "maximumChargeNano": {
                    "type": "string",
                    "pattern": "^[1-9][0-9]{0,17}$"
                  },
                  "price": {
                    "type": "object",
                    "additionalProperties": false,
                    "required": [
                      "rateId",
                      "maximumUnits"
                    ],
                    "properties": {
                      "rateId": {
                        "type": "string",
                        "format": "uuid"
                      },
                      "maximumUnits": {
                        "type": "integer",
                        "minimum": 1,
                        "maximum": 40000
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "202": {
            "description": "Single-part SMS claimed once; acceptance is not delivery",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "kind",
                    "state",
                    "detail",
                    "createdAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "state": {
                      "type": "string",
                      "enum": [
                        "pending",
                        "accepted",
                        "completed",
                        "delivered",
                        "failed",
                        "uncertain",
                        "requested",
                        "rejected",
                        "expired",
                        "verified"
                      ]
                    },
                    "detail": {
                      "type": "string"
                    },
                    "createdAt": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "answer": {
                      "type": "string"
                    },
                    "actionRequired": {
                      "type": "boolean"
                    },
                    "disclosure": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "Stable code; 400 invalid input, 401 invalid/revoked/expired key, 402 insufficient balance, 403 scope/browser denial, 404 missing owned resource, 409 blocked/conflict, 429 rate limit, 503 unavailable. No provider retry implied.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "sms:send"
      }
    },
    "/v1/connection": {
      "get": {
        "operationId": "getExternalConnection",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "No charge, no provider calls, no private content",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "ok",
                    "version",
                    "source"
                  ],
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "version": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "dashboard_check",
                        "server_request"
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "400 INVALID_INPUT, 401 INVALID_KEY/EXPIRED_KEY/REVOKED_KEY, 403 INSUFFICIENT_SCOPE/BROWSER_NOT_ALLOWED, 404 NOT_FOUND, 429 RATE_LIMITED (Retry-After), 503 SERVICE_UNAVAILABLE. Error messages never include supplied keys.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "connection:read"
      }
    },
    "/v1/profile": {
      "get": {
        "operationId": "getExternalProfile",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Minimal public business details",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "businessName",
                    "industry",
                    "website",
                    "serviceArea",
                    "timezone"
                  ],
                  "properties": {
                    "businessName": {
                      "type": "string"
                    },
                    "industry": {
                      "type": "string"
                    },
                    "website": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "serviceArea": {
                      "type": "string"
                    },
                    "timezone": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "400 INVALID_INPUT, 401 INVALID_KEY/EXPIRED_KEY/REVOKED_KEY, 403 INSUFFICIENT_SCOPE/BROWSER_NOT_ALLOWED, 404 NOT_FOUND, 429 RATE_LIMITED (Retry-After), 503 SERVICE_UNAVAILABLE. Error messages never include supplied keys.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "profile:read"
      }
    },
    "/v1/inbox": {
      "get": {
        "operationId": "getExternalInbox",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 50,
              "default": 20
            }
          },
          {
            "in": "query",
            "name": "before",
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "in": "query",
            "name": "kind",
            "schema": {
              "type": "string",
              "enum": [
                "call",
                "sms",
                "voicemail",
                "email"
              ]
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string",
              "enum": [
                "unread",
                "read",
                "resolved"
              ]
            }
          },
          {
            "in": "query",
            "name": "demo",
            "schema": {
              "type": "string",
              "enum": [
                "true",
                "false"
              ]
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Private inbox, newest IDs first; nextBefore is null at end",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "items",
                    "nextBefore"
                  ],
                  "properties": {
                    "items": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "required": [
                          "id",
                          "kind",
                          "status",
                          "summary",
                          "demo",
                          "occurredAt"
                        ],
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "kind": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "summary": {
                            "type": "string"
                          },
                          "demo": {
                            "type": "boolean"
                          },
                          "occurredAt": {
                            "type": "string"
                          },
                          "content": {
                            "type": "string"
                          },
                          "truncated": {
                            "type": "boolean"
                          }
                        }
                      }
                    },
                    "nextBefore": {
                      "type": [
                        "integer",
                        "null"
                      ]
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "400 INVALID_INPUT, 401 INVALID_KEY/EXPIRED_KEY/REVOKED_KEY, 403 INSUFFICIENT_SCOPE/BROWSER_NOT_ALLOWED, 404 NOT_FOUND, 429 RATE_LIMITED (Retry-After), 503 SERVICE_UNAVAILABLE. Error messages never include supplied keys.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "inbox:list"
      }
    },
    "/v1/inbox/{id}": {
      "get": {
        "operationId": "getExternalInboxDetail",
        "security": [
          {
            "WebsiteBearer": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Private message, with truthful demo label",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "id",
                    "kind",
                    "status",
                    "summary",
                    "demo",
                    "occurredAt"
                  ],
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "kind": {
                      "type": "string"
                    },
                    "status": {
                      "type": "string"
                    },
                    "summary": {
                      "type": "string"
                    },
                    "demo": {
                      "type": "boolean"
                    },
                    "occurredAt": {
                      "type": "string"
                    },
                    "content": {
                      "type": "string"
                    },
                    "truncated": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "default": {
            "description": "400 INVALID_INPUT, 401 INVALID_KEY/EXPIRED_KEY/REVOKED_KEY, 403 INSUFFICIENT_SCOPE/BROWSER_NOT_ALLOWED, 404 NOT_FOUND, 429 RATE_LIMITED (Retry-After), 503 SERVICE_UNAVAILABLE. Error messages never include supplied keys.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "error"
                  ],
                  "properties": {
                    "error": {
                      "type": "object",
                      "required": [
                        "code",
                        "message"
                      ],
                      "properties": {
                        "code": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "x-bizgo-scope": "inbox:detail"
      }
    }
  },
  "components": {
    "securitySchemes": {
      "WebsiteBearer": {
        "type": "http",
        "scheme": "bearer",
        "bearerFormat": "BizGo customer key"
      }
    }
  }
}