{
  "openapi": "3.1.0",
  "info": {
    "title": "Telegram Ads owned connections and hosted reads",
    "version": "0.1.0"
  },
  "paths": {
    "/internal/ads/readiness": {
      "get": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdsCapacity"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdsCapacity"
                }
              }
            }
          }
        },
        "operationId": "getInternalAdsReadiness"
      }
    },
    "/v1/connections/{id}/accounts": {
      "get": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdsAccountDiscovery"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getV1ConnectionsIdAccounts"
      }
    },
    "/v1/ai-choice": {
      "get": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiChoice"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "The owner's last choice of AI clients and rights, remembered for 30 minutes by an approval with rememberChoice: client names only, never MCP connection ids. Clients revoked since are left out; null when none is left or the choice expired.",
        "operationId": "getV1AiChoice"
      }
    },
    "/v1/ai-choice/intents": {
      "post": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "responses": {
          "201": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiChoiceIntentResult"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiChoiceIntentRequest"
              }
            }
          }
        },
        "description": "One-click: stages the last choice as the grant intent of flowId for the root and all linked accounts (accounts \"all\"); the next connection save with that flowId applies it and answers aiAccess. The intent lives 15 minutes (expiresAt). Without a live choice 409 CHOICE_EXPIRED and nothing is staged. Rate limit: 30 requests per minute per owner, then 429 RATE_LIMITED.",
        "operationId": "postV1AiChoiceIntents"
      }
    },
    "/v1/connections/{id}/ai-grants/retry": {
      "post": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiGrantRetryResult"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiGrantRetryRequest"
              }
            }
          }
        },
        "description": "Grants again the AI clients refs (1-20 unique target indexes) of the newest applied, unexpired grant intent of this connection (with the optional flowId: of that flow's intent), with the same accounts and rights. Rate limit: 30 requests per minute per owner, then 429 RATE_LIMITED. 404 CONNECTION_NOT_FOUND for another owner's or an unknown connection, 409 CHOICE_EXPIRED without such an intent (15 minutes from staging), 400 for refs outside its targets.",
        "operationId": "postV1ConnectionsIdAiGrantsRetry"
      }
    },
    "/internal/users/{ownerId}/connections/{id}/ai-grants/retry": {
      "post": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AiGrantRetryResult"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiGrantRetryRequest"
              }
            }
          }
        },
        "description": "Site twin of POST /v1/connections/{id}/ai-grants/retry for the owner's connection.",
        "operationId": "postInternalUsersOwnerIdConnectionsIdAiGrantsRetry"
      }
    },
    "/internal/users/{ownerId}/connections/{id}/accounts": {
      "get": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 100
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdsAccountDiscovery"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getInternalUsersOwnerIdConnectionsIdAccounts"
      }
    },
    "/v1/uploads/{id}": {
      "put": {
        "security": [
          {
            "uploadBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Single-use streamed binary upload, bound to grant/account/generation/purpose/size/SHA256. No GET. 15-minute reservation; maximum20MiB; JPEG/PNG/MP4 signatures validated.",
        "requestBody": {
          "required": true,
          "content": {
            "image/png": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 20971520
              }
            },
            "image/jpeg": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 20971520
              }
            },
            "video/mp4": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 20971520
              }
            },
            "application/octet-stream": {
              "schema": {
                "type": "string",
                "format": "binary",
                "maxLength": 20971520
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdsUploadReady"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "putV1UploadsId"
      }
    },
    "/v1/auth/requests": {
      "post": {
        "security": [],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthRequestResult"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthRequest"
              }
            }
          }
        },
        "operationId": "postV1AuthRequests"
      }
    },
    "/v1/auth/token": {
      "post": {
        "security": [],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtensionToken"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthToken"
              }
            }
          }
        },
        "operationId": "postV1AuthToken"
      }
    },
    "/v1/auth/session": {
      "get": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExtensionSession"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getV1AuthSession"
      }
    },
    "/v1/auth/logout": {
      "post": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "responses": {
          "204": {
            "description": "Device session revoked; connections remain"
          }
        },
        "operationId": "postV1AuthLogout"
      }
    },
    "/v1/mcp-grants/page": {
      "get": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicMcpGrantPage"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getV1McpGrantsPage"
      }
    },
    "/internal/users/{ownerId}/mcp-grants/page": {
      "get": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "default": 0
            }
          },
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpGrantPage"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getInternalUsersOwnerIdMcpGrantsPage"
      }
    },
    "/v1/mcp-grants": {
      "get": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicMcpGrantList"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Legacy array, bounded to 4MiB. Use /v1/mcp-grants/page for large lists.",
        "operationId": "getV1McpGrants"
      }
    },
    "/internal/auth/requests/{id}": {
      "get": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthContext"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getInternalAuthRequestsId"
      }
    },
    "/internal/auth/requests/{id}/approve": {
      "post": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AuthApprovalResult"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AuthApproval"
              }
            }
          }
        },
        "description": "Approves the extension auth request. Optional mcpTargets (1-20 MCP connections that should get ads) require defaultPermissions and a request with a flowId; the grant intent is stored for 15 minutes and applied once when the extension creates or updates a connection with that flowId (the save response then carries aiAccess). Optional accounts (requires mcpTargets): \"all\" grants the root and every linked account the provider lists; a list (up to 100 unique ids) grants the root and those linked accounts after a provider check; absent grants the root only. Optional rememberChoice: true (requires mcpTargets) also remembers mcpTargets and defaultPermissions as the owner's last choice for 30 minutes, replacing an earlier one (see /v1/ai-choice).",
        "operationId": "postInternalAuthRequestsIdApprove"
      }
    },
    "/internal/users/{ownerId}/connections": {
      "get": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionList"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getInternalUsersOwnerIdConnections"
      },
      "post": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "201": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionView"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConnection"
              }
            }
          }
        },
        "operationId": "postInternalUsersOwnerIdConnections"
      }
    },
    "/internal/users/{ownerId}/connections/by-token": {
      "post": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectByTokenResult"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ConnectByToken"
              }
            }
          }
        },
        "description": "Connects an API token pasted on the Telemetrio site. The account is identified by the token; the owner's official connection of the same account is replaced (replaced: true). A rejected token returns 401 SESSION_EXPIRED. Optional mcpTargets (1-20, requires flowId) and accounts (\"all\", requires mcpTargets) are staged as the grant intent of flowId after the key is saved and applied at once; the response then carries aiAccess (per AI client: ref, clientName, granted; linkedAccounts, null when linked accounts could not be listed).",
        "operationId": "postInternalUsersOwnerIdConnectionsByToken"
      }
    },
    "/internal/users/{ownerId}/connections/{id}": {
      "get": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionView"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "getInternalUsersOwnerIdConnectionsId"
      },
      "delete": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionView"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisconnectConnection"
              }
            }
          }
        },
        "operationId": "deleteInternalUsersOwnerIdConnectionsId"
      }
    },
    "/internal/users/{ownerId}/connections/{id}/credentials": {
      "put": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionView"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceCredentials"
              }
            }
          }
        },
        "operationId": "putInternalUsersOwnerIdConnectionsIdCredentials"
      }
    },
    "/internal/users/{ownerId}/connections/{id}/ai-access": {
      "put": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionView"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AiAccess"
              }
            }
          }
        },
        "description": "Pauses or resumes AI access to one Ads connection. The key, version and status are not changed; the extension keeps working. 404 for another owner's connection, 410 when disconnected.",
        "operationId": "putInternalUsersOwnerIdConnectionsIdAiAccess"
      }
    },
    "/internal/users/{ownerId}/connections/{id}/check": {
      "post": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionView"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "postInternalUsersOwnerIdConnectionsIdCheck"
      }
    },
    "/internal/mcp/grants": {
      "post": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "responses": {
          "201": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpGrantCredential"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpGrantRequest"
              }
            }
          }
        },
        "description": "Creates the AI grant of one MCP connection. A connection has at most one live grant; another one returns 409 GRANT_EXISTS.",
        "operationId": "postInternalMcpGrants"
      }
    },
    "/internal/users/{ownerId}/mcp-grants/copy": {
      "post": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpGrantCopyResult"
                }
              }
            }
          },
          "201": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpGrantCopyResult"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpGrantCopyRequest"
              }
            }
          }
        },
        "description": "Gives a reconnected MCP connection (toMcpConnectionId) the first live grant of the owner among fromMcpConnectionIds, in order, as a consent grant with the request's clientId and clientName. Rows of disconnected, migration-required or missing Ads connections are dropped, expired ones stay. 201 with the new grant; 200 with grant null when no predecessor has a live grant or no row is left. The predecessor's grant is not changed and a paused Ads connection stays paused. 409 GRANT_EXISTS when the target already has a live grant; 429 BUSY at the owner's 100 live grants. MCP connection ids are never logged.",
        "operationId": "postInternalUsersOwnerIdMcpGrantsCopy"
      }
    },
    "/internal/users/{ownerId}/mcp-grants": {
      "get": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpGrantList"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Legacy array, bounded to 4MiB. Use the additive /page route for large lists.",
        "operationId": "getInternalUsersOwnerIdMcpGrants"
      }
    },
    "/internal/users/{ownerId}/mcp-grants/{id}/accounts": {
      "put": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpGrantView"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpGrantAccountsRequest"
              }
            }
          }
        },
        "description": "Adds or replaces account rows of a live grant. Rows of other accounts stay unchanged; the grant's connections become the union.",
        "operationId": "putInternalUsersOwnerIdMcpGrantsIdAccounts"
      }
    },
    "/internal/users/{ownerId}/mcp-grants/{id}": {
      "delete": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "204": {
            "description": "Selected owned AI grant revoked"
          },
          "404": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteInternalUsersOwnerIdMcpGrantsId"
      }
    },
    "/internal/users/{ownerId}/mcp-connections/{mcpConnectionId}/ads-access/{connectionId}": {
      "put": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "mcpConnectionId",
            "in": "path",
            "required": true,
            "description": "MCP connection of the user. Never logged or returned to clients.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpConnectionAccessResult"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/McpConnectionAccessRequest"
              }
            }
          }
        },
        "description": "Sets the rights of one MCP connection on one current Ads connection. Without accountId every granted row of that connection gets the permissions (the root account is added when it has none); with accountId only that account's row changes or is added. A related account not yet in the grant is verified with the provider first: 403 ACCOUNT_MISMATCH when the provider does not list it, and a provider error passes through with its own status (401 SESSION_EXPIRED, 429, 5xx); the grant stays unchanged. Without a live grant a site grant is created; clientName is then required (400) and the owner's 100 live grants limit applies (429 BUSY). 404 CONNECTION_NOT_FOUND, 410 CONNECTION_DISCONNECTED, 401 SESSION_EXPIRED, 409 MIGRATION_REQUIRED for the Ads connection.",
        "operationId": "putInternalUsersOwnerIdMcpConnectionsMcpConnectionIdAdsAccessConnectionId"
      },
      "delete": {
        "security": [
          {
            "serviceKey": []
          }
        ],
        "parameters": [
          {
            "name": "ownerId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "mcpConnectionId",
            "in": "path",
            "required": true,
            "description": "MCP connection of the user. Never logged or returned to clients.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "connectionId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          }
        ],
        "description": "Removes the rows of one Ads connection (or only accountId's row) from the MCP connection's live grant, in any connection state. A grant left without rows is revoked and grant is null. Idempotent: no grant or no such row changes nothing and returns the current grant or null; never 404.",
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/McpConnectionAccessRemoval"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "deleteInternalUsersOwnerIdMcpConnectionsMcpConnectionIdAdsAccessConnectionId"
      }
    },
    "/internal/mcp/rpc": {
      "post": {
        "security": [
          {
            "mcpServiceKey": []
          }
        ],
        "parameters": [
          {
            "name": "X-Telemetrio-User-Id",
            "in": "header",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,128}$"
            }
          },
          {
            "name": "X-Telemetrio-MCP-Connection",
            "in": "header",
            "required": true,
            "description": "MCP connection of the user; selects the grant bound to it. Never logged or returned.",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          }
        ],
        "description": "Stateless Streamable HTTP MCP for the Telemetrio MCP server. Accepted only on a configured internal Service Host, never on the public host. Without a live grant for the user and MCP connection only ads_connection_status is listed. With a grant: ads_connection_status, 45 canonical ads_api_* tools, nine retained convenience reads, ads_prepare_file_upload and ads_get_operation. Exact selected account rights; mutations require stable operationId. Ads JSON request limit2MiB; response limit32MiB. Internal grant creation and account updates allow4MiB metadata.",
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response"
          },
          "202": {
            "description": "MCP notification accepted"
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "operationId": "postInternalMcpRpc"
      }
    },
    "/health": {
      "get": {
        "security": [],
        "responses": {
          "200": {
            "description": "Process liveness"
          }
        }
      }
    },
    "/v1/connections": {
      "get": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "x-required-scopes": ["connections:read"],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionList"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "post": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "x-required-scopes": ["connections:write"],
        "responses": {
          "201": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionSaveResult"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/CreateConnection"
              }
            }
          }
        },
        "description": "Saves a new connection. With the flowId of a staged grant intent the intent is applied once and the response carries aiAccess (per AI client: ref, clientName, granted; linkedAccounts)."
      }
    },
    "/v1/connections/{id}": {
      "get": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "x-required-scopes": ["connections:read"],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionView"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      },
      "delete": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "x-required-scopes": ["connections:write"],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionView"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DisconnectConnection"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/connections/{id}/credentials": {
      "put": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "x-required-scopes": ["connections:write"],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionSaveResult"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ReplaceCredentials"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Replaces the API token. With the flowId of a staged grant intent the intent is applied once and the response carries aiAccess."
      }
    },
    "/v1/connections/{id}/check": {
      "post": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "x-required-scopes": ["connections:read"],
        "responses": {
          "200": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ConnectionView"
                }
              }
            }
          },
          "400": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "410": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Validated response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ]
      }
    },
    "/v1/connections/{id}/api/accounts": {
      "get": {
        "operationId": "listAccounts",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "responses": {
          "200": {
            "description": "Accessible accounts",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "$ref": "#/components/schemas/Account"
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/ads": {
      "get": {
        "operationId": "listAds",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ads page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdsPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/ads/{adId}": {
      "get": {
        "operationId": "getAd",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "adId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ad details",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdDetails"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/budget": {
      "get": {
        "operationId": "getBudget",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account budget and transactions",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Budget"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/targets": {
      "get": {
        "operationId": "searchTarget",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "enum": ["channel", "bot", "query"]
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 200
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Resolved target",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TargetResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/similar-channels": {
      "get": {
        "operationId": "getSimilarChannels",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "description": "Recommendations for 1–9 distinct selected channel IDs. An empty result does not verify seed validity.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "channelIds",
            "in": "query",
            "required": true,
            "description": "1–9 distinct opaque IDs separated by semicolons; each ID is at most 256 characters.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2312,
              "pattern": "^[A-Za-z0-9_-]{1,256}(;[A-Za-z0-9_-]{1,256}){0,8}$"
            }
          },
          {
            "name": "for",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["channels", "exclude_channels"],
              "default": "channels"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Similar channel candidates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimilarTargets"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/similar-bots": {
      "get": {
        "operationId": "getSimilarBots",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "description": "Recommendations for 1–9 distinct selected bot IDs. An empty result does not verify seed validity.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "botIds",
            "in": "query",
            "required": true,
            "description": "1–9 distinct opaque IDs separated by semicolons; each ID is at most 256 characters.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 2312,
              "pattern": "^[A-Za-z0-9_-]{1,256}(;[A-Za-z0-9_-]{1,256}){0,8}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Similar bot candidates",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/SimilarTargets"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/locations": {
      "get": {
        "operationId": "searchLocations",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "description": "One page of location candidates for a country and one query character. Official opaque pagination uses cursor/nextCursor; numeric offsets remain supported. Region is a display label, not a parent ID; coordinates are not supplied.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "maxLength": 1024
            },
            "description": "Opaque nextCursor from the previous official-provider page; omit numeric offset when using cursor."
          },
          {
            "name": "country",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            }
          },
          {
            "name": "query",
            "in": "query",
            "required": true,
            "description": "Exactly one non-whitespace Unicode character; # is allowed.",
            "schema": {
              "type": "string",
              "minLength": 1,
              "maxLength": 1,
              "pattern": "^\\S$"
            }
          },
          {
            "name": "offset",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Location candidate page",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/LocationPage"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/targeting-options": {
      "get": {
        "operationId": "getTargetingOptions",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Available targeting options and limits",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/TargetingOptions"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/stats": {
      "get": {
        "operationId": "getAccountStats",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["day", "5min"]
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^20\\d{2}(0[1-9]|1[0-2])$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Account statistics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Stats"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/ads/{adId}/stats": {
      "get": {
        "operationId": "getAdStats",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "adId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["day", "5min"]
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^20\\d{2}(0[1-9]|1[0-2])$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Ad statistics",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Stats"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/report": {
      "get": {
        "operationId": "getAccountMonthlyReport",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^20\\d{2}(0[1-9]|1[0-2])$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Parsed monthly account report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonthlyReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/ads/{adId}/report": {
      "get": {
        "operationId": "getAdMonthlyReport",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "adId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^20\\d{2}(0[1-9]|1[0-2])$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "Parsed monthly ad report",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/MonthlyReport"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/stats.csv": {
      "get": {
        "operationId": "getAccountStatsCsv",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "enum": ["count", "budget"]
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["day", "5min"]
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^20\\d{2}(0[1-9]|1[0-2])$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV data",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/ads/{adId}/stats.csv": {
      "get": {
        "operationId": "getAdStatsCsv",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "adId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "kind",
            "in": "query",
            "required": true,
            "schema": {
              "enum": ["count", "budget"]
            }
          },
          {
            "name": "period",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": ["day", "5min"]
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^20\\d{2}(0[1-9]|1[0-2])$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "CSV data",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/report.csv": {
      "get": {
        "operationId": "getAccountReport",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^20\\d{2}(0[1-9]|1[0-2])$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "CSV data",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/ads/{adId}/report.csv": {
      "get": {
        "operationId": "getAdReport",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          {
            "name": "adId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          },
          {
            "name": "month",
            "in": "query",
            "schema": {
              "type": "string",
              "pattern": "^20\\d{2}(0[1-9]|1[0-2])$"
            },
            "required": true
          }
        ],
        "responses": {
          "200": {
            "description": "CSV data",
            "content": {
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/api/accounts/{accountId}/ad-preview": {
      "post": {
        "operationId": "checkAdPost",
        "description": "Validate and preview text-only channel-post advertising without creating, saving or editing an ad. POST keeps ad text out of the query string; the read credential is sufficient. Empty or malformed promotion URLs may return an invalid result.",
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          },
          {
            "name": "accountId",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/AdPreviewInput"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Ad post validation result",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AdPreviewResult"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "Operation forbidden",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Resource or data not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "Request conflicts with current state",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "413": {
            "description": "Request body exceeds limit",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "Upstream rejected the operation",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "429": {
            "description": "Request rate or concurrency limit reached",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "502": {
            "description": "Upstream error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Session credentials or browser unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "x-required-scopes": ["ads:read"]
      }
    },
    "/v1/connections/{id}/mcp": {
      "post": {
        "security": [
          {
            "extensionBearer": []
          }
        ],
        "x-required-scopes": ["mcp:read", "ads:read"],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "description": "Legacy operator route. Unavailable to extension sessions in the official hosted runtime; AI clients reach Telegram Ads through the Telemetrio MCP server.",
        "responses": {
          "200": {
            "description": "MCP JSON-RPC response"
          },
          "202": {
            "description": "MCP notification accepted"
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "extensionBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Revocable extension session from PKCE exchange"
      },
      "serviceKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Telemetrio-Service-Key",
        "description": "Internal server-to-server only; never expose to browsers"
      },
      "uploadBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Single-purpose credential from ads_prepare_file_upload; authorizes only one exact binary PUT"
      },
      "mcpServiceKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Telemetrio-MCP-Service-Key",
        "description": "Telemetrio MCP server to Ads API only; opens only /internal/mcp/rpc and never the other internal routes"
      },
      "personalBearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "Operator-provisioned personal token; not OAuth"
      }
    },
    "schemas": {
      "Health": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "ok"
          },
          "revision": {
            "type": "string"
          }
        },
        "required": ["status", "revision"],
        "additionalProperties": false
      },
      "Ready": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "const": "ready"
          }
        },
        "required": ["status"],
        "additionalProperties": false
      },
      "Account": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "name": {
            "type": "string",
            "minLength": 1
          },
          "currency": {
            "type": "string",
            "enum": ["TON", "EUR", "XTR"]
          }
        },
        "required": ["id", "name"],
        "additionalProperties": false
      },
      "Accounts": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            },
            "name": {
              "type": "string",
              "minLength": 1
            },
            "currency": {
              "type": "string",
              "enum": ["TON", "EUR", "XTR"]
            }
          },
          "required": ["id", "name"],
          "additionalProperties": false
        }
      },
      "Ad": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "ad_id": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "title": {
            "type": "string"
          },
          "text": {
            "type": "string"
          },
          "trg_type": {
            "type": "string"
          },
          "views": {
            "type": "number",
            "minimum": 0
          },
          "opens": {
            "type": ["number", "null"]
          },
          "clicks": {
            "type": ["number", "null"]
          },
          "actions": {
            "type": ["number", "null"]
          },
          "action": {
            "type": "string"
          },
          "date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "ctr": {
            "type": ["number", "null"]
          },
          "cvr": {
            "type": ["number", "null"]
          },
          "cpm": {
            "type": "number"
          },
          "budget": {
            "type": "number"
          },
          "spent": {
            "type": "number"
          },
          "cpc": {
            "type": ["number", "null"]
          },
          "cpa": {
            "type": ["number", "null"]
          },
          "daily_budget": {
            "type": ["number", "null"]
          },
          "daily_spent": {
            "type": ["number", "null"]
          },
          "target": {
            "type": "string"
          },
          "tme_path": {
            "type": "string"
          },
          "status": {
            "type": "string"
          }
        },
        "required": [
          "ad_id",
          "title",
          "text",
          "trg_type",
          "views",
          "opens",
          "clicks",
          "actions",
          "action",
          "date",
          "ctr",
          "cvr",
          "cpm",
          "budget",
          "spent",
          "cpc",
          "cpa",
          "daily_budget",
          "daily_spent",
          "target",
          "tme_path",
          "status"
        ],
        "additionalProperties": false
      },
      "AdsPage": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ad_id": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "currency": {
                  "type": "string",
                  "enum": ["EUR", "TON", "XTR"]
                },
                "title": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                },
                "trg_type": {
                  "type": "string"
                },
                "views": {
                  "type": "number",
                  "minimum": 0
                },
                "opens": {
                  "type": ["number", "null"]
                },
                "clicks": {
                  "type": ["number", "null"]
                },
                "actions": {
                  "type": ["number", "null"]
                },
                "action": {
                  "type": "string"
                },
                "date": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "ctr": {
                  "type": ["number", "null"]
                },
                "cvr": {
                  "type": ["number", "null"]
                },
                "cpm": {
                  "type": "number"
                },
                "budget": {
                  "type": "number"
                },
                "spent": {
                  "type": "number"
                },
                "cpc": {
                  "type": ["number", "null"]
                },
                "cpa": {
                  "type": ["number", "null"]
                },
                "daily_budget": {
                  "type": ["number", "null"]
                },
                "daily_spent": {
                  "type": ["number", "null"]
                },
                "target": {
                  "type": "string"
                },
                "tme_path": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                }
              },
              "required": [
                "ad_id",
                "title",
                "text",
                "trg_type",
                "views",
                "opens",
                "clicks",
                "actions",
                "action",
                "date",
                "ctr",
                "cvr",
                "cpm",
                "budget",
                "spent",
                "cpc",
                "cpa",
                "daily_budget",
                "daily_spent",
                "target",
                "tme_path",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,256}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["items", "nextCursor"],
        "additionalProperties": false
      },
      "AdDetails": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "target": {
            "type": "object",
            "properties": {
              "type": {
                "type": "string",
                "enum": ["channels", "users", "bots", "search"]
              },
              "languages": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "language_code": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": ["language_code", "name"],
                  "additionalProperties": false
                }
              },
              "topics": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "topic_id": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": ["topic_id", "name"],
                  "additionalProperties": false
                }
              },
              "exclude_topics": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "topic_id": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": ["topic_id", "name"],
                  "additionalProperties": false
                }
              },
              "channels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "channel_id": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "title": {
                      "type": "string"
                    },
                    "username": {
                      "type": "string"
                    }
                  },
                  "required": ["channel_id"],
                  "additionalProperties": false
                }
              },
              "exclude_channels": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "channel_id": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "title": {
                      "type": "string"
                    },
                    "username": {
                      "type": "string"
                    }
                  },
                  "required": ["channel_id"],
                  "additionalProperties": false
                }
              },
              "countries": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "country_code": {
                      "type": "string",
                      "pattern": "^[A-Z]{2}$"
                    },
                    "name": {
                      "type": "string"
                    }
                  },
                  "required": ["country_code", "name"],
                  "additionalProperties": false
                }
              },
              "locations": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "location_id": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "name": {
                      "type": "string"
                    },
                    "country_code": {
                      "type": "string",
                      "pattern": "^[A-Z]{2}$"
                    },
                    "region": {
                      "type": "string"
                    }
                  },
                  "required": ["location_id", "name"],
                  "additionalProperties": false
                }
              },
              "intersect_topics": {
                "type": "boolean"
              },
              "audiences": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "audience_id": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "title": {
                      "type": "string"
                    },
                    "size": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "ads_count": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "created_date": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "updated_date": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "audience_id",
                    "title",
                    "size",
                    "ads_count",
                    "created_date",
                    "updated_date"
                  ],
                  "additionalProperties": false
                }
              },
              "exclude_audiences": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "audience_id": {
                      "type": "integer",
                      "exclusiveMinimum": 0,
                      "maximum": 9007199254740991
                    },
                    "title": {
                      "type": "string"
                    },
                    "size": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "ads_count": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "created_date": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "updated_date": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "audience_id",
                    "title",
                    "size",
                    "ads_count",
                    "created_date",
                    "updated_date"
                  ],
                  "additionalProperties": false
                }
              },
              "device": {
                "type": "string",
                "enum": ["ios", "android", "mobile", "desktop"]
              },
              "exclude_political_channels": {
                "type": "boolean"
              },
              "political_channels_only": {
                "type": "boolean"
              },
              "bots": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "bot_id": {
                      "type": "integer",
                      "minimum": -9007199254740991,
                      "maximum": 9007199254740991
                    },
                    "title": {
                      "type": "string"
                    },
                    "username": {
                      "type": "string"
                    }
                  },
                  "required": ["bot_id"],
                  "additionalProperties": false
                }
              },
              "search_queries": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              }
            },
            "required": ["type"],
            "additionalProperties": false
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "adId": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "fields": {
            "type": "object",
            "properties": {
              "title": {
                "type": "string",
                "minLength": 1
              },
              "text": {
                "type": "string"
              },
              "promote_url": {
                "type": "string"
              },
              "button": {
                "type": "string"
              },
              "website_name": {
                "type": "string"
              },
              "ad_info": {
                "type": "string"
              },
              "cpm": {
                "type": "string"
              },
              "budget": {
                "type": "string"
              },
              "daily_budget": {
                "type": "string"
              },
              "active": {
                "type": "string"
              },
              "views_per_user": {
                "type": "string"
              },
              "target_type": {
                "type": "string"
              },
              "placement": {
                "type": "string"
              },
              "device": {
                "type": "string"
              },
              "channels": {
                "type": "string"
              },
              "bots": {
                "type": "string"
              },
              "langs": {
                "type": "string"
              },
              "topics": {
                "type": "string"
              },
              "exclude_topics": {
                "type": "string"
              },
              "exclude_channels": {
                "type": "string"
              },
              "countries": {
                "type": "string"
              },
              "locations": {
                "type": "string"
              },
              "target_query": {
                "type": "string"
              },
              "user_langs": {
                "type": "string"
              },
              "user_topics": {
                "type": "string"
              },
              "exclude_user_topics": {
                "type": "string"
              },
              "user_channels": {
                "type": "string"
              },
              "exclude_user_channels": {
                "type": "string"
              },
              "search_queries": {
                "type": "string"
              },
              "schedule": {
                "type": "string"
              },
              "schedule_tz": {
                "type": "string"
              },
              "schedule_tz_custom": {
                "type": "string"
              },
              "use_schedule": {
                "type": "string"
              },
              "ad_activate_date": {
                "type": "string"
              },
              "ad_activate_time": {
                "type": "string"
              },
              "ad_deactivate_date": {
                "type": "string"
              },
              "ad_deactivate_time": {
                "type": "string"
              }
            },
            "required": ["title"],
            "additionalProperties": false
          },
          "targeting": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "kind": {
                  "type": "string",
                  "enum": ["channel", "bot"]
                },
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                }
              },
              "required": ["kind", "id", "name"],
              "additionalProperties": false
            }
          },
          "creative": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "buttonText": {
                "type": "string"
              },
              "destinationUrl": {
                "type": "string"
              },
              "hasMedia": {
                "type": "boolean"
              }
            },
            "required": ["text", "hasMedia"],
            "additionalProperties": false
          }
        },
        "required": ["accountId", "adId", "fields", "targeting"],
        "additionalProperties": false
      },
      "Budget": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "balance": {
            "type": "string",
            "pattern": "^-?\\d+(?:\\.\\d+)?$"
          },
          "displayDecimals": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "transactions": {
            "type": "array",
            "items": {
              "type": "array",
              "items": {
                "type": "string"
              }
            },
            "description": "Legacy visible transaction cells; monetary semantics are not inferred."
          },
          "transactionTable": {
            "type": "object",
            "properties": {
              "columns": {
                "type": "array",
                "items": {
                  "type": "string"
                }
              },
              "rows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "cells": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": ["cells"],
                  "additionalProperties": false
                }
              }
            },
            "required": ["columns", "rows"],
            "additionalProperties": false,
            "description": "Visible labels and cell text in display order; not a typed financial ledger."
          }
        },
        "required": [
          "accountId",
          "balance",
          "displayDecimals",
          "transactions",
          "transactionTable"
        ],
        "additionalProperties": false
      },
      "Stats": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "adId": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "period": {
            "type": "string",
            "enum": ["day", "5min"]
          },
          "timezone": {
            "type": "string",
            "const": "UTC"
          },
          "status": {
            "type": "string",
            "enum": ["available", "empty"]
          },
          "graphs": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "timestamps": {
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": -9007199254740991,
                    "maximum": 9007199254740991
                  }
                },
                "series": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "values": {
                        "type": "array",
                        "items": {
                          "type": ["number", "null"]
                        }
                      }
                    },
                    "required": ["id", "name", "values"],
                    "additionalProperties": false
                  }
                },
                "unit": {
                  "type": ["string", "null"]
                },
                "scale": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": ["id", "timestamps", "series", "unit", "scale"],
              "additionalProperties": false
            }
          }
        },
        "required": ["accountId", "period", "timezone", "status", "graphs"],
        "additionalProperties": false
      },
      "TargetResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "kind": {
            "type": "string",
            "enum": ["channel", "bot", "query"]
          },
          "target": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "minLength": 1
              },
              "name": {
                "type": "string"
              },
              "username": {
                "type": "string"
              },
              "photo": {
                "type": "string"
              }
            },
            "required": ["id", "name"],
            "additionalProperties": false
          }
        },
        "required": ["kind", "target"],
        "additionalProperties": false
      },
      "TargetingOptions": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "previewSupported": {
            "type": "boolean"
          },
          "limitsSource": {
            "type": "string",
            "const": "official_api_documentation"
          },
          "languages": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["id", "name"],
              "additionalProperties": false
            }
          },
          "topics": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["id", "name"],
              "additionalProperties": false
            }
          },
          "countries": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["id", "name"],
              "additionalProperties": false
            }
          },
          "userTopics": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              },
              "required": ["id", "name"],
              "additionalProperties": false
            }
          },
          "limits": {
            "type": "object",
            "properties": {
              "channels": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "bots": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "searchQueries": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              "textLength": {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              }
            },
            "required": ["channels", "bots", "searchQueries", "textLength"],
            "additionalProperties": false
          }
        },
        "required": [
          "accountId",
          "languages",
          "topics",
          "countries",
          "userTopics",
          "limits"
        ],
        "additionalProperties": false
      },
      "Error": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "error": {
            "type": "object",
            "properties": {
              "code": {
                "type": "string",
                "minLength": 1
              },
              "message": {
                "type": "string",
                "minLength": 1
              },
              "diagnostics": {
                "type": "object",
                "properties": {
                  "requestId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "operationRef": {
                    "type": "string",
                    "pattern": "^[a-f0-9]{64}$"
                  },
                  "method": {
                    "type": "string",
                    "pattern": "^[a-z][A-Za-z0-9]{0,63}$"
                  },
                  "phase": {
                    "type": "string",
                    "enum": ["identity", "operation", "validation"]
                  },
                  "accountCurrency": {
                    "type": "string",
                    "enum": ["TON", "EUR", "XTR"]
                  },
                  "durationMs": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "httpStatus": {
                    "type": "integer",
                    "minimum": 100,
                    "maximum": 599
                  },
                  "providerErrorCode": {
                    "type": "string",
                    "pattern": "^[A-Z][A-Z0-9_]{1,95}$"
                  },
                  "providerErrorRedacted": {
                    "type": "boolean"
                  },
                  "responseIssue": {
                    "type": "string",
                    "enum": [
                      "empty_body",
                      "invalid_json",
                      "invalid_envelope",
                      "invalid_result",
                      "too_large",
                      "redirect",
                      "http_error"
                    ]
                  },
                  "networkCode": {
                    "type": "string",
                    "enum": [
                      "ECONNRESET",
                      "ECONNREFUSED",
                      "ETIMEDOUT",
                      "ENOTFOUND",
                      "EAI_AGAIN",
                      "UND_ERR_CONNECT_TIMEOUT",
                      "UND_ERR_HEADERS_TIMEOUT",
                      "UND_ERR_SOCKET",
                      "TIMEOUT",
                      "NETWORK_ERROR"
                    ]
                  },
                  "schemaIssues": {
                    "maxItems": 5,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "code": {
                          "type": "string",
                          "pattern": "^[a-z_]{1,40}$"
                        },
                        "path": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_.]{0,160}$"
                        }
                      },
                      "required": ["code", "path"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["requestId", "method", "phase", "durationMs"],
                "additionalProperties": false
              }
            },
            "required": ["code", "message"],
            "additionalProperties": false
          }
        },
        "required": ["error"],
        "additionalProperties": false
      },
      "MonthlyReport": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "oneOf": [
          {
            "type": "object",
            "properties": {
              "month": {
                "type": "string",
                "pattern": "^20\\d{2}(0[1-9]|1[0-2])$"
              },
              "currency": {
                "type": "string",
                "minLength": 1
              },
              "total": {
                "type": "object",
                "properties": {
                  "views": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "amount": {
                    "type": "string",
                    "pattern": "^\\d+(?:\\.\\d+)?$"
                  }
                },
                "required": ["views", "amount"],
                "additionalProperties": false
              },
              "scope": {
                "type": "string",
                "const": "account"
              },
              "rows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "views": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "amount": {
                      "type": "string",
                      "pattern": "^\\d+(?:\\.\\d+)?$"
                    },
                    "adId": {
                      "type": "string",
                      "pattern": "^AD\\d+$"
                    },
                    "title": {
                      "type": "string"
                    }
                  },
                  "required": ["views", "amount", "adId", "title"],
                  "additionalProperties": false
                }
              }
            },
            "required": ["month", "currency", "total", "scope", "rows"],
            "additionalProperties": false
          },
          {
            "type": "object",
            "properties": {
              "month": {
                "type": "string",
                "pattern": "^20\\d{2}(0[1-9]|1[0-2])$"
              },
              "currency": {
                "type": "string",
                "minLength": 1
              },
              "total": {
                "type": "object",
                "properties": {
                  "views": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "amount": {
                    "type": "string",
                    "pattern": "^\\d+(?:\\.\\d+)?$"
                  }
                },
                "required": ["views", "amount"],
                "additionalProperties": false
              },
              "scope": {
                "type": "string",
                "const": "ad"
              },
              "rows": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "views": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "amount": {
                      "type": "string",
                      "pattern": "^\\d+(?:\\.\\d+)?$"
                    },
                    "date": {
                      "type": "string",
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                    }
                  },
                  "required": ["views", "amount", "date"],
                  "additionalProperties": false
                }
              }
            },
            "required": ["month", "currency", "total", "scope", "rows"],
            "additionalProperties": false
          }
        ]
      },
      "SimilarTargets": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "kind": {
            "type": "string",
            "enum": ["channel", "bot"]
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "minLength": 1
                },
                "name": {
                  "type": "string"
                },
                "username": {
                  "type": "string"
                }
              },
              "required": ["id", "name"],
              "additionalProperties": false
            }
          }
        },
        "required": ["accountId", "kind", "items"],
        "additionalProperties": false
      },
      "LocationPage": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "country": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          },
          "query": {
            "type": "string",
            "pattern": "^\\S$"
          },
          "items": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "name": {
                  "type": "string"
                },
                "country": {
                  "type": "string",
                  "pattern": "^[A-Z]{2}$"
                },
                "region": {
                  "type": "string"
                }
              },
              "required": ["id", "name", "country"],
              "additionalProperties": false
            }
          },
          "nextOffset": {
            "anyOf": [
              {
                "type": "integer",
                "exclusiveMinimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          },
          "nextCursor": {
            "anyOf": [
              {
                "type": "string",
                "pattern": "^[A-Za-z0-9_-]{1,1024}$"
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["accountId", "country", "query", "items", "nextOffset"],
        "additionalProperties": false
      },
      "AdPreviewInput": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "text": {
            "type": "string",
            "maxLength": 4096
          },
          "promoteUrl": {
            "type": "string",
            "maxLength": 2048
          },
          "channelIds": {
            "minItems": 1,
            "maxItems": 9,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          }
        },
        "required": ["text", "promoteUrl"],
        "additionalProperties": false
      },
      "AdPreviewResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "accountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "result": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "ready",
                    "description": "Preview generated; this does not guarantee createAd acceptance or moderation approval."
                  },
                  "promoteUrl": {
                    "type": "string",
                    "maxLength": 2048,
                    "pattern": "^(?:https:\\/\\/)?t\\.me\\/[A-Za-z0-9_+/?=&%.-]+$"
                  },
                  "preview": {
                    "type": "object",
                    "properties": {
                      "from": {
                        "type": "string"
                      },
                      "description": {
                        "type": "string"
                      },
                      "text": {
                        "type": "string"
                      },
                      "buttonText": {
                        "type": "string"
                      },
                      "destinationUrl": {
                        "type": "string",
                        "maxLength": 2048,
                        "pattern": "^(?:https:\\/\\/)?t\\.me\\/[A-Za-z0-9_+/?=&%.-]+$"
                      },
                      "hasPhoto": {
                        "type": "boolean"
                      },
                      "hasMedia": {
                        "type": "boolean"
                      },
                      "picture": {
                        "type": "boolean"
                      }
                    },
                    "required": [
                      "from",
                      "description",
                      "text",
                      "buttonText",
                      "destinationUrl",
                      "hasPhoto",
                      "hasMedia",
                      "picture"
                    ],
                    "additionalProperties": false
                  },
                  "exclusionSuggestion": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,256}$"
                      },
                      "name": {
                        "type": "string"
                      }
                    },
                    "required": ["id", "name"],
                    "additionalProperties": false
                  }
                },
                "required": ["status", "promoteUrl", "preview"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "invalid"
                  },
                  "field": {
                    "type": "string",
                    "enum": ["text", "promoteUrl", "channelIds"]
                  }
                },
                "required": ["status", "field"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "status": {
                    "type": "string",
                    "const": "pending",
                    "description": "Telegram requested a later preview check. Source-observed behavior with synthetic coverage; no live pending sample yet. No automatic retry."
                  }
                },
                "required": ["status"],
                "additionalProperties": false
              }
            ]
          }
        },
        "required": ["accountId", "result"],
        "additionalProperties": false
      },
      "CreateTestAd": {
        "type": "object",
        "additionalProperties": false,
        "required": ["requestId", "title", "text", "promoteUrl", "channelIds"],
        "properties": {
          "requestId": {
            "type": "string",
            "format": "uuid"
          },
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 45
          },
          "text": {
            "type": "string",
            "minLength": 1,
            "maxLength": 160
          },
          "promoteUrl": {
            "type": "string",
            "pattern": "^(?:https://)?t\\.me/"
          },
          "channelIds": {
            "type": "array",
            "minItems": 1,
            "maxItems": 100,
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          }
        }
      },
      "RenameTestAd": {
        "type": "object",
        "additionalProperties": false,
        "required": ["title"],
        "properties": {
          "title": {
            "type": "string",
            "minLength": 1,
            "maxLength": 45
          }
        }
      },
      "CreatedTestAd": {
        "type": "object",
        "additionalProperties": false,
        "required": ["accountId", "adId", "title", "requestId"],
        "properties": {
          "accountId": {
            "type": "string"
          },
          "adId": {
            "type": "integer",
            "minimum": 1
          },
          "title": {
            "type": "string"
          },
          "requestId": {
            "type": "string",
            "format": "uuid"
          }
        }
      },
      "AdsCapacity": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "status": {
            "type": "string",
            "enum": ["ready", "capacity_limited"]
          },
          "journal": {
            "type": "object",
            "properties": {
              "used": {
                "type": "number"
              },
              "total": {
                "type": "number"
              },
              "resultBytes": {
                "type": "number"
              },
              "resultCapacityBytes": {
                "type": "number"
              },
              "unknown": {
                "type": "number"
              }
            },
            "required": [
              "used",
              "total",
              "resultBytes",
              "resultCapacityBytes",
              "unknown"
            ],
            "additionalProperties": false
          },
          "uploads": {
            "type": "object",
            "properties": {
              "usedBytes": {
                "type": "number"
              },
              "totalBytes": {
                "type": "number"
              },
              "reservations": {
                "type": "number"
              },
              "reservationTotal": {
                "type": "number"
              },
              "reservationAvailable": {
                "type": "number"
              },
              "active": {
                "type": "number"
              },
              "expired": {
                "type": "number"
              }
            },
            "required": [
              "usedBytes",
              "totalBytes",
              "reservations",
              "reservationTotal",
              "reservationAvailable",
              "active",
              "expired"
            ],
            "additionalProperties": false
          },
          "mcp": {
            "type": "object",
            "properties": {
              "used": {
                "type": "number"
              },
              "available": {
                "type": "number"
              },
              "total": {
                "type": "number"
              }
            },
            "required": ["used", "available", "total"],
            "additionalProperties": false
          }
        },
        "required": ["status", "journal", "uploads", "mcp"],
        "additionalProperties": false
      },
      "AdsUploadPreparation": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "purpose": {
            "type": "string",
            "enum": ["uploadAdPhoto", "uploadAdVideo", "uploadWebsitePhoto"]
          },
          "mimeType": {
            "type": "string",
            "enum": ["image/jpeg", "image/png", "video/mp4"]
          },
          "byteCount": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 20971520
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        },
        "required": ["purpose", "mimeType", "byteCount", "sha256"],
        "additionalProperties": false
      },
      "AdsUploadReady": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "status": {
            "type": "string",
            "const": "ready"
          }
        },
        "required": ["uploadId", "status"],
        "additionalProperties": false
      },
      "AdsUploadCredential": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "uploadId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "url": {
            "type": "string",
            "format": "uri"
          },
          "uploadToken": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "method": {
            "type": "string",
            "const": "PUT"
          },
          "contentType": {
            "type": "string"
          }
        },
        "required": [
          "uploadId",
          "url",
          "uploadToken",
          "expiresAt",
          "method",
          "contentType"
        ],
        "additionalProperties": false
      },
      "AdsAccountDiscovery": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "connectionId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "root": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "currency": {
                "type": "string",
                "enum": ["EUR", "TON", "XTR"]
              },
              "spent_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "remaining_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "ads_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              }
            },
            "required": [
              "account_id",
              "title",
              "currency",
              "spent_budget",
              "remaining_budget",
              "ads_budget"
            ],
            "additionalProperties": false
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "account_id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "currency": {
                  "type": "string",
                  "enum": ["EUR", "TON", "XTR"]
                },
                "spent_budget": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                },
                "remaining_budget": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                },
                "ads_budget": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                }
              },
              "required": [
                "account_id",
                "title",
                "currency",
                "spent_budget",
                "remaining_budget",
                "ads_budget"
              ],
              "additionalProperties": false
            }
          },
          "totalCount": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "nextOffset": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "connectionId",
          "version",
          "root",
          "accounts",
          "totalCount",
          "nextOffset"
        ],
        "additionalProperties": false
      },
      "OfficialcreateAccountParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "title": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone_number": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          },
          "idempotency_key": {
            "description": "If provided, must equal the wrapper operationId; retain it for an identical retry.",
            "type": "string",
            "maxLength": 128
          }
        },
        "required": [
          "title",
          "full_name",
          "email",
          "phone_number",
          "country",
          "city"
        ],
        "additionalProperties": false
      },
      "OfficialeditAccountInfoParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "title": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone_number": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          }
        },
        "additionalProperties": false
      },
      "OfficialgetAccountInfoParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "additionalProperties": false
      },
      "OfficialgetRelatedAccountsListParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "additionalProperties": false
      },
      "OfficialincreaseAccountBudgetParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Related account endpoint; the connection root is the other endpoint. Both require Manage budgets."
          },
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "idempotency_key": {
            "description": "If provided, must equal the wrapper operationId; retain it for an identical retry.",
            "type": "string",
            "maxLength": 128
          }
        },
        "required": ["account_id", "amount"],
        "additionalProperties": false
      },
      "OfficialdecreaseAccountBudgetParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256,
            "description": "Related account endpoint; the connection root is the other endpoint. Both require Manage budgets."
          },
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "idempotency_key": {
            "description": "If provided, must equal the wrapper operationId; retain it for an identical retry.",
            "type": "string",
            "maxLength": 128
          }
        },
        "required": ["account_id", "amount"],
        "additionalProperties": false
      },
      "OfficialgetTransactionStatusParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": ["transaction_id"],
        "additionalProperties": false
      },
      "OfficialgetCurrentAccountParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "OfficialgetAccountsByIdParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_ids": {
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1,
              "maxLength": 256
            }
          }
        },
        "required": ["account_ids"],
        "additionalProperties": false
      },
      "OfficialgetAccountTransactionsListParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "additionalProperties": false
      },
      "OfficialgetAccountStatsParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "from_time": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Inclusive Unix timestamp in seconds."
          },
          "to_time": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Exclusive Unix timestamp in seconds; at most 1000 intervals after from_time."
          },
          "interval": {
            "anyOf": [
              {
                "type": "number",
                "const": 300
              },
              {
                "type": "number",
                "const": 86400
              }
            ]
          }
        },
        "required": ["from_time", "to_time", "interval"],
        "additionalProperties": false
      },
      "OfficialgetAccountReportParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "year": {
            "type": "integer",
            "minimum": 2021,
            "maximum": 2100
          },
          "month": {
            "type": "integer",
            "minimum": 1,
            "maximum": 12
          }
        },
        "required": ["year", "month"],
        "additionalProperties": false
      },
      "OfficialuploadAdPhotoParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "file": {
            "type": "object",
            "properties": {
              "uploadId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[A-Za-z0-9_-]+$"
              }
            },
            "required": ["uploadId"],
            "additionalProperties": false,
            "description": "Staged file reference {uploadId} from ads_prepare_file_upload after successful PUT; no URL, path or base64."
          }
        },
        "required": ["file"],
        "additionalProperties": false
      },
      "OfficialuploadAdVideoParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "file": {
            "type": "object",
            "properties": {
              "uploadId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[A-Za-z0-9_-]+$"
              }
            },
            "required": ["uploadId"],
            "additionalProperties": false,
            "description": "Staged file reference {uploadId} from ads_prepare_file_upload after successful PUT; no URL, path or base64."
          }
        },
        "required": ["file"],
        "additionalProperties": false
      },
      "OfficialuploadWebsitePhotoParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "file": {
            "type": "object",
            "properties": {
              "uploadId": {
                "type": "string",
                "minLength": 1,
                "maxLength": 256,
                "pattern": "^[A-Za-z0-9_-]+$"
              }
            },
            "required": ["uploadId"],
            "additionalProperties": false,
            "description": "Staged file reference {uploadId} from ads_prepare_file_upload after successful PUT; no URL, path or base64."
          }
        },
        "required": ["file"],
        "additionalProperties": false
      },
      "OfficialcreateAdParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "title": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "maxLength": 16384
          },
          "photo_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "video_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "promote_url": {
            "type": "string",
            "format": "uri"
          },
          "cpm": {
            "type": "number",
            "minimum": 0,
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "placement": {
            "type": "string",
            "enum": [
              "channel_post",
              "bot_banner",
              "search_result",
              "video_banner"
            ]
          },
          "target": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "channels"
                  },
                  "language_codes": {
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "topic_ids": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "exclude_topic_ids": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "channel_ids": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "string",
                          "pattern": "^@[A-Za-z0-9_]{1,32}$"
                        }
                      ]
                    }
                  },
                  "exclude_channel_ids": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "string",
                          "pattern": "^@[A-Za-z0-9_]{1,32}$"
                        }
                      ]
                    }
                  }
                },
                "required": ["type"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "users"
                  },
                  "country_codes": {
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[A-Z]{2}$"
                    }
                  },
                  "location_ids": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "language_codes": {
                    "maxItems": 8,
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "topic_ids": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "intersect_topics": {
                    "type": "boolean"
                  },
                  "exclude_topic_ids": {
                    "maxItems": 20,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "channel_ids": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "string",
                          "pattern": "^@[A-Za-z0-9_]{1,32}$"
                        }
                      ]
                    }
                  },
                  "exclude_channel_ids": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "string",
                          "pattern": "^@[A-Za-z0-9_]{1,32}$"
                        }
                      ]
                    }
                  },
                  "audience_ids": {
                    "maxItems": 4,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "exclude_audience_ids": {
                    "maxItems": 4,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "device": {
                    "type": "string",
                    "enum": ["ios", "android", "mobile", "desktop"]
                  },
                  "exclude_political_channels": {
                    "type": "boolean"
                  },
                  "political_channels_only": {
                    "type": "boolean"
                  }
                },
                "required": ["type", "country_codes"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bots"
                  },
                  "bot_ids": {
                    "maxItems": 100,
                    "type": "array",
                    "items": {
                      "anyOf": [
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "string",
                          "pattern": "^@[A-Za-z0-9_]{1,32}$"
                        }
                      ]
                    }
                  }
                },
                "required": ["type"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "search"
                  },
                  "search_queries": {
                    "maxItems": 10,
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": ["type", "search_queries"],
                "additionalProperties": false
              }
            ]
          },
          "impression_frequency": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4
          },
          "website_name": {
            "type": "string"
          },
          "website_photo_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "button": {
            "type": "string",
            "enum": [
              "subscribe",
              "view",
              "read",
              "learn_more",
              "download",
              "open",
              "sign_up",
              "buy",
              "order",
              "play",
              "try",
              "leave_request",
              ""
            ]
          },
          "conversion_event_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "additional_info": {
            "type": "string"
          },
          "show_userpic": {
            "type": "boolean"
          },
          "initial_budget": {
            "type": "number",
            "minimum": 0,
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_budget_limit": {
            "type": "number",
            "minimum": 0,
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "is_paused": {
            "type": "boolean"
          },
          "activate_date": {
            "description": "Unix timestamp in seconds for activation; native provider timing rules apply.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "deactivate_date": {
            "description": "Unix timestamp in seconds for stopping delivery.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "schedule": {
            "description": "Native weekly schedule; false clears scheduling. Supply week_hours_mask with a fixed timezone offset in seconds or use_viewer_timezone for users targeting.",
            "anyOf": [
              {
                "type": "boolean",
                "const": false
              },
              {
                "type": "object",
                "properties": {
                  "week_hours_mask": {
                    "minItems": 7,
                    "maxItems": 7,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 16777215
                    },
                    "description": "Seven native 24-bit day masks; each enabled bit selects one hour. Preserve provider day/hour ordering."
                  },
                  "timezone": {
                    "description": "Fixed UTC offset in seconds; use a permitted native offset, not an IANA timezone name.",
                    "anyOf": [
                      {
                        "type": "number",
                        "const": -43200
                      },
                      {
                        "type": "number",
                        "const": -39600
                      },
                      {
                        "type": "number",
                        "const": -36000
                      },
                      {
                        "type": "number",
                        "const": -34200
                      },
                      {
                        "type": "number",
                        "const": -32400
                      },
                      {
                        "type": "number",
                        "const": -28800
                      },
                      {
                        "type": "number",
                        "const": -25200
                      },
                      {
                        "type": "number",
                        "const": -21600
                      },
                      {
                        "type": "number",
                        "const": -18000
                      },
                      {
                        "type": "number",
                        "const": -14400
                      },
                      {
                        "type": "number",
                        "const": -12600
                      },
                      {
                        "type": "number",
                        "const": -10800
                      },
                      {
                        "type": "number",
                        "const": -9000
                      },
                      {
                        "type": "number",
                        "const": -7200
                      },
                      {
                        "type": "number",
                        "const": -3600
                      },
                      {
                        "type": "number",
                        "const": 0
                      },
                      {
                        "type": "number",
                        "const": 3600
                      },
                      {
                        "type": "number",
                        "const": 7200
                      },
                      {
                        "type": "number",
                        "const": 10800
                      },
                      {
                        "type": "number",
                        "const": 12600
                      },
                      {
                        "type": "number",
                        "const": 14400
                      },
                      {
                        "type": "number",
                        "const": 16200
                      },
                      {
                        "type": "number",
                        "const": 18000
                      },
                      {
                        "type": "number",
                        "const": 19800
                      },
                      {
                        "type": "number",
                        "const": 20700
                      },
                      {
                        "type": "number",
                        "const": 21600
                      },
                      {
                        "type": "number",
                        "const": 23400
                      },
                      {
                        "type": "number",
                        "const": 25200
                      },
                      {
                        "type": "number",
                        "const": 28800
                      },
                      {
                        "type": "number",
                        "const": 31500
                      },
                      {
                        "type": "number",
                        "const": 32400
                      },
                      {
                        "type": "number",
                        "const": 34200
                      },
                      {
                        "type": "number",
                        "const": 36000
                      },
                      {
                        "type": "number",
                        "const": 37800
                      },
                      {
                        "type": "number",
                        "const": 39600
                      },
                      {
                        "type": "number",
                        "const": 43200
                      },
                      {
                        "type": "number",
                        "const": 45900
                      },
                      {
                        "type": "number",
                        "const": 46800
                      },
                      {
                        "type": "number",
                        "const": 49500
                      },
                      {
                        "type": "number",
                        "const": 50400
                      }
                    ]
                  },
                  "use_viewer_timezone": {
                    "type": "boolean"
                  }
                },
                "required": ["week_hours_mask"],
                "additionalProperties": false
              }
            ]
          },
          "return_target": {
            "type": "boolean"
          },
          "idempotency_key": {
            "description": "If provided, must equal the wrapper operationId; retain it for an identical retry.",
            "type": "string",
            "maxLength": 128
          }
        },
        "required": ["title", "promote_url", "cpm", "placement", "target"],
        "additionalProperties": false
      },
      "OfficialeditAdParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "text": {
            "type": "string",
            "maxLength": 16384
          },
          "photo_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "video_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "promote_url": {
            "type": "string",
            "format": "uri"
          },
          "cpm": {
            "type": "number",
            "minimum": 0,
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "impression_frequency": {
            "type": "integer",
            "minimum": 1,
            "maximum": 4
          },
          "website_name": {
            "type": "string"
          },
          "website_photo_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "button": {
            "type": "string",
            "enum": [
              "subscribe",
              "view",
              "read",
              "learn_more",
              "download",
              "open",
              "sign_up",
              "buy",
              "order",
              "play",
              "try",
              "leave_request",
              ""
            ]
          },
          "conversion_event_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "additional_info": {
            "type": "string"
          },
          "show_userpic": {
            "type": "boolean"
          },
          "daily_budget_limit": {
            "type": "number",
            "minimum": 0,
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "is_paused": {
            "type": "boolean"
          },
          "activate_date": {
            "description": "Unix timestamp in seconds for activation; native provider timing rules apply.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "deactivate_date": {
            "description": "Unix timestamp in seconds for stopping delivery.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "schedule": {
            "description": "Native weekly schedule; false clears scheduling. Supply week_hours_mask with a fixed timezone offset in seconds or use_viewer_timezone for users targeting.",
            "anyOf": [
              {
                "type": "boolean",
                "const": false
              },
              {
                "type": "object",
                "properties": {
                  "week_hours_mask": {
                    "minItems": 7,
                    "maxItems": 7,
                    "type": "array",
                    "items": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 16777215
                    },
                    "description": "Seven native 24-bit day masks; each enabled bit selects one hour. Preserve provider day/hour ordering."
                  },
                  "timezone": {
                    "description": "Fixed UTC offset in seconds; use a permitted native offset, not an IANA timezone name.",
                    "anyOf": [
                      {
                        "type": "number",
                        "const": -43200
                      },
                      {
                        "type": "number",
                        "const": -39600
                      },
                      {
                        "type": "number",
                        "const": -36000
                      },
                      {
                        "type": "number",
                        "const": -34200
                      },
                      {
                        "type": "number",
                        "const": -32400
                      },
                      {
                        "type": "number",
                        "const": -28800
                      },
                      {
                        "type": "number",
                        "const": -25200
                      },
                      {
                        "type": "number",
                        "const": -21600
                      },
                      {
                        "type": "number",
                        "const": -18000
                      },
                      {
                        "type": "number",
                        "const": -14400
                      },
                      {
                        "type": "number",
                        "const": -12600
                      },
                      {
                        "type": "number",
                        "const": -10800
                      },
                      {
                        "type": "number",
                        "const": -9000
                      },
                      {
                        "type": "number",
                        "const": -7200
                      },
                      {
                        "type": "number",
                        "const": -3600
                      },
                      {
                        "type": "number",
                        "const": 0
                      },
                      {
                        "type": "number",
                        "const": 3600
                      },
                      {
                        "type": "number",
                        "const": 7200
                      },
                      {
                        "type": "number",
                        "const": 10800
                      },
                      {
                        "type": "number",
                        "const": 12600
                      },
                      {
                        "type": "number",
                        "const": 14400
                      },
                      {
                        "type": "number",
                        "const": 16200
                      },
                      {
                        "type": "number",
                        "const": 18000
                      },
                      {
                        "type": "number",
                        "const": 19800
                      },
                      {
                        "type": "number",
                        "const": 20700
                      },
                      {
                        "type": "number",
                        "const": 21600
                      },
                      {
                        "type": "number",
                        "const": 23400
                      },
                      {
                        "type": "number",
                        "const": 25200
                      },
                      {
                        "type": "number",
                        "const": 28800
                      },
                      {
                        "type": "number",
                        "const": 31500
                      },
                      {
                        "type": "number",
                        "const": 32400
                      },
                      {
                        "type": "number",
                        "const": 34200
                      },
                      {
                        "type": "number",
                        "const": 36000
                      },
                      {
                        "type": "number",
                        "const": 37800
                      },
                      {
                        "type": "number",
                        "const": 39600
                      },
                      {
                        "type": "number",
                        "const": 43200
                      },
                      {
                        "type": "number",
                        "const": 45900
                      },
                      {
                        "type": "number",
                        "const": 46800
                      },
                      {
                        "type": "number",
                        "const": 49500
                      },
                      {
                        "type": "number",
                        "const": 50400
                      }
                    ]
                  },
                  "use_viewer_timezone": {
                    "type": "boolean"
                  }
                },
                "required": ["week_hours_mask"],
                "additionalProperties": false
              }
            ]
          },
          "return_target": {
            "type": "boolean"
          }
        },
        "required": ["ad_id"],
        "additionalProperties": false
      },
      "OfficialeditAdStatusParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "is_paused": {
            "type": "boolean"
          },
          "return_target": {
            "type": "boolean"
          }
        },
        "required": ["ad_id", "is_paused"],
        "additionalProperties": false
      },
      "OfficialincreaseAdBudgetParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "return_target": {
            "type": "boolean"
          },
          "idempotency_key": {
            "description": "If provided, must equal the wrapper operationId; retain it for an identical retry.",
            "type": "string",
            "maxLength": 128
          }
        },
        "required": ["ad_id", "amount"],
        "additionalProperties": false
      },
      "OfficialdecreaseAdBudgetParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "amount": {
            "type": "number",
            "exclusiveMinimum": 0,
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "return_target": {
            "type": "boolean"
          },
          "idempotency_key": {
            "description": "If provided, must equal the wrapper operationId; retain it for an identical retry.",
            "type": "string",
            "maxLength": 128
          }
        },
        "required": ["ad_id", "amount"],
        "additionalProperties": false
      },
      "OfficialsubmitAdForReviewParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "return_target": {
            "type": "boolean"
          }
        },
        "required": ["ad_id"],
        "additionalProperties": false
      },
      "OfficialdeleteAdParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": ["ad_id"],
        "additionalProperties": false
      },
      "OfficialgetAdsByIdParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ad_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "return_target": {
            "type": "boolean"
          }
        },
        "required": ["ad_ids"],
        "additionalProperties": false
      },
      "OfficialgetAdsListParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "offset": {
            "type": "string"
          },
          "limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 100
          },
          "return_target": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      },
      "OfficialgetAdTransactionsListParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": ["ad_id"],
        "additionalProperties": false
      },
      "OfficialgetAdStatsParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "from_time": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Inclusive Unix timestamp in seconds."
          },
          "to_time": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991,
            "description": "Exclusive Unix timestamp in seconds; at most 1000 intervals after from_time."
          },
          "interval": {
            "anyOf": [
              {
                "type": "number",
                "const": 300
              },
              {
                "type": "number",
                "const": 86400
              }
            ]
          }
        },
        "required": ["ad_id", "from_time", "to_time", "interval"],
        "additionalProperties": false
      },
      "OfficialcreateAudienceParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "title": {
            "type": "string"
          },
          "add_phones": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "idempotency_key": {
            "description": "If provided, must equal the wrapper operationId; retain it for an identical retry.",
            "type": "string",
            "maxLength": 128
          }
        },
        "required": ["title"],
        "additionalProperties": false
      },
      "OfficialeditAudienceParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "audience_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "add_phones": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "remove_phones": {
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "reset_phones": {
            "type": "boolean"
          }
        },
        "required": ["audience_id"],
        "additionalProperties": false
      },
      "OfficialdeleteAudienceParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "audience_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": ["audience_id"],
        "additionalProperties": false
      },
      "OfficialgetAudiencesByIdParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "audience_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          }
        },
        "required": ["audience_ids"],
        "additionalProperties": false
      },
      "OfficialgetAudiencesListParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "additionalProperties": false
      },
      "OfficialcreatePixelParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "idempotency_key": {
            "description": "If provided, must equal the wrapper operationId; retain it for an identical retry.",
            "type": "string",
            "maxLength": 128
          }
        },
        "additionalProperties": false
      },
      "OfficialgetPixelParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "additionalProperties": false
      },
      "OfficialcreatePixelEventParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "page_view",
              "add_to_cart",
              "add_to_wishlist",
              "customize_product",
              "initiate_checkout",
              "add_payment_info",
              "purchase",
              "contact",
              "lead",
              "schedule",
              "complete_registration",
              "submit_application",
              "start_trial",
              "subscribe",
              "view_content",
              "search",
              "find_location",
              "donate",
              "custom"
            ]
          },
          "idempotency_key": {
            "description": "If provided, must equal the wrapper operationId; retain it for an identical retry.",
            "type": "string",
            "maxLength": 128
          }
        },
        "required": ["title", "type"],
        "additionalProperties": false
      },
      "OfficialeditPixelEventParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "event_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "title": {
            "type": "string"
          }
        },
        "required": ["event_id", "title"],
        "additionalProperties": false
      },
      "OfficialdeletePixelEventParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "event_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          }
        },
        "required": ["event_id"],
        "additionalProperties": false
      },
      "OfficialgetPixelEventsByIdParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "event_ids": {
            "type": "array",
            "items": {
              "type": "string"
            }
          }
        },
        "required": ["event_ids"],
        "additionalProperties": false
      },
      "OfficialgetPixelEventsListParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "offset": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "additionalProperties": false
      },
      "OfficialgetTargetLanguagesListParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "OfficialgetTargetTopicsListParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "OfficialgetTargetCountriesListParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {},
        "additionalProperties": false
      },
      "OfficialgetTargetLocationsByIdParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "location_ids": {
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          }
        },
        "required": ["location_ids"],
        "additionalProperties": false
      },
      "OfficialgetTargetLocationsListParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "country_code": {
            "type": "string",
            "pattern": "^[A-Z]{2}$"
          },
          "query": {
            "type": "string"
          },
          "offset": {
            "type": "string"
          },
          "limit": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": ["country_code", "query"],
        "additionalProperties": false
      },
      "OfficialgetTargetChannelParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "channel_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "pattern": "^@[A-Za-z0-9_]{1,32}$"
              }
            ]
          },
          "for_excluding": {
            "type": "boolean"
          }
        },
        "required": ["channel_id"],
        "additionalProperties": false
      },
      "OfficialgetTargetBotParams": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "bot_id": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": -9007199254740991,
                "maximum": 9007199254740991
              },
              {
                "type": "string",
                "pattern": "^@[A-Za-z0-9_]{1,32}$"
              }
            ]
          }
        },
        "required": ["bot_id"],
        "additionalProperties": false
      },
      "OfficialcreateAccountResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string"
          },
          "account_number": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone_number": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          }
        },
        "required": [
          "account_id",
          "title",
          "full_name",
          "email",
          "phone_number",
          "country",
          "city"
        ],
        "additionalProperties": false
      },
      "OfficialeditAccountInfoResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string"
          },
          "account_number": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone_number": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          }
        },
        "required": [
          "account_id",
          "title",
          "full_name",
          "email",
          "phone_number",
          "country",
          "city"
        ],
        "additionalProperties": false
      },
      "OfficialgetAccountInfoResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string"
          },
          "account_number": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "full_name": {
            "type": "string"
          },
          "email": {
            "type": "string"
          },
          "phone_number": {
            "type": "string"
          },
          "country": {
            "type": "string"
          },
          "city": {
            "type": "string"
          },
          "legal_name": {
            "type": "string"
          }
        },
        "required": [
          "account_id",
          "title",
          "full_name",
          "email",
          "phone_number",
          "country",
          "city"
        ],
        "additionalProperties": false
      },
      "OfficialgetRelatedAccountsListResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "total_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "account_id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "currency": {
                  "type": "string",
                  "enum": ["EUR", "TON", "XTR"]
                },
                "spent_budget": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                },
                "remaining_budget": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                },
                "ads_budget": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                }
              },
              "required": [
                "account_id",
                "title",
                "currency",
                "spent_budget",
                "remaining_budget",
                "ads_budget"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": ["total_count", "accounts"],
        "additionalProperties": false
      },
      "OfficialincreaseAccountBudgetResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["in_progress", "failed", "completed"]
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "amount": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "main_account": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "currency": {
                "type": "string",
                "enum": ["EUR", "TON", "XTR"]
              },
              "spent_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "remaining_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "ads_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              }
            },
            "required": [
              "account_id",
              "title",
              "currency",
              "spent_budget",
              "remaining_budget",
              "ads_budget"
            ],
            "additionalProperties": false
          },
          "related_account": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "currency": {
                "type": "string",
                "enum": ["EUR", "TON", "XTR"]
              },
              "spent_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "remaining_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "ads_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              }
            },
            "required": [
              "account_id",
              "title",
              "currency",
              "spent_budget",
              "remaining_budget",
              "ads_budget"
            ],
            "additionalProperties": false
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "transaction_id",
          "status",
          "currency",
          "amount",
          "main_account",
          "related_account"
        ],
        "additionalProperties": false
      },
      "OfficialdecreaseAccountBudgetResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["in_progress", "failed", "completed"]
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "amount": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "main_account": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "currency": {
                "type": "string",
                "enum": ["EUR", "TON", "XTR"]
              },
              "spent_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "remaining_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "ads_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              }
            },
            "required": [
              "account_id",
              "title",
              "currency",
              "spent_budget",
              "remaining_budget",
              "ads_budget"
            ],
            "additionalProperties": false
          },
          "related_account": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "currency": {
                "type": "string",
                "enum": ["EUR", "TON", "XTR"]
              },
              "spent_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "remaining_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "ads_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              }
            },
            "required": [
              "account_id",
              "title",
              "currency",
              "spent_budget",
              "remaining_budget",
              "ads_budget"
            ],
            "additionalProperties": false
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "transaction_id",
          "status",
          "currency",
          "amount",
          "main_account",
          "related_account"
        ],
        "additionalProperties": false
      },
      "OfficialgetTransactionStatusResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "transaction_id": {
            "type": "string"
          },
          "status": {
            "type": "string",
            "enum": ["in_progress", "failed", "completed"]
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "amount": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "main_account": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "currency": {
                "type": "string",
                "enum": ["EUR", "TON", "XTR"]
              },
              "spent_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "remaining_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "ads_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              }
            },
            "required": [
              "account_id",
              "title",
              "currency",
              "spent_budget",
              "remaining_budget",
              "ads_budget"
            ],
            "additionalProperties": false
          },
          "related_account": {
            "type": "object",
            "properties": {
              "account_id": {
                "type": "string"
              },
              "title": {
                "type": "string"
              },
              "currency": {
                "type": "string",
                "enum": ["EUR", "TON", "XTR"]
              },
              "spent_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "remaining_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              },
              "ads_budget": {
                "type": "number",
                "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
              }
            },
            "required": [
              "account_id",
              "title",
              "currency",
              "spent_budget",
              "remaining_budget",
              "ads_budget"
            ],
            "additionalProperties": false
          },
          "error": {
            "type": "string"
          }
        },
        "required": [
          "transaction_id",
          "status",
          "currency",
          "amount",
          "main_account",
          "related_account"
        ],
        "additionalProperties": false
      },
      "OfficialgetCurrentAccountResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "account_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "remaining_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "ads_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          }
        },
        "required": [
          "account_id",
          "title",
          "currency",
          "spent_budget",
          "remaining_budget",
          "ads_budget"
        ],
        "additionalProperties": false
      },
      "OfficialgetAccountsByIdResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "account_id": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "currency": {
              "type": "string",
              "enum": ["EUR", "TON", "XTR"]
            },
            "spent_budget": {
              "type": "number",
              "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
            },
            "remaining_budget": {
              "type": "number",
              "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
            },
            "ads_budget": {
              "type": "number",
              "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
            }
          },
          "required": [
            "account_id",
            "title",
            "currency",
            "spent_budget",
            "remaining_budget",
            "ads_budget"
          ],
          "additionalProperties": false
        }
      },
      "OfficialgetAccountTransactionsListResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "total_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "transactions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "peer": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "external"
                        },
                        "comment": {
                          "type": "string"
                        }
                      },
                      "required": ["type"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "main_account"
                        }
                      },
                      "required": ["type"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "related_account"
                        },
                        "account_id": {
                          "type": "string"
                        },
                        "account_title": {
                          "type": "string"
                        }
                      },
                      "required": ["type", "account_id", "account_title"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "ad"
                        },
                        "ad_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ad_title": {
                          "type": "string"
                        },
                        "ad_is_deleted": {
                          "type": "boolean"
                        }
                      },
                      "required": ["type", "ad_id", "ad_title"],
                      "additionalProperties": false
                    }
                  ]
                },
                "date": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "currency": {
                  "type": "string",
                  "enum": ["EUR", "TON", "XTR"]
                },
                "amount": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                }
              },
              "required": ["peer", "date", "currency", "amount"],
              "additionalProperties": false
            }
          },
          "next_offset": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            ],
            "description": "Next transaction offset; Telegram returns an integer or a documented string. Use its integer value as the next request offset."
          }
        },
        "required": ["total_count", "transactions"],
        "additionalProperties": false
      },
      "OfficialgetAccountStatsResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "from_time": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Inclusive Unix timestamp in seconds."
            },
            "to_time": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Exclusive Unix timestamp in seconds; at most 1000 intervals after from_time."
            },
            "views": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "opens": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "clicks": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "actions": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "joins": {
              "description": "Deprecated alias of actions retained by Telegram for backward compatibility.",
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "currency": {
              "type": "string",
              "enum": ["EUR", "TON", "XTR"]
            },
            "spent_budget": {
              "type": "number",
              "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
            }
          },
          "required": [
            "from_time",
            "to_time",
            "views",
            "opens",
            "clicks",
            "actions",
            "currency",
            "spent_budget"
          ],
          "additionalProperties": false
        }
      },
      "OfficialgetAccountReportResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "ad_id": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "ad_title": {
              "type": "string"
            },
            "ad_is_deleted": {
              "type": "boolean"
            },
            "views": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "opens": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "clicks": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "actions": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "joins": {
              "description": "Deprecated alias of actions retained by Telegram for backward compatibility.",
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "currency": {
              "type": "string",
              "enum": ["EUR", "TON", "XTR"]
            },
            "spent_budget": {
              "type": "number",
              "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
            }
          },
          "required": [
            "ad_id",
            "ad_title",
            "views",
            "opens",
            "clicks",
            "actions",
            "currency",
            "spent_budget"
          ],
          "additionalProperties": false
        }
      },
      "OfficialuploadAdPhotoResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "photo_id": {
            "type": "string"
          },
          "photo_url": {
            "type": "string"
          }
        },
        "required": ["photo_id", "photo_url"],
        "additionalProperties": false
      },
      "OfficialuploadAdVideoResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "video_id": {
            "type": "string"
          },
          "video_url": {
            "type": "string"
          }
        },
        "required": ["video_id", "video_url"],
        "additionalProperties": false
      },
      "OfficialuploadWebsitePhotoResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "photo_id": {
            "type": "string"
          },
          "photo_url": {
            "type": "string"
          }
        },
        "required": ["photo_id", "photo_url"],
        "additionalProperties": false
      },
      "OfficialcreateAdResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "text": {
            "type": "string"
          },
          "photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "video": {
            "type": "object",
            "properties": {
              "video_id": {
                "type": "string"
              },
              "video_url": {
                "type": "string"
              }
            },
            "required": ["video_id", "video_url"],
            "additionalProperties": false
          },
          "promote_url": {
            "type": "string"
          },
          "cpm": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "placement": {
            "type": "string",
            "enum": [
              "channel_post",
              "bot_banner",
              "search_result",
              "video_banner"
            ]
          },
          "target": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "channels"
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "users"
                  },
                  "countries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["country_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "location_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        },
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "region": {
                          "type": "string"
                        }
                      },
                      "required": ["location_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "intersect_topics": {
                    "type": "boolean"
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "exclude_audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "device": {
                    "type": "string",
                    "enum": ["ios", "android", "mobile", "desktop"]
                  },
                  "exclude_political_channels": {
                    "type": "boolean"
                  },
                  "political_channels_only": {
                    "type": "boolean"
                  }
                },
                "required": ["type", "countries"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bots"
                  },
                  "bots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "bot_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["bot_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type", "bots"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "search"
                  },
                  "search_queries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": ["type", "search_queries"],
                "additionalProperties": false
              }
            ]
          },
          "impression_frequency": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "website_name": {
            "type": "string"
          },
          "website_photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "button": {
            "type": "string",
            "enum": [
              "subscribe",
              "view",
              "read",
              "learn_more",
              "download",
              "open",
              "sign_up",
              "buy",
              "order",
              "play",
              "try",
              "leave_request",
              ""
            ]
          },
          "conversion_event_id": {
            "type": "string"
          },
          "additional_info": {
            "type": "string"
          },
          "show_userpic": {
            "type": "boolean"
          },
          "spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "remaining_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_budget_limit": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "views": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "opens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "clicks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "actions": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "joins": {
            "description": "Deprecated alias of actions retained by Telegram for backward compatibility.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action_type": {
            "type": "string",
            "enum": [
              "join",
              "start_bot",
              "launch_miniapp",
              "send_message",
              "page_view",
              "landing_view",
              "add_to_cart",
              "add_to_wishlist",
              "customize_product",
              "initiate_checkout",
              "add_payment_info",
              "purchase",
              "contact",
              "lead",
              "schedule",
              "complete_registration",
              "submit_application",
              "start_trial",
              "subscribe",
              "view_content",
              "search",
              "find_location",
              "donate",
              "custom"
            ]
          },
          "created_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "is_paused": {
            "type": "boolean"
          },
          "activate_date": {
            "description": "Unix timestamp in seconds for activation; native provider timing rules apply.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "deactivate_date": {
            "description": "Unix timestamp in seconds for stopping delivery.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "schedule": {
            "type": "object",
            "properties": {
              "week_hours_mask": {
                "minItems": 7,
                "maxItems": 7,
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 16777215
                },
                "description": "Seven native 24-bit day masks; each enabled bit selects one hour. Preserve provider day/hour ordering."
              },
              "timezone": {
                "description": "Fixed UTC offset in seconds; use a permitted native offset, not an IANA timezone name.",
                "anyOf": [
                  {
                    "type": "number",
                    "const": -43200
                  },
                  {
                    "type": "number",
                    "const": -39600
                  },
                  {
                    "type": "number",
                    "const": -36000
                  },
                  {
                    "type": "number",
                    "const": -34200
                  },
                  {
                    "type": "number",
                    "const": -32400
                  },
                  {
                    "type": "number",
                    "const": -28800
                  },
                  {
                    "type": "number",
                    "const": -25200
                  },
                  {
                    "type": "number",
                    "const": -21600
                  },
                  {
                    "type": "number",
                    "const": -18000
                  },
                  {
                    "type": "number",
                    "const": -14400
                  },
                  {
                    "type": "number",
                    "const": -12600
                  },
                  {
                    "type": "number",
                    "const": -10800
                  },
                  {
                    "type": "number",
                    "const": -9000
                  },
                  {
                    "type": "number",
                    "const": -7200
                  },
                  {
                    "type": "number",
                    "const": -3600
                  },
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 3600
                  },
                  {
                    "type": "number",
                    "const": 7200
                  },
                  {
                    "type": "number",
                    "const": 10800
                  },
                  {
                    "type": "number",
                    "const": 12600
                  },
                  {
                    "type": "number",
                    "const": 14400
                  },
                  {
                    "type": "number",
                    "const": 16200
                  },
                  {
                    "type": "number",
                    "const": 18000
                  },
                  {
                    "type": "number",
                    "const": 19800
                  },
                  {
                    "type": "number",
                    "const": 20700
                  },
                  {
                    "type": "number",
                    "const": 21600
                  },
                  {
                    "type": "number",
                    "const": 23400
                  },
                  {
                    "type": "number",
                    "const": 25200
                  },
                  {
                    "type": "number",
                    "const": 28800
                  },
                  {
                    "type": "number",
                    "const": 31500
                  },
                  {
                    "type": "number",
                    "const": 32400
                  },
                  {
                    "type": "number",
                    "const": 34200
                  },
                  {
                    "type": "number",
                    "const": 36000
                  },
                  {
                    "type": "number",
                    "const": 37800
                  },
                  {
                    "type": "number",
                    "const": 39600
                  },
                  {
                    "type": "number",
                    "const": 43200
                  },
                  {
                    "type": "number",
                    "const": 45900
                  },
                  {
                    "type": "number",
                    "const": 46800
                  },
                  {
                    "type": "number",
                    "const": 49500
                  },
                  {
                    "type": "number",
                    "const": 50400
                  }
                ]
              },
              "use_viewer_timezone": {
                "type": "boolean"
              }
            },
            "required": ["week_hours_mask"],
            "additionalProperties": false
          },
          "status": {
            "type": "string",
            "enum": [
              "stopped",
              "ready_for_review",
              "in_review",
              "declined",
              "active",
              "on_hold"
            ]
          },
          "decline_reason": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "description_html": {
                "type": "string"
              }
            },
            "required": ["text", "description_html"],
            "additionalProperties": false
          }
        },
        "required": [
          "ad_id",
          "title",
          "currency",
          "text",
          "promote_url",
          "cpm",
          "placement",
          "spent_budget",
          "remaining_budget",
          "views",
          "actions",
          "created_date",
          "status"
        ],
        "additionalProperties": false
      },
      "OfficialeditAdResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "text": {
            "type": "string"
          },
          "photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "video": {
            "type": "object",
            "properties": {
              "video_id": {
                "type": "string"
              },
              "video_url": {
                "type": "string"
              }
            },
            "required": ["video_id", "video_url"],
            "additionalProperties": false
          },
          "promote_url": {
            "type": "string"
          },
          "cpm": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "placement": {
            "type": "string",
            "enum": [
              "channel_post",
              "bot_banner",
              "search_result",
              "video_banner"
            ]
          },
          "target": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "channels"
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "users"
                  },
                  "countries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["country_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "location_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        },
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "region": {
                          "type": "string"
                        }
                      },
                      "required": ["location_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "intersect_topics": {
                    "type": "boolean"
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "exclude_audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "device": {
                    "type": "string",
                    "enum": ["ios", "android", "mobile", "desktop"]
                  },
                  "exclude_political_channels": {
                    "type": "boolean"
                  },
                  "political_channels_only": {
                    "type": "boolean"
                  }
                },
                "required": ["type", "countries"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bots"
                  },
                  "bots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "bot_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["bot_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type", "bots"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "search"
                  },
                  "search_queries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": ["type", "search_queries"],
                "additionalProperties": false
              }
            ]
          },
          "impression_frequency": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "website_name": {
            "type": "string"
          },
          "website_photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "button": {
            "type": "string",
            "enum": [
              "subscribe",
              "view",
              "read",
              "learn_more",
              "download",
              "open",
              "sign_up",
              "buy",
              "order",
              "play",
              "try",
              "leave_request",
              ""
            ]
          },
          "conversion_event_id": {
            "type": "string"
          },
          "additional_info": {
            "type": "string"
          },
          "show_userpic": {
            "type": "boolean"
          },
          "spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "remaining_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_budget_limit": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "views": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "opens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "clicks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "actions": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "joins": {
            "description": "Deprecated alias of actions retained by Telegram for backward compatibility.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action_type": {
            "type": "string",
            "enum": [
              "join",
              "start_bot",
              "launch_miniapp",
              "send_message",
              "page_view",
              "landing_view",
              "add_to_cart",
              "add_to_wishlist",
              "customize_product",
              "initiate_checkout",
              "add_payment_info",
              "purchase",
              "contact",
              "lead",
              "schedule",
              "complete_registration",
              "submit_application",
              "start_trial",
              "subscribe",
              "view_content",
              "search",
              "find_location",
              "donate",
              "custom"
            ]
          },
          "created_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "is_paused": {
            "type": "boolean"
          },
          "activate_date": {
            "description": "Unix timestamp in seconds for activation; native provider timing rules apply.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "deactivate_date": {
            "description": "Unix timestamp in seconds for stopping delivery.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "schedule": {
            "type": "object",
            "properties": {
              "week_hours_mask": {
                "minItems": 7,
                "maxItems": 7,
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 16777215
                },
                "description": "Seven native 24-bit day masks; each enabled bit selects one hour. Preserve provider day/hour ordering."
              },
              "timezone": {
                "description": "Fixed UTC offset in seconds; use a permitted native offset, not an IANA timezone name.",
                "anyOf": [
                  {
                    "type": "number",
                    "const": -43200
                  },
                  {
                    "type": "number",
                    "const": -39600
                  },
                  {
                    "type": "number",
                    "const": -36000
                  },
                  {
                    "type": "number",
                    "const": -34200
                  },
                  {
                    "type": "number",
                    "const": -32400
                  },
                  {
                    "type": "number",
                    "const": -28800
                  },
                  {
                    "type": "number",
                    "const": -25200
                  },
                  {
                    "type": "number",
                    "const": -21600
                  },
                  {
                    "type": "number",
                    "const": -18000
                  },
                  {
                    "type": "number",
                    "const": -14400
                  },
                  {
                    "type": "number",
                    "const": -12600
                  },
                  {
                    "type": "number",
                    "const": -10800
                  },
                  {
                    "type": "number",
                    "const": -9000
                  },
                  {
                    "type": "number",
                    "const": -7200
                  },
                  {
                    "type": "number",
                    "const": -3600
                  },
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 3600
                  },
                  {
                    "type": "number",
                    "const": 7200
                  },
                  {
                    "type": "number",
                    "const": 10800
                  },
                  {
                    "type": "number",
                    "const": 12600
                  },
                  {
                    "type": "number",
                    "const": 14400
                  },
                  {
                    "type": "number",
                    "const": 16200
                  },
                  {
                    "type": "number",
                    "const": 18000
                  },
                  {
                    "type": "number",
                    "const": 19800
                  },
                  {
                    "type": "number",
                    "const": 20700
                  },
                  {
                    "type": "number",
                    "const": 21600
                  },
                  {
                    "type": "number",
                    "const": 23400
                  },
                  {
                    "type": "number",
                    "const": 25200
                  },
                  {
                    "type": "number",
                    "const": 28800
                  },
                  {
                    "type": "number",
                    "const": 31500
                  },
                  {
                    "type": "number",
                    "const": 32400
                  },
                  {
                    "type": "number",
                    "const": 34200
                  },
                  {
                    "type": "number",
                    "const": 36000
                  },
                  {
                    "type": "number",
                    "const": 37800
                  },
                  {
                    "type": "number",
                    "const": 39600
                  },
                  {
                    "type": "number",
                    "const": 43200
                  },
                  {
                    "type": "number",
                    "const": 45900
                  },
                  {
                    "type": "number",
                    "const": 46800
                  },
                  {
                    "type": "number",
                    "const": 49500
                  },
                  {
                    "type": "number",
                    "const": 50400
                  }
                ]
              },
              "use_viewer_timezone": {
                "type": "boolean"
              }
            },
            "required": ["week_hours_mask"],
            "additionalProperties": false
          },
          "status": {
            "type": "string",
            "enum": [
              "stopped",
              "ready_for_review",
              "in_review",
              "declined",
              "active",
              "on_hold"
            ]
          },
          "decline_reason": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "description_html": {
                "type": "string"
              }
            },
            "required": ["text", "description_html"],
            "additionalProperties": false
          }
        },
        "required": [
          "ad_id",
          "title",
          "currency",
          "text",
          "promote_url",
          "cpm",
          "placement",
          "spent_budget",
          "remaining_budget",
          "views",
          "actions",
          "created_date",
          "status"
        ],
        "additionalProperties": false
      },
      "OfficialeditAdStatusResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "text": {
            "type": "string"
          },
          "photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "video": {
            "type": "object",
            "properties": {
              "video_id": {
                "type": "string"
              },
              "video_url": {
                "type": "string"
              }
            },
            "required": ["video_id", "video_url"],
            "additionalProperties": false
          },
          "promote_url": {
            "type": "string"
          },
          "cpm": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "placement": {
            "type": "string",
            "enum": [
              "channel_post",
              "bot_banner",
              "search_result",
              "video_banner"
            ]
          },
          "target": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "channels"
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "users"
                  },
                  "countries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["country_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "location_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        },
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "region": {
                          "type": "string"
                        }
                      },
                      "required": ["location_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "intersect_topics": {
                    "type": "boolean"
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "exclude_audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "device": {
                    "type": "string",
                    "enum": ["ios", "android", "mobile", "desktop"]
                  },
                  "exclude_political_channels": {
                    "type": "boolean"
                  },
                  "political_channels_only": {
                    "type": "boolean"
                  }
                },
                "required": ["type", "countries"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bots"
                  },
                  "bots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "bot_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["bot_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type", "bots"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "search"
                  },
                  "search_queries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": ["type", "search_queries"],
                "additionalProperties": false
              }
            ]
          },
          "impression_frequency": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "website_name": {
            "type": "string"
          },
          "website_photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "button": {
            "type": "string",
            "enum": [
              "subscribe",
              "view",
              "read",
              "learn_more",
              "download",
              "open",
              "sign_up",
              "buy",
              "order",
              "play",
              "try",
              "leave_request",
              ""
            ]
          },
          "conversion_event_id": {
            "type": "string"
          },
          "additional_info": {
            "type": "string"
          },
          "show_userpic": {
            "type": "boolean"
          },
          "spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "remaining_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_budget_limit": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "views": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "opens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "clicks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "actions": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "joins": {
            "description": "Deprecated alias of actions retained by Telegram for backward compatibility.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action_type": {
            "type": "string",
            "enum": [
              "join",
              "start_bot",
              "launch_miniapp",
              "send_message",
              "page_view",
              "landing_view",
              "add_to_cart",
              "add_to_wishlist",
              "customize_product",
              "initiate_checkout",
              "add_payment_info",
              "purchase",
              "contact",
              "lead",
              "schedule",
              "complete_registration",
              "submit_application",
              "start_trial",
              "subscribe",
              "view_content",
              "search",
              "find_location",
              "donate",
              "custom"
            ]
          },
          "created_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "is_paused": {
            "type": "boolean"
          },
          "activate_date": {
            "description": "Unix timestamp in seconds for activation; native provider timing rules apply.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "deactivate_date": {
            "description": "Unix timestamp in seconds for stopping delivery.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "schedule": {
            "type": "object",
            "properties": {
              "week_hours_mask": {
                "minItems": 7,
                "maxItems": 7,
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 16777215
                },
                "description": "Seven native 24-bit day masks; each enabled bit selects one hour. Preserve provider day/hour ordering."
              },
              "timezone": {
                "description": "Fixed UTC offset in seconds; use a permitted native offset, not an IANA timezone name.",
                "anyOf": [
                  {
                    "type": "number",
                    "const": -43200
                  },
                  {
                    "type": "number",
                    "const": -39600
                  },
                  {
                    "type": "number",
                    "const": -36000
                  },
                  {
                    "type": "number",
                    "const": -34200
                  },
                  {
                    "type": "number",
                    "const": -32400
                  },
                  {
                    "type": "number",
                    "const": -28800
                  },
                  {
                    "type": "number",
                    "const": -25200
                  },
                  {
                    "type": "number",
                    "const": -21600
                  },
                  {
                    "type": "number",
                    "const": -18000
                  },
                  {
                    "type": "number",
                    "const": -14400
                  },
                  {
                    "type": "number",
                    "const": -12600
                  },
                  {
                    "type": "number",
                    "const": -10800
                  },
                  {
                    "type": "number",
                    "const": -9000
                  },
                  {
                    "type": "number",
                    "const": -7200
                  },
                  {
                    "type": "number",
                    "const": -3600
                  },
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 3600
                  },
                  {
                    "type": "number",
                    "const": 7200
                  },
                  {
                    "type": "number",
                    "const": 10800
                  },
                  {
                    "type": "number",
                    "const": 12600
                  },
                  {
                    "type": "number",
                    "const": 14400
                  },
                  {
                    "type": "number",
                    "const": 16200
                  },
                  {
                    "type": "number",
                    "const": 18000
                  },
                  {
                    "type": "number",
                    "const": 19800
                  },
                  {
                    "type": "number",
                    "const": 20700
                  },
                  {
                    "type": "number",
                    "const": 21600
                  },
                  {
                    "type": "number",
                    "const": 23400
                  },
                  {
                    "type": "number",
                    "const": 25200
                  },
                  {
                    "type": "number",
                    "const": 28800
                  },
                  {
                    "type": "number",
                    "const": 31500
                  },
                  {
                    "type": "number",
                    "const": 32400
                  },
                  {
                    "type": "number",
                    "const": 34200
                  },
                  {
                    "type": "number",
                    "const": 36000
                  },
                  {
                    "type": "number",
                    "const": 37800
                  },
                  {
                    "type": "number",
                    "const": 39600
                  },
                  {
                    "type": "number",
                    "const": 43200
                  },
                  {
                    "type": "number",
                    "const": 45900
                  },
                  {
                    "type": "number",
                    "const": 46800
                  },
                  {
                    "type": "number",
                    "const": 49500
                  },
                  {
                    "type": "number",
                    "const": 50400
                  }
                ]
              },
              "use_viewer_timezone": {
                "type": "boolean"
              }
            },
            "required": ["week_hours_mask"],
            "additionalProperties": false
          },
          "status": {
            "type": "string",
            "enum": [
              "stopped",
              "ready_for_review",
              "in_review",
              "declined",
              "active",
              "on_hold"
            ]
          },
          "decline_reason": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "description_html": {
                "type": "string"
              }
            },
            "required": ["text", "description_html"],
            "additionalProperties": false
          }
        },
        "required": [
          "ad_id",
          "title",
          "currency",
          "text",
          "promote_url",
          "cpm",
          "placement",
          "spent_budget",
          "remaining_budget",
          "views",
          "actions",
          "created_date",
          "status"
        ],
        "additionalProperties": false
      },
      "OfficialincreaseAdBudgetResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "text": {
            "type": "string"
          },
          "photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "video": {
            "type": "object",
            "properties": {
              "video_id": {
                "type": "string"
              },
              "video_url": {
                "type": "string"
              }
            },
            "required": ["video_id", "video_url"],
            "additionalProperties": false
          },
          "promote_url": {
            "type": "string"
          },
          "cpm": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "placement": {
            "type": "string",
            "enum": [
              "channel_post",
              "bot_banner",
              "search_result",
              "video_banner"
            ]
          },
          "target": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "channels"
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "users"
                  },
                  "countries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["country_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "location_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        },
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "region": {
                          "type": "string"
                        }
                      },
                      "required": ["location_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "intersect_topics": {
                    "type": "boolean"
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "exclude_audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "device": {
                    "type": "string",
                    "enum": ["ios", "android", "mobile", "desktop"]
                  },
                  "exclude_political_channels": {
                    "type": "boolean"
                  },
                  "political_channels_only": {
                    "type": "boolean"
                  }
                },
                "required": ["type", "countries"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bots"
                  },
                  "bots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "bot_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["bot_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type", "bots"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "search"
                  },
                  "search_queries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": ["type", "search_queries"],
                "additionalProperties": false
              }
            ]
          },
          "impression_frequency": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "website_name": {
            "type": "string"
          },
          "website_photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "button": {
            "type": "string",
            "enum": [
              "subscribe",
              "view",
              "read",
              "learn_more",
              "download",
              "open",
              "sign_up",
              "buy",
              "order",
              "play",
              "try",
              "leave_request",
              ""
            ]
          },
          "conversion_event_id": {
            "type": "string"
          },
          "additional_info": {
            "type": "string"
          },
          "show_userpic": {
            "type": "boolean"
          },
          "spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "remaining_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_budget_limit": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "views": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "opens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "clicks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "actions": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "joins": {
            "description": "Deprecated alias of actions retained by Telegram for backward compatibility.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action_type": {
            "type": "string",
            "enum": [
              "join",
              "start_bot",
              "launch_miniapp",
              "send_message",
              "page_view",
              "landing_view",
              "add_to_cart",
              "add_to_wishlist",
              "customize_product",
              "initiate_checkout",
              "add_payment_info",
              "purchase",
              "contact",
              "lead",
              "schedule",
              "complete_registration",
              "submit_application",
              "start_trial",
              "subscribe",
              "view_content",
              "search",
              "find_location",
              "donate",
              "custom"
            ]
          },
          "created_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "is_paused": {
            "type": "boolean"
          },
          "activate_date": {
            "description": "Unix timestamp in seconds for activation; native provider timing rules apply.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "deactivate_date": {
            "description": "Unix timestamp in seconds for stopping delivery.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "schedule": {
            "type": "object",
            "properties": {
              "week_hours_mask": {
                "minItems": 7,
                "maxItems": 7,
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 16777215
                },
                "description": "Seven native 24-bit day masks; each enabled bit selects one hour. Preserve provider day/hour ordering."
              },
              "timezone": {
                "description": "Fixed UTC offset in seconds; use a permitted native offset, not an IANA timezone name.",
                "anyOf": [
                  {
                    "type": "number",
                    "const": -43200
                  },
                  {
                    "type": "number",
                    "const": -39600
                  },
                  {
                    "type": "number",
                    "const": -36000
                  },
                  {
                    "type": "number",
                    "const": -34200
                  },
                  {
                    "type": "number",
                    "const": -32400
                  },
                  {
                    "type": "number",
                    "const": -28800
                  },
                  {
                    "type": "number",
                    "const": -25200
                  },
                  {
                    "type": "number",
                    "const": -21600
                  },
                  {
                    "type": "number",
                    "const": -18000
                  },
                  {
                    "type": "number",
                    "const": -14400
                  },
                  {
                    "type": "number",
                    "const": -12600
                  },
                  {
                    "type": "number",
                    "const": -10800
                  },
                  {
                    "type": "number",
                    "const": -9000
                  },
                  {
                    "type": "number",
                    "const": -7200
                  },
                  {
                    "type": "number",
                    "const": -3600
                  },
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 3600
                  },
                  {
                    "type": "number",
                    "const": 7200
                  },
                  {
                    "type": "number",
                    "const": 10800
                  },
                  {
                    "type": "number",
                    "const": 12600
                  },
                  {
                    "type": "number",
                    "const": 14400
                  },
                  {
                    "type": "number",
                    "const": 16200
                  },
                  {
                    "type": "number",
                    "const": 18000
                  },
                  {
                    "type": "number",
                    "const": 19800
                  },
                  {
                    "type": "number",
                    "const": 20700
                  },
                  {
                    "type": "number",
                    "const": 21600
                  },
                  {
                    "type": "number",
                    "const": 23400
                  },
                  {
                    "type": "number",
                    "const": 25200
                  },
                  {
                    "type": "number",
                    "const": 28800
                  },
                  {
                    "type": "number",
                    "const": 31500
                  },
                  {
                    "type": "number",
                    "const": 32400
                  },
                  {
                    "type": "number",
                    "const": 34200
                  },
                  {
                    "type": "number",
                    "const": 36000
                  },
                  {
                    "type": "number",
                    "const": 37800
                  },
                  {
                    "type": "number",
                    "const": 39600
                  },
                  {
                    "type": "number",
                    "const": 43200
                  },
                  {
                    "type": "number",
                    "const": 45900
                  },
                  {
                    "type": "number",
                    "const": 46800
                  },
                  {
                    "type": "number",
                    "const": 49500
                  },
                  {
                    "type": "number",
                    "const": 50400
                  }
                ]
              },
              "use_viewer_timezone": {
                "type": "boolean"
              }
            },
            "required": ["week_hours_mask"],
            "additionalProperties": false
          },
          "status": {
            "type": "string",
            "enum": [
              "stopped",
              "ready_for_review",
              "in_review",
              "declined",
              "active",
              "on_hold"
            ]
          },
          "decline_reason": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "description_html": {
                "type": "string"
              }
            },
            "required": ["text", "description_html"],
            "additionalProperties": false
          }
        },
        "required": [
          "ad_id",
          "title",
          "currency",
          "text",
          "promote_url",
          "cpm",
          "placement",
          "spent_budget",
          "remaining_budget",
          "views",
          "actions",
          "created_date",
          "status"
        ],
        "additionalProperties": false
      },
      "OfficialdecreaseAdBudgetResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "text": {
            "type": "string"
          },
          "photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "video": {
            "type": "object",
            "properties": {
              "video_id": {
                "type": "string"
              },
              "video_url": {
                "type": "string"
              }
            },
            "required": ["video_id", "video_url"],
            "additionalProperties": false
          },
          "promote_url": {
            "type": "string"
          },
          "cpm": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "placement": {
            "type": "string",
            "enum": [
              "channel_post",
              "bot_banner",
              "search_result",
              "video_banner"
            ]
          },
          "target": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "channels"
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "users"
                  },
                  "countries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["country_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "location_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        },
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "region": {
                          "type": "string"
                        }
                      },
                      "required": ["location_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "intersect_topics": {
                    "type": "boolean"
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "exclude_audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "device": {
                    "type": "string",
                    "enum": ["ios", "android", "mobile", "desktop"]
                  },
                  "exclude_political_channels": {
                    "type": "boolean"
                  },
                  "political_channels_only": {
                    "type": "boolean"
                  }
                },
                "required": ["type", "countries"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bots"
                  },
                  "bots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "bot_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["bot_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type", "bots"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "search"
                  },
                  "search_queries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": ["type", "search_queries"],
                "additionalProperties": false
              }
            ]
          },
          "impression_frequency": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "website_name": {
            "type": "string"
          },
          "website_photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "button": {
            "type": "string",
            "enum": [
              "subscribe",
              "view",
              "read",
              "learn_more",
              "download",
              "open",
              "sign_up",
              "buy",
              "order",
              "play",
              "try",
              "leave_request",
              ""
            ]
          },
          "conversion_event_id": {
            "type": "string"
          },
          "additional_info": {
            "type": "string"
          },
          "show_userpic": {
            "type": "boolean"
          },
          "spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "remaining_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_budget_limit": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "views": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "opens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "clicks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "actions": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "joins": {
            "description": "Deprecated alias of actions retained by Telegram for backward compatibility.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action_type": {
            "type": "string",
            "enum": [
              "join",
              "start_bot",
              "launch_miniapp",
              "send_message",
              "page_view",
              "landing_view",
              "add_to_cart",
              "add_to_wishlist",
              "customize_product",
              "initiate_checkout",
              "add_payment_info",
              "purchase",
              "contact",
              "lead",
              "schedule",
              "complete_registration",
              "submit_application",
              "start_trial",
              "subscribe",
              "view_content",
              "search",
              "find_location",
              "donate",
              "custom"
            ]
          },
          "created_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "is_paused": {
            "type": "boolean"
          },
          "activate_date": {
            "description": "Unix timestamp in seconds for activation; native provider timing rules apply.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "deactivate_date": {
            "description": "Unix timestamp in seconds for stopping delivery.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "schedule": {
            "type": "object",
            "properties": {
              "week_hours_mask": {
                "minItems": 7,
                "maxItems": 7,
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 16777215
                },
                "description": "Seven native 24-bit day masks; each enabled bit selects one hour. Preserve provider day/hour ordering."
              },
              "timezone": {
                "description": "Fixed UTC offset in seconds; use a permitted native offset, not an IANA timezone name.",
                "anyOf": [
                  {
                    "type": "number",
                    "const": -43200
                  },
                  {
                    "type": "number",
                    "const": -39600
                  },
                  {
                    "type": "number",
                    "const": -36000
                  },
                  {
                    "type": "number",
                    "const": -34200
                  },
                  {
                    "type": "number",
                    "const": -32400
                  },
                  {
                    "type": "number",
                    "const": -28800
                  },
                  {
                    "type": "number",
                    "const": -25200
                  },
                  {
                    "type": "number",
                    "const": -21600
                  },
                  {
                    "type": "number",
                    "const": -18000
                  },
                  {
                    "type": "number",
                    "const": -14400
                  },
                  {
                    "type": "number",
                    "const": -12600
                  },
                  {
                    "type": "number",
                    "const": -10800
                  },
                  {
                    "type": "number",
                    "const": -9000
                  },
                  {
                    "type": "number",
                    "const": -7200
                  },
                  {
                    "type": "number",
                    "const": -3600
                  },
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 3600
                  },
                  {
                    "type": "number",
                    "const": 7200
                  },
                  {
                    "type": "number",
                    "const": 10800
                  },
                  {
                    "type": "number",
                    "const": 12600
                  },
                  {
                    "type": "number",
                    "const": 14400
                  },
                  {
                    "type": "number",
                    "const": 16200
                  },
                  {
                    "type": "number",
                    "const": 18000
                  },
                  {
                    "type": "number",
                    "const": 19800
                  },
                  {
                    "type": "number",
                    "const": 20700
                  },
                  {
                    "type": "number",
                    "const": 21600
                  },
                  {
                    "type": "number",
                    "const": 23400
                  },
                  {
                    "type": "number",
                    "const": 25200
                  },
                  {
                    "type": "number",
                    "const": 28800
                  },
                  {
                    "type": "number",
                    "const": 31500
                  },
                  {
                    "type": "number",
                    "const": 32400
                  },
                  {
                    "type": "number",
                    "const": 34200
                  },
                  {
                    "type": "number",
                    "const": 36000
                  },
                  {
                    "type": "number",
                    "const": 37800
                  },
                  {
                    "type": "number",
                    "const": 39600
                  },
                  {
                    "type": "number",
                    "const": 43200
                  },
                  {
                    "type": "number",
                    "const": 45900
                  },
                  {
                    "type": "number",
                    "const": 46800
                  },
                  {
                    "type": "number",
                    "const": 49500
                  },
                  {
                    "type": "number",
                    "const": 50400
                  }
                ]
              },
              "use_viewer_timezone": {
                "type": "boolean"
              }
            },
            "required": ["week_hours_mask"],
            "additionalProperties": false
          },
          "status": {
            "type": "string",
            "enum": [
              "stopped",
              "ready_for_review",
              "in_review",
              "declined",
              "active",
              "on_hold"
            ]
          },
          "decline_reason": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "description_html": {
                "type": "string"
              }
            },
            "required": ["text", "description_html"],
            "additionalProperties": false
          }
        },
        "required": [
          "ad_id",
          "title",
          "currency",
          "text",
          "promote_url",
          "cpm",
          "placement",
          "spent_budget",
          "remaining_budget",
          "views",
          "actions",
          "created_date",
          "status"
        ],
        "additionalProperties": false
      },
      "OfficialsubmitAdForReviewResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "ad_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "currency": {
            "type": "string",
            "enum": ["EUR", "TON", "XTR"]
          },
          "text": {
            "type": "string"
          },
          "photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "video": {
            "type": "object",
            "properties": {
              "video_id": {
                "type": "string"
              },
              "video_url": {
                "type": "string"
              }
            },
            "required": ["video_id", "video_url"],
            "additionalProperties": false
          },
          "promote_url": {
            "type": "string"
          },
          "cpm": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "placement": {
            "type": "string",
            "enum": [
              "channel_post",
              "bot_banner",
              "search_result",
              "video_banner"
            ]
          },
          "target": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "channels"
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "users"
                  },
                  "countries": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["country_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "locations": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "location_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        },
                        "country_code": {
                          "type": "string",
                          "pattern": "^[A-Z]{2}$"
                        },
                        "region": {
                          "type": "string"
                        }
                      },
                      "required": ["location_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "languages": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "language_code": {
                          "type": "string"
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["language_code", "name"],
                      "additionalProperties": false
                    }
                  },
                  "topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "intersect_topics": {
                    "type": "boolean"
                  },
                  "exclude_topics": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "topic_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["topic_id", "name"],
                      "additionalProperties": false
                    }
                  },
                  "channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "exclude_channels": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "channel_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["channel_id"],
                      "additionalProperties": false
                    }
                  },
                  "audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "exclude_audiences": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "audience_id": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "size": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "ads_count": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "created_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        },
                        "updated_date": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": [
                        "audience_id",
                        "title",
                        "size",
                        "ads_count",
                        "created_date",
                        "updated_date"
                      ],
                      "additionalProperties": false
                    }
                  },
                  "device": {
                    "type": "string",
                    "enum": ["ios", "android", "mobile", "desktop"]
                  },
                  "exclude_political_channels": {
                    "type": "boolean"
                  },
                  "political_channels_only": {
                    "type": "boolean"
                  }
                },
                "required": ["type", "countries"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "bots"
                  },
                  "bots": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "bot_id": {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        "title": {
                          "type": "string"
                        },
                        "username": {
                          "type": "string"
                        },
                        "photo_url": {
                          "type": "string"
                        }
                      },
                      "required": ["bot_id"],
                      "additionalProperties": false
                    }
                  }
                },
                "required": ["type", "bots"],
                "additionalProperties": false
              },
              {
                "type": "object",
                "properties": {
                  "type": {
                    "type": "string",
                    "const": "search"
                  },
                  "search_queries": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  }
                },
                "required": ["type", "search_queries"],
                "additionalProperties": false
              }
            ]
          },
          "impression_frequency": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "website_name": {
            "type": "string"
          },
          "website_photo": {
            "type": "object",
            "properties": {
              "photo_id": {
                "type": "string"
              },
              "photo_url": {
                "type": "string"
              }
            },
            "required": ["photo_id", "photo_url"],
            "additionalProperties": false
          },
          "button": {
            "type": "string",
            "enum": [
              "subscribe",
              "view",
              "read",
              "learn_more",
              "download",
              "open",
              "sign_up",
              "buy",
              "order",
              "play",
              "try",
              "leave_request",
              ""
            ]
          },
          "conversion_event_id": {
            "type": "string"
          },
          "additional_info": {
            "type": "string"
          },
          "show_userpic": {
            "type": "boolean"
          },
          "spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "remaining_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_spent_budget": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "daily_budget_limit": {
            "type": "number",
            "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
          },
          "views": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "opens": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "clicks": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "actions": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "joins": {
            "description": "Deprecated alias of actions retained by Telegram for backward compatibility.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "action_type": {
            "type": "string",
            "enum": [
              "join",
              "start_bot",
              "launch_miniapp",
              "send_message",
              "page_view",
              "landing_view",
              "add_to_cart",
              "add_to_wishlist",
              "customize_product",
              "initiate_checkout",
              "add_payment_info",
              "purchase",
              "contact",
              "lead",
              "schedule",
              "complete_registration",
              "submit_application",
              "start_trial",
              "subscribe",
              "view_content",
              "search",
              "find_location",
              "donate",
              "custom"
            ]
          },
          "created_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "is_paused": {
            "type": "boolean"
          },
          "activate_date": {
            "description": "Unix timestamp in seconds for activation; native provider timing rules apply.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "deactivate_date": {
            "description": "Unix timestamp in seconds for stopping delivery.",
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "schedule": {
            "type": "object",
            "properties": {
              "week_hours_mask": {
                "minItems": 7,
                "maxItems": 7,
                "type": "array",
                "items": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 16777215
                },
                "description": "Seven native 24-bit day masks; each enabled bit selects one hour. Preserve provider day/hour ordering."
              },
              "timezone": {
                "description": "Fixed UTC offset in seconds; use a permitted native offset, not an IANA timezone name.",
                "anyOf": [
                  {
                    "type": "number",
                    "const": -43200
                  },
                  {
                    "type": "number",
                    "const": -39600
                  },
                  {
                    "type": "number",
                    "const": -36000
                  },
                  {
                    "type": "number",
                    "const": -34200
                  },
                  {
                    "type": "number",
                    "const": -32400
                  },
                  {
                    "type": "number",
                    "const": -28800
                  },
                  {
                    "type": "number",
                    "const": -25200
                  },
                  {
                    "type": "number",
                    "const": -21600
                  },
                  {
                    "type": "number",
                    "const": -18000
                  },
                  {
                    "type": "number",
                    "const": -14400
                  },
                  {
                    "type": "number",
                    "const": -12600
                  },
                  {
                    "type": "number",
                    "const": -10800
                  },
                  {
                    "type": "number",
                    "const": -9000
                  },
                  {
                    "type": "number",
                    "const": -7200
                  },
                  {
                    "type": "number",
                    "const": -3600
                  },
                  {
                    "type": "number",
                    "const": 0
                  },
                  {
                    "type": "number",
                    "const": 3600
                  },
                  {
                    "type": "number",
                    "const": 7200
                  },
                  {
                    "type": "number",
                    "const": 10800
                  },
                  {
                    "type": "number",
                    "const": 12600
                  },
                  {
                    "type": "number",
                    "const": 14400
                  },
                  {
                    "type": "number",
                    "const": 16200
                  },
                  {
                    "type": "number",
                    "const": 18000
                  },
                  {
                    "type": "number",
                    "const": 19800
                  },
                  {
                    "type": "number",
                    "const": 20700
                  },
                  {
                    "type": "number",
                    "const": 21600
                  },
                  {
                    "type": "number",
                    "const": 23400
                  },
                  {
                    "type": "number",
                    "const": 25200
                  },
                  {
                    "type": "number",
                    "const": 28800
                  },
                  {
                    "type": "number",
                    "const": 31500
                  },
                  {
                    "type": "number",
                    "const": 32400
                  },
                  {
                    "type": "number",
                    "const": 34200
                  },
                  {
                    "type": "number",
                    "const": 36000
                  },
                  {
                    "type": "number",
                    "const": 37800
                  },
                  {
                    "type": "number",
                    "const": 39600
                  },
                  {
                    "type": "number",
                    "const": 43200
                  },
                  {
                    "type": "number",
                    "const": 45900
                  },
                  {
                    "type": "number",
                    "const": 46800
                  },
                  {
                    "type": "number",
                    "const": 49500
                  },
                  {
                    "type": "number",
                    "const": 50400
                  }
                ]
              },
              "use_viewer_timezone": {
                "type": "boolean"
              }
            },
            "required": ["week_hours_mask"],
            "additionalProperties": false
          },
          "status": {
            "type": "string",
            "enum": [
              "stopped",
              "ready_for_review",
              "in_review",
              "declined",
              "active",
              "on_hold"
            ]
          },
          "decline_reason": {
            "type": "object",
            "properties": {
              "text": {
                "type": "string"
              },
              "description_html": {
                "type": "string"
              }
            },
            "required": ["text", "description_html"],
            "additionalProperties": false
          }
        },
        "required": [
          "ad_id",
          "title",
          "currency",
          "text",
          "promote_url",
          "cpm",
          "placement",
          "spent_budget",
          "remaining_budget",
          "views",
          "actions",
          "created_date",
          "status"
        ],
        "additionalProperties": false
      },
      "OfficialdeleteAdResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "boolean",
        "const": true
      },
      "OfficialgetAdsByIdResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "ad_id": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "title": {
              "type": "string"
            },
            "currency": {
              "type": "string",
              "enum": ["EUR", "TON", "XTR"]
            },
            "text": {
              "type": "string"
            },
            "photo": {
              "type": "object",
              "properties": {
                "photo_id": {
                  "type": "string"
                },
                "photo_url": {
                  "type": "string"
                }
              },
              "required": ["photo_id", "photo_url"],
              "additionalProperties": false
            },
            "video": {
              "type": "object",
              "properties": {
                "video_id": {
                  "type": "string"
                },
                "video_url": {
                  "type": "string"
                }
              },
              "required": ["video_id", "video_url"],
              "additionalProperties": false
            },
            "promote_url": {
              "type": "string"
            },
            "cpm": {
              "type": "number",
              "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
            },
            "placement": {
              "type": "string",
              "enum": [
                "channel_post",
                "bot_banner",
                "search_result",
                "video_banner"
              ]
            },
            "target": {
              "oneOf": [
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "channels"
                    },
                    "languages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "language_code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": ["language_code", "name"],
                        "additionalProperties": false
                      }
                    },
                    "topics": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "topic_id": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": ["topic_id", "name"],
                        "additionalProperties": false
                      }
                    },
                    "exclude_topics": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "topic_id": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": ["topic_id", "name"],
                        "additionalProperties": false
                      }
                    },
                    "channels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "channel_id": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "title": {
                            "type": "string"
                          },
                          "username": {
                            "type": "string"
                          },
                          "photo_url": {
                            "type": "string"
                          }
                        },
                        "required": ["channel_id"],
                        "additionalProperties": false
                      }
                    },
                    "exclude_channels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "channel_id": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "title": {
                            "type": "string"
                          },
                          "username": {
                            "type": "string"
                          },
                          "photo_url": {
                            "type": "string"
                          }
                        },
                        "required": ["channel_id"],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": ["type"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "users"
                    },
                    "countries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "country_code": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": ["country_code", "name"],
                        "additionalProperties": false
                      }
                    },
                    "locations": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "location_id": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "name": {
                            "type": "string"
                          },
                          "country_code": {
                            "type": "string",
                            "pattern": "^[A-Z]{2}$"
                          },
                          "region": {
                            "type": "string"
                          }
                        },
                        "required": ["location_id", "name"],
                        "additionalProperties": false
                      }
                    },
                    "languages": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "language_code": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": ["language_code", "name"],
                        "additionalProperties": false
                      }
                    },
                    "topics": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "topic_id": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": ["topic_id", "name"],
                        "additionalProperties": false
                      }
                    },
                    "intersect_topics": {
                      "type": "boolean"
                    },
                    "exclude_topics": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "topic_id": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "name": {
                            "type": "string"
                          }
                        },
                        "required": ["topic_id", "name"],
                        "additionalProperties": false
                      }
                    },
                    "channels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "channel_id": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "title": {
                            "type": "string"
                          },
                          "username": {
                            "type": "string"
                          },
                          "photo_url": {
                            "type": "string"
                          }
                        },
                        "required": ["channel_id"],
                        "additionalProperties": false
                      }
                    },
                    "exclude_channels": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "channel_id": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "title": {
                            "type": "string"
                          },
                          "username": {
                            "type": "string"
                          },
                          "photo_url": {
                            "type": "string"
                          }
                        },
                        "required": ["channel_id"],
                        "additionalProperties": false
                      }
                    },
                    "audiences": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "audience_id": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "title": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "ads_count": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "created_date": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "updated_date": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "audience_id",
                          "title",
                          "size",
                          "ads_count",
                          "created_date",
                          "updated_date"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "exclude_audiences": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "audience_id": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "title": {
                            "type": "string"
                          },
                          "size": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "ads_count": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "created_date": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "updated_date": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "audience_id",
                          "title",
                          "size",
                          "ads_count",
                          "created_date",
                          "updated_date"
                        ],
                        "additionalProperties": false
                      }
                    },
                    "device": {
                      "type": "string",
                      "enum": ["ios", "android", "mobile", "desktop"]
                    },
                    "exclude_political_channels": {
                      "type": "boolean"
                    },
                    "political_channels_only": {
                      "type": "boolean"
                    }
                  },
                  "required": ["type", "countries"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "bots"
                    },
                    "bots": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "bot_id": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "title": {
                            "type": "string"
                          },
                          "username": {
                            "type": "string"
                          },
                          "photo_url": {
                            "type": "string"
                          }
                        },
                        "required": ["bot_id"],
                        "additionalProperties": false
                      }
                    }
                  },
                  "required": ["type", "bots"],
                  "additionalProperties": false
                },
                {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string",
                      "const": "search"
                    },
                    "search_queries": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    }
                  },
                  "required": ["type", "search_queries"],
                  "additionalProperties": false
                }
              ]
            },
            "impression_frequency": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "website_name": {
              "type": "string"
            },
            "website_photo": {
              "type": "object",
              "properties": {
                "photo_id": {
                  "type": "string"
                },
                "photo_url": {
                  "type": "string"
                }
              },
              "required": ["photo_id", "photo_url"],
              "additionalProperties": false
            },
            "button": {
              "type": "string",
              "enum": [
                "subscribe",
                "view",
                "read",
                "learn_more",
                "download",
                "open",
                "sign_up",
                "buy",
                "order",
                "play",
                "try",
                "leave_request",
                ""
              ]
            },
            "conversion_event_id": {
              "type": "string"
            },
            "additional_info": {
              "type": "string"
            },
            "show_userpic": {
              "type": "boolean"
            },
            "spent_budget": {
              "type": "number",
              "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
            },
            "remaining_budget": {
              "type": "number",
              "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
            },
            "daily_spent_budget": {
              "type": "number",
              "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
            },
            "daily_budget_limit": {
              "type": "number",
              "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
            },
            "views": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "opens": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "clicks": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "actions": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "joins": {
              "description": "Deprecated alias of actions retained by Telegram for backward compatibility.",
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "action_type": {
              "type": "string",
              "enum": [
                "join",
                "start_bot",
                "launch_miniapp",
                "send_message",
                "page_view",
                "landing_view",
                "add_to_cart",
                "add_to_wishlist",
                "customize_product",
                "initiate_checkout",
                "add_payment_info",
                "purchase",
                "contact",
                "lead",
                "schedule",
                "complete_registration",
                "submit_application",
                "start_trial",
                "subscribe",
                "view_content",
                "search",
                "find_location",
                "donate",
                "custom"
              ]
            },
            "created_date": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "is_paused": {
              "type": "boolean"
            },
            "activate_date": {
              "description": "Unix timestamp in seconds for activation; native provider timing rules apply.",
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "deactivate_date": {
              "description": "Unix timestamp in seconds for stopping delivery.",
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "schedule": {
              "type": "object",
              "properties": {
                "week_hours_mask": {
                  "minItems": 7,
                  "maxItems": 7,
                  "type": "array",
                  "items": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 16777215
                  },
                  "description": "Seven native 24-bit day masks; each enabled bit selects one hour. Preserve provider day/hour ordering."
                },
                "timezone": {
                  "description": "Fixed UTC offset in seconds; use a permitted native offset, not an IANA timezone name.",
                  "anyOf": [
                    {
                      "type": "number",
                      "const": -43200
                    },
                    {
                      "type": "number",
                      "const": -39600
                    },
                    {
                      "type": "number",
                      "const": -36000
                    },
                    {
                      "type": "number",
                      "const": -34200
                    },
                    {
                      "type": "number",
                      "const": -32400
                    },
                    {
                      "type": "number",
                      "const": -28800
                    },
                    {
                      "type": "number",
                      "const": -25200
                    },
                    {
                      "type": "number",
                      "const": -21600
                    },
                    {
                      "type": "number",
                      "const": -18000
                    },
                    {
                      "type": "number",
                      "const": -14400
                    },
                    {
                      "type": "number",
                      "const": -12600
                    },
                    {
                      "type": "number",
                      "const": -10800
                    },
                    {
                      "type": "number",
                      "const": -9000
                    },
                    {
                      "type": "number",
                      "const": -7200
                    },
                    {
                      "type": "number",
                      "const": -3600
                    },
                    {
                      "type": "number",
                      "const": 0
                    },
                    {
                      "type": "number",
                      "const": 3600
                    },
                    {
                      "type": "number",
                      "const": 7200
                    },
                    {
                      "type": "number",
                      "const": 10800
                    },
                    {
                      "type": "number",
                      "const": 12600
                    },
                    {
                      "type": "number",
                      "const": 14400
                    },
                    {
                      "type": "number",
                      "const": 16200
                    },
                    {
                      "type": "number",
                      "const": 18000
                    },
                    {
                      "type": "number",
                      "const": 19800
                    },
                    {
                      "type": "number",
                      "const": 20700
                    },
                    {
                      "type": "number",
                      "const": 21600
                    },
                    {
                      "type": "number",
                      "const": 23400
                    },
                    {
                      "type": "number",
                      "const": 25200
                    },
                    {
                      "type": "number",
                      "const": 28800
                    },
                    {
                      "type": "number",
                      "const": 31500
                    },
                    {
                      "type": "number",
                      "const": 32400
                    },
                    {
                      "type": "number",
                      "const": 34200
                    },
                    {
                      "type": "number",
                      "const": 36000
                    },
                    {
                      "type": "number",
                      "const": 37800
                    },
                    {
                      "type": "number",
                      "const": 39600
                    },
                    {
                      "type": "number",
                      "const": 43200
                    },
                    {
                      "type": "number",
                      "const": 45900
                    },
                    {
                      "type": "number",
                      "const": 46800
                    },
                    {
                      "type": "number",
                      "const": 49500
                    },
                    {
                      "type": "number",
                      "const": 50400
                    }
                  ]
                },
                "use_viewer_timezone": {
                  "type": "boolean"
                }
              },
              "required": ["week_hours_mask"],
              "additionalProperties": false
            },
            "status": {
              "type": "string",
              "enum": [
                "stopped",
                "ready_for_review",
                "in_review",
                "declined",
                "active",
                "on_hold"
              ]
            },
            "decline_reason": {
              "type": "object",
              "properties": {
                "text": {
                  "type": "string"
                },
                "description_html": {
                  "type": "string"
                }
              },
              "required": ["text", "description_html"],
              "additionalProperties": false
            }
          },
          "required": [
            "ad_id",
            "title",
            "currency",
            "text",
            "promote_url",
            "cpm",
            "placement",
            "spent_budget",
            "remaining_budget",
            "views",
            "actions",
            "created_date",
            "status"
          ],
          "additionalProperties": false
        }
      },
      "OfficialgetAdsListResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "total_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "ads": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ad_id": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "title": {
                  "type": "string"
                },
                "currency": {
                  "type": "string",
                  "enum": ["EUR", "TON", "XTR"]
                },
                "text": {
                  "type": "string"
                },
                "photo": {
                  "type": "object",
                  "properties": {
                    "photo_id": {
                      "type": "string"
                    },
                    "photo_url": {
                      "type": "string"
                    }
                  },
                  "required": ["photo_id", "photo_url"],
                  "additionalProperties": false
                },
                "video": {
                  "type": "object",
                  "properties": {
                    "video_id": {
                      "type": "string"
                    },
                    "video_url": {
                      "type": "string"
                    }
                  },
                  "required": ["video_id", "video_url"],
                  "additionalProperties": false
                },
                "promote_url": {
                  "type": "string"
                },
                "cpm": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                },
                "placement": {
                  "type": "string",
                  "enum": [
                    "channel_post",
                    "bot_banner",
                    "search_result",
                    "video_banner"
                  ]
                },
                "target": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "channels"
                        },
                        "languages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "language_code": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": ["language_code", "name"],
                            "additionalProperties": false
                          }
                        },
                        "topics": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "topic_id": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": ["topic_id", "name"],
                            "additionalProperties": false
                          }
                        },
                        "exclude_topics": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "topic_id": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": ["topic_id", "name"],
                            "additionalProperties": false
                          }
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channel_id": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "title": {
                                "type": "string"
                              },
                              "username": {
                                "type": "string"
                              },
                              "photo_url": {
                                "type": "string"
                              }
                            },
                            "required": ["channel_id"],
                            "additionalProperties": false
                          }
                        },
                        "exclude_channels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channel_id": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "title": {
                                "type": "string"
                              },
                              "username": {
                                "type": "string"
                              },
                              "photo_url": {
                                "type": "string"
                              }
                            },
                            "required": ["channel_id"],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": ["type"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "users"
                        },
                        "countries": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "country_code": {
                                "type": "string",
                                "pattern": "^[A-Z]{2}$"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": ["country_code", "name"],
                            "additionalProperties": false
                          }
                        },
                        "locations": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "location_id": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "name": {
                                "type": "string"
                              },
                              "country_code": {
                                "type": "string",
                                "pattern": "^[A-Z]{2}$"
                              },
                              "region": {
                                "type": "string"
                              }
                            },
                            "required": ["location_id", "name"],
                            "additionalProperties": false
                          }
                        },
                        "languages": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "language_code": {
                                "type": "string"
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": ["language_code", "name"],
                            "additionalProperties": false
                          }
                        },
                        "topics": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "topic_id": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": ["topic_id", "name"],
                            "additionalProperties": false
                          }
                        },
                        "intersect_topics": {
                          "type": "boolean"
                        },
                        "exclude_topics": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "topic_id": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "name": {
                                "type": "string"
                              }
                            },
                            "required": ["topic_id", "name"],
                            "additionalProperties": false
                          }
                        },
                        "channels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channel_id": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "title": {
                                "type": "string"
                              },
                              "username": {
                                "type": "string"
                              },
                              "photo_url": {
                                "type": "string"
                              }
                            },
                            "required": ["channel_id"],
                            "additionalProperties": false
                          }
                        },
                        "exclude_channels": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "channel_id": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "title": {
                                "type": "string"
                              },
                              "username": {
                                "type": "string"
                              },
                              "photo_url": {
                                "type": "string"
                              }
                            },
                            "required": ["channel_id"],
                            "additionalProperties": false
                          }
                        },
                        "audiences": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "audience_id": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "title": {
                                "type": "string"
                              },
                              "size": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "ads_count": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "created_date": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "updated_date": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "audience_id",
                              "title",
                              "size",
                              "ads_count",
                              "created_date",
                              "updated_date"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "exclude_audiences": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "audience_id": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "title": {
                                "type": "string"
                              },
                              "size": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "ads_count": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "created_date": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "updated_date": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "audience_id",
                              "title",
                              "size",
                              "ads_count",
                              "created_date",
                              "updated_date"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "device": {
                          "type": "string",
                          "enum": ["ios", "android", "mobile", "desktop"]
                        },
                        "exclude_political_channels": {
                          "type": "boolean"
                        },
                        "political_channels_only": {
                          "type": "boolean"
                        }
                      },
                      "required": ["type", "countries"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "bots"
                        },
                        "bots": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "bot_id": {
                                "type": "integer",
                                "minimum": -9007199254740991,
                                "maximum": 9007199254740991
                              },
                              "title": {
                                "type": "string"
                              },
                              "username": {
                                "type": "string"
                              },
                              "photo_url": {
                                "type": "string"
                              }
                            },
                            "required": ["bot_id"],
                            "additionalProperties": false
                          }
                        }
                      },
                      "required": ["type", "bots"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "search"
                        },
                        "search_queries": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        }
                      },
                      "required": ["type", "search_queries"],
                      "additionalProperties": false
                    }
                  ]
                },
                "impression_frequency": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "website_name": {
                  "type": "string"
                },
                "website_photo": {
                  "type": "object",
                  "properties": {
                    "photo_id": {
                      "type": "string"
                    },
                    "photo_url": {
                      "type": "string"
                    }
                  },
                  "required": ["photo_id", "photo_url"],
                  "additionalProperties": false
                },
                "button": {
                  "type": "string",
                  "enum": [
                    "subscribe",
                    "view",
                    "read",
                    "learn_more",
                    "download",
                    "open",
                    "sign_up",
                    "buy",
                    "order",
                    "play",
                    "try",
                    "leave_request",
                    ""
                  ]
                },
                "conversion_event_id": {
                  "type": "string"
                },
                "additional_info": {
                  "type": "string"
                },
                "show_userpic": {
                  "type": "boolean"
                },
                "spent_budget": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                },
                "remaining_budget": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                },
                "daily_spent_budget": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                },
                "daily_budget_limit": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                },
                "views": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "opens": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "clicks": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "actions": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "joins": {
                  "description": "Deprecated alias of actions retained by Telegram for backward compatibility.",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "action_type": {
                  "type": "string",
                  "enum": [
                    "join",
                    "start_bot",
                    "launch_miniapp",
                    "send_message",
                    "page_view",
                    "landing_view",
                    "add_to_cart",
                    "add_to_wishlist",
                    "customize_product",
                    "initiate_checkout",
                    "add_payment_info",
                    "purchase",
                    "contact",
                    "lead",
                    "schedule",
                    "complete_registration",
                    "submit_application",
                    "start_trial",
                    "subscribe",
                    "view_content",
                    "search",
                    "find_location",
                    "donate",
                    "custom"
                  ]
                },
                "created_date": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "is_paused": {
                  "type": "boolean"
                },
                "activate_date": {
                  "description": "Unix timestamp in seconds for activation; native provider timing rules apply.",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "deactivate_date": {
                  "description": "Unix timestamp in seconds for stopping delivery.",
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "schedule": {
                  "type": "object",
                  "properties": {
                    "week_hours_mask": {
                      "minItems": 7,
                      "maxItems": 7,
                      "type": "array",
                      "items": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 16777215
                      },
                      "description": "Seven native 24-bit day masks; each enabled bit selects one hour. Preserve provider day/hour ordering."
                    },
                    "timezone": {
                      "description": "Fixed UTC offset in seconds; use a permitted native offset, not an IANA timezone name.",
                      "anyOf": [
                        {
                          "type": "number",
                          "const": -43200
                        },
                        {
                          "type": "number",
                          "const": -39600
                        },
                        {
                          "type": "number",
                          "const": -36000
                        },
                        {
                          "type": "number",
                          "const": -34200
                        },
                        {
                          "type": "number",
                          "const": -32400
                        },
                        {
                          "type": "number",
                          "const": -28800
                        },
                        {
                          "type": "number",
                          "const": -25200
                        },
                        {
                          "type": "number",
                          "const": -21600
                        },
                        {
                          "type": "number",
                          "const": -18000
                        },
                        {
                          "type": "number",
                          "const": -14400
                        },
                        {
                          "type": "number",
                          "const": -12600
                        },
                        {
                          "type": "number",
                          "const": -10800
                        },
                        {
                          "type": "number",
                          "const": -9000
                        },
                        {
                          "type": "number",
                          "const": -7200
                        },
                        {
                          "type": "number",
                          "const": -3600
                        },
                        {
                          "type": "number",
                          "const": 0
                        },
                        {
                          "type": "number",
                          "const": 3600
                        },
                        {
                          "type": "number",
                          "const": 7200
                        },
                        {
                          "type": "number",
                          "const": 10800
                        },
                        {
                          "type": "number",
                          "const": 12600
                        },
                        {
                          "type": "number",
                          "const": 14400
                        },
                        {
                          "type": "number",
                          "const": 16200
                        },
                        {
                          "type": "number",
                          "const": 18000
                        },
                        {
                          "type": "number",
                          "const": 19800
                        },
                        {
                          "type": "number",
                          "const": 20700
                        },
                        {
                          "type": "number",
                          "const": 21600
                        },
                        {
                          "type": "number",
                          "const": 23400
                        },
                        {
                          "type": "number",
                          "const": 25200
                        },
                        {
                          "type": "number",
                          "const": 28800
                        },
                        {
                          "type": "number",
                          "const": 31500
                        },
                        {
                          "type": "number",
                          "const": 32400
                        },
                        {
                          "type": "number",
                          "const": 34200
                        },
                        {
                          "type": "number",
                          "const": 36000
                        },
                        {
                          "type": "number",
                          "const": 37800
                        },
                        {
                          "type": "number",
                          "const": 39600
                        },
                        {
                          "type": "number",
                          "const": 43200
                        },
                        {
                          "type": "number",
                          "const": 45900
                        },
                        {
                          "type": "number",
                          "const": 46800
                        },
                        {
                          "type": "number",
                          "const": 49500
                        },
                        {
                          "type": "number",
                          "const": 50400
                        }
                      ]
                    },
                    "use_viewer_timezone": {
                      "type": "boolean"
                    }
                  },
                  "required": ["week_hours_mask"],
                  "additionalProperties": false
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "stopped",
                    "ready_for_review",
                    "in_review",
                    "declined",
                    "active",
                    "on_hold"
                  ]
                },
                "decline_reason": {
                  "type": "object",
                  "properties": {
                    "text": {
                      "type": "string"
                    },
                    "description_html": {
                      "type": "string"
                    }
                  },
                  "required": ["text", "description_html"],
                  "additionalProperties": false
                }
              },
              "required": [
                "ad_id",
                "title",
                "currency",
                "text",
                "promote_url",
                "cpm",
                "placement",
                "spent_budget",
                "remaining_budget",
                "views",
                "actions",
                "created_date",
                "status"
              ],
              "additionalProperties": false
            }
          },
          "next_offset": {
            "type": "string"
          }
        },
        "required": ["total_count", "ads"],
        "additionalProperties": false
      },
      "OfficialgetAdTransactionsListResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "total_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "transactions": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "peer": {
                  "oneOf": [
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "account"
                        }
                      },
                      "required": ["type"],
                      "additionalProperties": false
                    },
                    {
                      "type": "object",
                      "properties": {
                        "type": {
                          "type": "string",
                          "const": "views"
                        },
                        "views": {
                          "type": "integer",
                          "minimum": 0,
                          "maximum": 9007199254740991
                        }
                      },
                      "required": ["type", "views"],
                      "additionalProperties": false
                    }
                  ]
                },
                "date": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "currency": {
                  "type": "string",
                  "enum": ["EUR", "TON", "XTR"]
                },
                "amount": {
                  "type": "number",
                  "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
                }
              },
              "required": ["peer", "date", "currency", "amount"],
              "additionalProperties": false
            }
          },
          "next_offset": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              }
            ],
            "description": "Next transaction offset; Telegram returns an integer or a documented string. Use its integer value as the next request offset."
          }
        },
        "required": ["total_count", "transactions"],
        "additionalProperties": false
      },
      "OfficialgetAdStatsResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "from_time": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Inclusive Unix timestamp in seconds."
            },
            "to_time": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991,
              "description": "Exclusive Unix timestamp in seconds; at most 1000 intervals after from_time."
            },
            "views": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "opens": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "clicks": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "actions": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "joins": {
              "description": "Deprecated alias of actions retained by Telegram for backward compatibility.",
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "currency": {
              "type": "string",
              "enum": ["EUR", "TON", "XTR"]
            },
            "spent_budget": {
              "type": "number",
              "description": "Amount in the selected account currency (EUR, TON or XTR), not integer cents or converted currency."
            }
          },
          "required": [
            "from_time",
            "to_time",
            "views",
            "opens",
            "clicks",
            "actions",
            "currency",
            "spent_budget"
          ],
          "additionalProperties": false
        }
      },
      "OfficialcreateAudienceResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "audience_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "ads_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "created_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "updated_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "audience_id",
          "title",
          "size",
          "ads_count",
          "created_date",
          "updated_date"
        ],
        "additionalProperties": false
      },
      "OfficialeditAudienceResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "audience_id": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "size": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "ads_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "created_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "updated_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": [
          "audience_id",
          "title",
          "size",
          "ads_count",
          "created_date",
          "updated_date"
        ],
        "additionalProperties": false
      },
      "OfficialdeleteAudienceResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "boolean",
        "const": true
      },
      "OfficialgetAudiencesByIdResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "audience_id": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "title": {
              "type": "string"
            },
            "size": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "ads_count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "created_date": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "updated_date": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            }
          },
          "required": [
            "audience_id",
            "title",
            "size",
            "ads_count",
            "created_date",
            "updated_date"
          ],
          "additionalProperties": false
        }
      },
      "OfficialgetAudiencesListResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "total_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "audiences": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "audience_id": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "title": {
                  "type": "string"
                },
                "size": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "ads_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "created_date": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "updated_date": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "audience_id",
                "title",
                "size",
                "ads_count",
                "created_date",
                "updated_date"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": ["total_count", "audiences"],
        "additionalProperties": false
      },
      "OfficialcreatePixelResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "pixel_id": {
            "type": "string"
          },
          "code_snippet": {
            "type": "string"
          }
        },
        "required": ["pixel_id", "code_snippet"],
        "additionalProperties": false
      },
      "OfficialgetPixelResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "pixel_id": {
            "type": "string"
          },
          "code_snippet": {
            "type": "string"
          }
        },
        "required": ["pixel_id", "code_snippet"],
        "additionalProperties": false
      },
      "OfficialcreatePixelEventResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "page_view",
              "landing_view",
              "add_to_cart",
              "add_to_wishlist",
              "customize_product",
              "initiate_checkout",
              "add_payment_info",
              "purchase",
              "contact",
              "lead",
              "schedule",
              "complete_registration",
              "submit_application",
              "start_trial",
              "subscribe",
              "view_content",
              "search",
              "find_location",
              "donate",
              "custom"
            ]
          },
          "status": {
            "type": "string",
            "enum": ["inactive", "active"]
          },
          "ads_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "created_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "last_triggered_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "auto_created": {
            "type": "boolean"
          },
          "code_snippet": {
            "type": "string"
          }
        },
        "required": [
          "event_id",
          "title",
          "type",
          "status",
          "ads_count",
          "created_date"
        ],
        "additionalProperties": false
      },
      "OfficialeditPixelEventResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "event_id": {
            "type": "string"
          },
          "title": {
            "type": "string"
          },
          "type": {
            "type": "string",
            "enum": [
              "page_view",
              "landing_view",
              "add_to_cart",
              "add_to_wishlist",
              "customize_product",
              "initiate_checkout",
              "add_payment_info",
              "purchase",
              "contact",
              "lead",
              "schedule",
              "complete_registration",
              "submit_application",
              "start_trial",
              "subscribe",
              "view_content",
              "search",
              "find_location",
              "donate",
              "custom"
            ]
          },
          "status": {
            "type": "string",
            "enum": ["inactive", "active"]
          },
          "ads_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "created_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "last_triggered_date": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "auto_created": {
            "type": "boolean"
          },
          "code_snippet": {
            "type": "string"
          }
        },
        "required": [
          "event_id",
          "title",
          "type",
          "status",
          "ads_count",
          "created_date"
        ],
        "additionalProperties": false
      },
      "OfficialdeletePixelEventResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "boolean",
        "const": true
      },
      "OfficialgetPixelEventsByIdResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "event_id": {
              "type": "string"
            },
            "title": {
              "type": "string"
            },
            "type": {
              "type": "string",
              "enum": [
                "page_view",
                "landing_view",
                "add_to_cart",
                "add_to_wishlist",
                "customize_product",
                "initiate_checkout",
                "add_payment_info",
                "purchase",
                "contact",
                "lead",
                "schedule",
                "complete_registration",
                "submit_application",
                "start_trial",
                "subscribe",
                "view_content",
                "search",
                "find_location",
                "donate",
                "custom"
              ]
            },
            "status": {
              "type": "string",
              "enum": ["inactive", "active"]
            },
            "ads_count": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "created_date": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "last_triggered_date": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "auto_created": {
              "type": "boolean"
            },
            "code_snippet": {
              "type": "string"
            }
          },
          "required": [
            "event_id",
            "title",
            "type",
            "status",
            "ads_count",
            "created_date"
          ],
          "additionalProperties": false
        }
      },
      "OfficialgetPixelEventsListResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "total_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "events": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "event_id": {
                  "type": "string"
                },
                "title": {
                  "type": "string"
                },
                "type": {
                  "type": "string",
                  "enum": [
                    "page_view",
                    "landing_view",
                    "add_to_cart",
                    "add_to_wishlist",
                    "customize_product",
                    "initiate_checkout",
                    "add_payment_info",
                    "purchase",
                    "contact",
                    "lead",
                    "schedule",
                    "complete_registration",
                    "submit_application",
                    "start_trial",
                    "subscribe",
                    "view_content",
                    "search",
                    "find_location",
                    "donate",
                    "custom"
                  ]
                },
                "status": {
                  "type": "string",
                  "enum": ["inactive", "active"]
                },
                "ads_count": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "created_date": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "last_triggered_date": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "auto_created": {
                  "type": "boolean"
                },
                "code_snippet": {
                  "type": "string"
                }
              },
              "required": [
                "event_id",
                "title",
                "type",
                "status",
                "ads_count",
                "created_date"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": ["total_count", "events"],
        "additionalProperties": false
      },
      "OfficialgetTargetLanguagesListResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "language_code": {
              "type": "string"
            },
            "name": {
              "type": "string"
            }
          },
          "required": ["language_code", "name"],
          "additionalProperties": false
        }
      },
      "OfficialgetTargetTopicsListResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "topic_id": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "name": {
              "type": "string"
            }
          },
          "required": ["topic_id", "name"],
          "additionalProperties": false
        }
      },
      "OfficialgetTargetCountriesListResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "country_code": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            "name": {
              "type": "string"
            }
          },
          "required": ["country_code", "name"],
          "additionalProperties": false
        }
      },
      "OfficialgetTargetLocationsByIdResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "location_id": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "name": {
              "type": "string"
            },
            "country_code": {
              "type": "string",
              "pattern": "^[A-Z]{2}$"
            },
            "region": {
              "type": "string"
            }
          },
          "required": ["location_id", "name"],
          "additionalProperties": false
        }
      },
      "OfficialgetTargetLocationsListResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "total_count": {
            "type": "integer",
            "minimum": 0,
            "maximum": 9007199254740991
          },
          "locations": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "location_id": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "name": {
                  "type": "string"
                },
                "country_code": {
                  "type": "string",
                  "pattern": "^[A-Z]{2}$"
                },
                "region": {
                  "type": "string"
                }
              },
              "required": ["location_id", "name"],
              "additionalProperties": false
            }
          },
          "next_offset": {
            "type": "string"
          }
        },
        "required": ["total_count", "locations"],
        "additionalProperties": false
      },
      "OfficialgetTargetChannelResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "channel_id": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "photo_url": {
            "type": "string"
          }
        },
        "required": ["channel_id"],
        "additionalProperties": false
      },
      "OfficialgetTargetBotResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "bot_id": {
            "type": "integer",
            "minimum": -9007199254740991,
            "maximum": 9007199254740991
          },
          "title": {
            "type": "string"
          },
          "username": {
            "type": "string"
          },
          "photo_url": {
            "type": "string"
          }
        },
        "required": ["bot_id"],
        "additionalProperties": false
      },
      "AuthRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "codeChallenge": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "state": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{32,256}$"
          },
          "redirectUri": {
            "type": "string",
            "pattern": "^https:\\/\\/[a-p]{32}\\.chromiumapp\\.org\\/telemetrio$"
          },
          "accountTitle": {
            "type": "string",
            "minLength": 1,
            "maxLength": 128
          },
          "accountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "flowId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "analyticsClientId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,64}$"
          }
        },
        "required": ["codeChallenge", "state", "redirectUri"],
        "additionalProperties": false
      },
      "AuthToken": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "code": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{43}$"
          },
          "codeVerifier": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._~-]{43,128}$"
          },
          "redirectUri": {
            "type": "string",
            "pattern": "^https:\\/\\/[a-p]{32}\\.chromiumapp\\.org\\/telemetrio$"
          }
        },
        "required": ["code", "codeVerifier", "redirectUri"],
        "additionalProperties": false
      },
      "AuthApproval": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "ownerId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "displayName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "defaultPermissions": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  }
                ],
                "items": false,
                "minItems": 1,
                "maxItems": 1
              },
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  },
                  {
                    "type": "string",
                    "const": "manage_ads"
                  },
                  {
                    "type": "string",
                    "const": "manage_budgets"
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              }
            ]
          },
          "mcpTargets": {
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "mcpConnectionId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,256}$"
                },
                "clientId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "clientName": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                }
              },
              "required": ["mcpConnectionId", "clientId", "clientName"],
              "additionalProperties": false
            }
          },
          "accounts": {
            "anyOf": [
              {
                "type": "string",
                "const": "all"
              },
              {
                "maxItems": 100,
                "type": "array",
                "items": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,256}$"
                }
              }
            ]
          },
          "rememberChoice": {
            "type": "boolean",
            "const": true
          }
        },
        "required": ["ownerId", "displayName"],
        "additionalProperties": false
      },
      "AuthRequestResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "loginUrl": {
            "type": "string",
            "format": "uri"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": ["requestId", "loginUrl", "expiresAt"],
        "additionalProperties": false
      },
      "AuthContext": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "requestId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "accountTitle": {
            "type": "string"
          },
          "accountId": {
            "type": "string"
          },
          "flowId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "analyticsClientId": {
            "type": "string"
          }
        },
        "required": ["requestId", "expiresAt"],
        "additionalProperties": false
      },
      "AuthApprovalResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "redirectUrl": {
            "type": "string",
            "format": "uri"
          }
        },
        "required": ["redirectUrl"],
        "additionalProperties": false
      },
      "AiAccessResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "clients": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "ref": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "clientName": {
                  "type": "string"
                },
                "granted": {
                  "type": "boolean"
                }
              },
              "required": ["ref", "clientName", "granted"],
              "additionalProperties": false
            }
          },
          "linkedAccounts": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ],
            "description": "Linked accounts granted to each client besides the root; null when they could not be listed or verified"
          }
        },
        "required": ["clients", "linkedAccounts"],
        "additionalProperties": false
      },
      "AiChoice": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "choice": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "clients": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "name": {
                          "type": "string"
                        }
                      },
                      "required": ["name"],
                      "additionalProperties": false
                    }
                  },
                  "permissions": {
                    "anyOf": [
                      {
                        "type": "array",
                        "prefixItems": [
                          {
                            "type": "string",
                            "const": "read"
                          }
                        ],
                        "items": false,
                        "minItems": 1,
                        "maxItems": 1
                      },
                      {
                        "type": "array",
                        "prefixItems": [
                          {
                            "type": "string",
                            "const": "read"
                          },
                          {
                            "type": "string",
                            "const": "manage_ads"
                          },
                          {
                            "type": "string",
                            "const": "manage_budgets"
                          }
                        ],
                        "items": false,
                        "minItems": 3,
                        "maxItems": 3
                      }
                    ]
                  },
                  "expiresAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  }
                },
                "required": ["clients", "permissions", "expiresAt"],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["choice"],
        "additionalProperties": false
      },
      "AiChoiceIntentRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "flowId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": ["flowId"],
        "additionalProperties": false
      },
      "AiChoiceIntentResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          }
        },
        "required": ["expiresAt"],
        "additionalProperties": false
      },
      "AiGrantRetryRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "refs": {
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "integer",
              "minimum": 0,
              "maximum": 19
            }
          },
          "flowId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          }
        },
        "required": ["refs"],
        "additionalProperties": false
      },
      "AiGrantRetryResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "aiAccess": {
            "type": "object",
            "properties": {
              "clients": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "ref": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "clientName": {
                      "type": "string"
                    },
                    "granted": {
                      "type": "boolean"
                    }
                  },
                  "required": ["ref", "clientName", "granted"],
                  "additionalProperties": false
                }
              },
              "linkedAccounts": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Linked accounts granted to each client besides the root; null when they could not be listed or verified"
              }
            },
            "required": ["clients", "linkedAccounts"],
            "additionalProperties": false
          }
        },
        "required": ["aiAccess"],
        "additionalProperties": false
      },
      "ExtensionSession": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              }
            },
            "required": ["id", "displayName"],
            "additionalProperties": false
          }
        },
        "required": ["expiresAt", "user"],
        "additionalProperties": false
      },
      "ExtensionToken": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "accessToken": {
            "type": "string"
          },
          "expiresAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "user": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "displayName": {
                "type": "string"
              }
            },
            "required": ["id", "displayName"],
            "additionalProperties": false
          },
          "defaultPermissions": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  }
                ],
                "items": false,
                "minItems": 1,
                "maxItems": 1
              },
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  },
                  {
                    "type": "string",
                    "const": "manage_ads"
                  },
                  {
                    "type": "string",
                    "const": "manage_budgets"
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              }
            ]
          }
        },
        "required": ["accessToken", "expiresAt", "user"],
        "additionalProperties": false
      },
      "McpGrantRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "connectionIds": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "accountAccess": {
            "minItems": 1,
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "connectionId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "accountId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,256}$"
                },
                "permissions": {
                  "minItems": 1,
                  "maxItems": 3,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": ["read", "manage_ads", "manage_budgets"]
                  }
                }
              },
              "required": ["connectionId", "accountId", "permissions"],
              "additionalProperties": false
            }
          },
          "ownerId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,128}$"
          },
          "clientId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "clientName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "mcpConnectionId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "source": {
            "type": "string",
            "enum": ["consent", "site"]
          }
        },
        "required": [
          "connectionIds",
          "ownerId",
          "clientId",
          "clientName",
          "mcpConnectionId",
          "source"
        ],
        "additionalProperties": false
      },
      "McpGrantCredential": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "accountAccess": {
            "minItems": 1,
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "connectionId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "accountId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,256}$"
                },
                "permissions": {
                  "minItems": 1,
                  "maxItems": 3,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": ["read", "manage_ads", "manage_budgets"]
                  }
                }
              },
              "required": ["connectionId", "accountId", "permissions"],
              "additionalProperties": false
            }
          },
          "scope": {
            "type": "string",
            "enum": [
              "telemetrio:ads:read",
              "telemetrio:ads:read telemetrio:ads:manage",
              "telemetrio:ads:read telemetrio:ads:budget",
              "telemetrio:ads:read telemetrio:ads:manage telemetrio:ads:budget"
            ]
          }
        },
        "required": ["id", "accountAccess", "scope"],
        "additionalProperties": false
      },
      "McpGrantAccountsRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "connectionIds": {
            "minItems": 1,
            "maxItems": 100,
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "accountAccess": {
            "minItems": 1,
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "connectionId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "accountId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,256}$"
                },
                "permissions": {
                  "minItems": 1,
                  "maxItems": 3,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": ["read", "manage_ads", "manage_budgets"]
                  }
                }
              },
              "required": ["connectionId", "accountId", "permissions"],
              "additionalProperties": false
            }
          }
        },
        "required": ["connectionIds", "accountAccess"],
        "additionalProperties": false
      },
      "McpGrantView": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "clientId": {
            "type": "string"
          },
          "clientName": {
            "type": "string"
          },
          "connectionIds": {
            "type": "array",
            "items": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            }
          },
          "accountAccess": {
            "minItems": 1,
            "maxItems": 10000,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "connectionId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "accountId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,256}$"
                },
                "permissions": {
                  "minItems": 1,
                  "maxItems": 3,
                  "type": "array",
                  "items": {
                    "type": "string",
                    "enum": ["read", "manage_ads", "manage_budgets"]
                  }
                }
              },
              "required": ["connectionId", "accountId", "permissions"],
              "additionalProperties": false
            }
          },
          "scope": {
            "type": "string",
            "enum": [
              "telemetrio:ads:read",
              "telemetrio:ads:read telemetrio:ads:manage",
              "telemetrio:ads:read telemetrio:ads:budget",
              "telemetrio:ads:read telemetrio:ads:manage telemetrio:ads:budget"
            ]
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "lastActivityAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "revokedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "mcpConnectionId": {
            "type": ["string", "null"]
          },
          "source": {
            "anyOf": [
              {
                "type": "string",
                "enum": ["consent", "site"]
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": [
          "id",
          "clientId",
          "clientName",
          "connectionIds",
          "accountAccess",
          "scope",
          "createdAt",
          "lastActivityAt",
          "revokedAt",
          "mcpConnectionId",
          "source"
        ],
        "additionalProperties": false
      },
      "McpGrantList": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "clientId": {
              "type": "string"
            },
            "clientName": {
              "type": "string"
            },
            "connectionIds": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "accountAccess": {
              "minItems": 1,
              "maxItems": 10000,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "accountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,256}$"
                  },
                  "permissions": {
                    "minItems": 1,
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": ["read", "manage_ads", "manage_budgets"]
                    }
                  }
                },
                "required": ["connectionId", "accountId", "permissions"],
                "additionalProperties": false
              }
            },
            "scope": {
              "type": "string",
              "enum": [
                "telemetrio:ads:read",
                "telemetrio:ads:read telemetrio:ads:manage",
                "telemetrio:ads:read telemetrio:ads:budget",
                "telemetrio:ads:read telemetrio:ads:manage telemetrio:ads:budget"
              ]
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "lastActivityAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revokedAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "mcpConnectionId": {
              "type": ["string", "null"]
            },
            "source": {
              "anyOf": [
                {
                  "type": "string",
                  "enum": ["consent", "site"]
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "id",
            "clientId",
            "clientName",
            "connectionIds",
            "accountAccess",
            "scope",
            "createdAt",
            "lastActivityAt",
            "revokedAt",
            "mcpConnectionId",
            "source"
          ],
          "additionalProperties": false
        }
      },
      "McpGrantPage": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "grants": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "clientId": {
                  "type": "string"
                },
                "clientName": {
                  "type": "string"
                },
                "connectionIds": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  }
                },
                "accountAccess": {
                  "minItems": 1,
                  "maxItems": 10000,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "connectionId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "accountId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,256}$"
                      },
                      "permissions": {
                        "minItems": 1,
                        "maxItems": 3,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": ["read", "manage_ads", "manage_budgets"]
                        }
                      }
                    },
                    "required": ["connectionId", "accountId", "permissions"],
                    "additionalProperties": false
                  }
                },
                "scope": {
                  "type": "string",
                  "enum": [
                    "telemetrio:ads:read",
                    "telemetrio:ads:read telemetrio:ads:manage",
                    "telemetrio:ads:read telemetrio:ads:budget",
                    "telemetrio:ads:read telemetrio:ads:manage telemetrio:ads:budget"
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "lastActivityAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "revokedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "mcpConnectionId": {
                  "type": ["string", "null"]
                },
                "source": {
                  "anyOf": [
                    {
                      "type": "string",
                      "enum": ["consent", "site"]
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "clientId",
                "clientName",
                "connectionIds",
                "accountAccess",
                "scope",
                "createdAt",
                "lastActivityAt",
                "revokedAt",
                "mcpConnectionId",
                "source"
              ],
              "additionalProperties": false
            }
          },
          "nextOffset": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["grants", "nextOffset"],
        "additionalProperties": false
      },
      "McpConnectionAccessRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "permissions": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  }
                ],
                "items": false,
                "minItems": 1,
                "maxItems": 1
              },
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  },
                  {
                    "type": "string",
                    "const": "manage_ads"
                  },
                  {
                    "type": "string",
                    "const": "manage_budgets"
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              }
            ]
          },
          "clientName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "accountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          }
        },
        "required": ["permissions"],
        "additionalProperties": false
      },
      "McpConnectionAccessResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "grant": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              },
              "clientId": {
                "type": "string"
              },
              "clientName": {
                "type": "string"
              },
              "connectionIds": {
                "type": "array",
                "items": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                }
              },
              "accountAccess": {
                "minItems": 1,
                "maxItems": 10000,
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "connectionId": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "accountId": {
                      "type": "string",
                      "pattern": "^[A-Za-z0-9_-]{1,256}$"
                    },
                    "permissions": {
                      "minItems": 1,
                      "maxItems": 3,
                      "type": "array",
                      "items": {
                        "type": "string",
                        "enum": ["read", "manage_ads", "manage_budgets"]
                      }
                    }
                  },
                  "required": ["connectionId", "accountId", "permissions"],
                  "additionalProperties": false
                }
              },
              "scope": {
                "type": "string",
                "enum": [
                  "telemetrio:ads:read",
                  "telemetrio:ads:read telemetrio:ads:manage",
                  "telemetrio:ads:read telemetrio:ads:budget",
                  "telemetrio:ads:read telemetrio:ads:manage telemetrio:ads:budget"
                ]
              },
              "createdAt": {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              "lastActivityAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "revokedAt": {
                "anyOf": [
                  {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  {
                    "type": "null"
                  }
                ]
              },
              "mcpConnectionId": {
                "type": ["string", "null"]
              },
              "source": {
                "anyOf": [
                  {
                    "type": "string",
                    "enum": ["consent", "site"]
                  },
                  {
                    "type": "null"
                  }
                ]
              }
            },
            "required": [
              "id",
              "clientId",
              "clientName",
              "connectionIds",
              "accountAccess",
              "scope",
              "createdAt",
              "lastActivityAt",
              "revokedAt",
              "mcpConnectionId",
              "source"
            ],
            "additionalProperties": false
          }
        },
        "required": ["grant"],
        "additionalProperties": false
      },
      "McpConnectionAccessRemoval": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "grant": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "clientId": {
                    "type": "string"
                  },
                  "clientName": {
                    "type": "string"
                  },
                  "connectionIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    }
                  },
                  "accountAccess": {
                    "minItems": 1,
                    "maxItems": 10000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "connectionId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "accountId": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,256}$"
                        },
                        "permissions": {
                          "minItems": 1,
                          "maxItems": 3,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": ["read", "manage_ads", "manage_budgets"]
                          }
                        }
                      },
                      "required": ["connectionId", "accountId", "permissions"],
                      "additionalProperties": false
                    }
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "telemetrio:ads:read",
                      "telemetrio:ads:read telemetrio:ads:manage",
                      "telemetrio:ads:read telemetrio:ads:budget",
                      "telemetrio:ads:read telemetrio:ads:manage telemetrio:ads:budget"
                    ]
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "lastActivityAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "revokedAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "mcpConnectionId": {
                    "type": ["string", "null"]
                  },
                  "source": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": ["consent", "site"]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "clientId",
                  "clientName",
                  "connectionIds",
                  "accountAccess",
                  "scope",
                  "createdAt",
                  "lastActivityAt",
                  "revokedAt",
                  "mcpConnectionId",
                  "source"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["grant"],
        "additionalProperties": false
      },
      "McpGrantCopyRequest": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "fromMcpConnectionIds": {
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "string",
              "pattern": "^[A-Za-z0-9_-]{1,256}$"
            }
          },
          "toMcpConnectionId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "clientId": {
            "type": "string",
            "minLength": 1,
            "maxLength": 256
          },
          "clientName": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          }
        },
        "required": [
          "fromMcpConnectionIds",
          "toMcpConnectionId",
          "clientId",
          "clientName"
        ],
        "additionalProperties": false
      },
      "McpGrantCopyResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "grant": {
            "anyOf": [
              {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "clientId": {
                    "type": "string"
                  },
                  "clientName": {
                    "type": "string"
                  },
                  "connectionIds": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    }
                  },
                  "accountAccess": {
                    "minItems": 1,
                    "maxItems": 10000,
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "connectionId": {
                          "type": "string",
                          "format": "uuid",
                          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                        },
                        "accountId": {
                          "type": "string",
                          "pattern": "^[A-Za-z0-9_-]{1,256}$"
                        },
                        "permissions": {
                          "minItems": 1,
                          "maxItems": 3,
                          "type": "array",
                          "items": {
                            "type": "string",
                            "enum": ["read", "manage_ads", "manage_budgets"]
                          }
                        }
                      },
                      "required": ["connectionId", "accountId", "permissions"],
                      "additionalProperties": false
                    }
                  },
                  "scope": {
                    "type": "string",
                    "enum": [
                      "telemetrio:ads:read",
                      "telemetrio:ads:read telemetrio:ads:manage",
                      "telemetrio:ads:read telemetrio:ads:budget",
                      "telemetrio:ads:read telemetrio:ads:manage telemetrio:ads:budget"
                    ]
                  },
                  "createdAt": {
                    "type": "string",
                    "format": "date-time",
                    "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                  },
                  "lastActivityAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "revokedAt": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "date-time",
                        "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "mcpConnectionId": {
                    "type": ["string", "null"]
                  },
                  "source": {
                    "anyOf": [
                      {
                        "type": "string",
                        "enum": ["consent", "site"]
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "id",
                  "clientId",
                  "clientName",
                  "connectionIds",
                  "accountAccess",
                  "scope",
                  "createdAt",
                  "lastActivityAt",
                  "revokedAt",
                  "mcpConnectionId",
                  "source"
                ],
                "additionalProperties": false
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["grant"],
        "additionalProperties": false
      },
      "PublicMcpGrantList": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "array",
        "items": {
          "type": "object",
          "properties": {
            "id": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "clientId": {
              "type": "string"
            },
            "clientName": {
              "type": "string"
            },
            "connectionIds": {
              "type": "array",
              "items": {
                "type": "string",
                "format": "uuid",
                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
              }
            },
            "accountAccess": {
              "minItems": 1,
              "maxItems": 10000,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "connectionId": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "accountId": {
                    "type": "string",
                    "pattern": "^[A-Za-z0-9_-]{1,256}$"
                  },
                  "permissions": {
                    "minItems": 1,
                    "maxItems": 3,
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": ["read", "manage_ads", "manage_budgets"]
                    }
                  }
                },
                "required": ["connectionId", "accountId", "permissions"],
                "additionalProperties": false
              }
            },
            "scope": {
              "type": "string",
              "enum": [
                "telemetrio:ads:read",
                "telemetrio:ads:read telemetrio:ads:manage",
                "telemetrio:ads:read telemetrio:ads:budget",
                "telemetrio:ads:read telemetrio:ads:manage telemetrio:ads:budget"
              ]
            },
            "createdAt": {
              "type": "string",
              "format": "date-time",
              "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
            },
            "lastActivityAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                {
                  "type": "null"
                }
              ]
            },
            "revokedAt": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                {
                  "type": "null"
                }
              ]
            }
          },
          "required": [
            "id",
            "clientId",
            "clientName",
            "connectionIds",
            "accountAccess",
            "scope",
            "createdAt",
            "lastActivityAt",
            "revokedAt"
          ],
          "additionalProperties": false
        }
      },
      "PublicMcpGrantPage": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "grants": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "clientId": {
                  "type": "string"
                },
                "clientName": {
                  "type": "string"
                },
                "connectionIds": {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  }
                },
                "accountAccess": {
                  "minItems": 1,
                  "maxItems": 10000,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "connectionId": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "accountId": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,256}$"
                      },
                      "permissions": {
                        "minItems": 1,
                        "maxItems": 3,
                        "type": "array",
                        "items": {
                          "type": "string",
                          "enum": ["read", "manage_ads", "manage_budgets"]
                        }
                      }
                    },
                    "required": ["connectionId", "accountId", "permissions"],
                    "additionalProperties": false
                  }
                },
                "scope": {
                  "type": "string",
                  "enum": [
                    "telemetrio:ads:read",
                    "telemetrio:ads:read telemetrio:ads:manage",
                    "telemetrio:ads:read telemetrio:ads:budget",
                    "telemetrio:ads:read telemetrio:ads:manage telemetrio:ads:budget"
                  ]
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "lastActivityAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "revokedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                }
              },
              "required": [
                "id",
                "clientId",
                "clientName",
                "connectionIds",
                "accountAccess",
                "scope",
                "createdAt",
                "lastActivityAt",
                "revokedAt"
              ],
              "additionalProperties": false
            }
          },
          "nextOffset": {
            "anyOf": [
              {
                "type": "integer",
                "minimum": 0,
                "maximum": 9007199254740991
              },
              {
                "type": "null"
              }
            ]
          }
        },
        "required": ["grants", "nextOffset"],
        "additionalProperties": false
      },
      "ConnectionView": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "enum": ["active", "expired", "disconnected", "migration_required"]
          },
          "credentialKind": {
            "type": "string",
            "enum": ["official_api", "legacy_cookies"]
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,256}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "currency": {
                  "type": "string",
                  "enum": ["TON", "EUR", "XTR"]
                }
              },
              "required": ["id", "name"],
              "additionalProperties": false
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "lastCheckedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "aiPaused": {
            "type": "boolean"
          },
          "aiPausedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultPermissions": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  }
                ],
                "items": false,
                "minItems": 1,
                "maxItems": 1
              },
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  },
                  {
                    "type": "string",
                    "const": "manage_ads"
                  },
                  {
                    "type": "string",
                    "const": "manage_budgets"
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              }
            ]
          },
          "flowId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "analyticsClientId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,64}$"
          }
        },
        "required": [
          "id",
          "name",
          "version",
          "status",
          "credentialKind",
          "accounts",
          "createdAt",
          "updatedAt",
          "lastCheckedAt",
          "aiPaused",
          "aiPausedAt"
        ],
        "additionalProperties": false
      },
      "ConnectByToken": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "apiToken": {
            "type": "string",
            "minLength": 8,
            "maxLength": 4096,
            "pattern": "^[\\x21-\\x7e]+$"
          },
          "defaultPermissions": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  }
                ],
                "items": false,
                "minItems": 1,
                "maxItems": 1
              },
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  },
                  {
                    "type": "string",
                    "const": "manage_ads"
                  },
                  {
                    "type": "string",
                    "const": "manage_budgets"
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              }
            ]
          },
          "flowId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "analyticsClientId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,64}$"
          },
          "mcpTargets": {
            "minItems": 1,
            "maxItems": 20,
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "mcpConnectionId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,256}$"
                },
                "clientId": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 256
                },
                "clientName": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                }
              },
              "required": ["mcpConnectionId", "clientId", "clientName"],
              "additionalProperties": false
            }
          },
          "accounts": {
            "type": "string",
            "const": "all"
          }
        },
        "required": ["apiToken", "defaultPermissions"],
        "additionalProperties": false
      },
      "ConnectByTokenResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "enum": ["active", "expired", "disconnected", "migration_required"]
          },
          "credentialKind": {
            "type": "string",
            "enum": ["official_api", "legacy_cookies"]
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,256}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "currency": {
                  "type": "string",
                  "enum": ["TON", "EUR", "XTR"]
                }
              },
              "required": ["id", "name"],
              "additionalProperties": false
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "lastCheckedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "aiPaused": {
            "type": "boolean"
          },
          "aiPausedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultPermissions": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  }
                ],
                "items": false,
                "minItems": 1,
                "maxItems": 1
              },
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  },
                  {
                    "type": "string",
                    "const": "manage_ads"
                  },
                  {
                    "type": "string",
                    "const": "manage_budgets"
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              }
            ]
          },
          "flowId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "analyticsClientId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,64}$"
          },
          "aiAccess": {
            "type": "object",
            "properties": {
              "clients": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "ref": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "clientName": {
                      "type": "string"
                    },
                    "granted": {
                      "type": "boolean"
                    }
                  },
                  "required": ["ref", "clientName", "granted"],
                  "additionalProperties": false
                }
              },
              "linkedAccounts": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Linked accounts granted to each client besides the root; null when they could not be listed or verified"
              }
            },
            "required": ["clients", "linkedAccounts"],
            "additionalProperties": false
          },
          "replaced": {
            "type": "boolean"
          }
        },
        "required": [
          "id",
          "name",
          "version",
          "status",
          "credentialKind",
          "accounts",
          "createdAt",
          "updatedAt",
          "lastCheckedAt",
          "aiPaused",
          "aiPausedAt",
          "replaced"
        ],
        "additionalProperties": false
      },
      "ConnectionList": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "connections": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 120
                },
                "version": {
                  "type": "integer",
                  "exclusiveMinimum": 0,
                  "maximum": 9007199254740991
                },
                "status": {
                  "type": "string",
                  "enum": [
                    "active",
                    "expired",
                    "disconnected",
                    "migration_required"
                  ]
                },
                "credentialKind": {
                  "type": "string",
                  "enum": ["official_api", "legacy_cookies"]
                },
                "accounts": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "pattern": "^[A-Za-z0-9_-]{1,256}$"
                      },
                      "name": {
                        "type": "string",
                        "minLength": 1
                      },
                      "currency": {
                        "type": "string",
                        "enum": ["TON", "EUR", "XTR"]
                      }
                    },
                    "required": ["id", "name"],
                    "additionalProperties": false
                  }
                },
                "createdAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "updatedAt": {
                  "type": "string",
                  "format": "date-time",
                  "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                },
                "lastCheckedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "aiPaused": {
                  "type": "boolean"
                },
                "aiPausedAt": {
                  "anyOf": [
                    {
                      "type": "string",
                      "format": "date-time",
                      "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "defaultPermissions": {
                  "anyOf": [
                    {
                      "type": "array",
                      "prefixItems": [
                        {
                          "type": "string",
                          "const": "read"
                        }
                      ],
                      "items": false,
                      "minItems": 1,
                      "maxItems": 1
                    },
                    {
                      "type": "array",
                      "prefixItems": [
                        {
                          "type": "string",
                          "const": "read"
                        },
                        {
                          "type": "string",
                          "const": "manage_ads"
                        },
                        {
                          "type": "string",
                          "const": "manage_budgets"
                        }
                      ],
                      "items": false,
                      "minItems": 3,
                      "maxItems": 3
                    }
                  ]
                },
                "flowId": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "analyticsClientId": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9._-]{1,64}$"
                }
              },
              "required": [
                "id",
                "name",
                "version",
                "status",
                "credentialKind",
                "accounts",
                "createdAt",
                "updatedAt",
                "lastCheckedAt",
                "aiPaused",
                "aiPausedAt"
              ],
              "additionalProperties": false
            }
          }
        },
        "required": ["connections"],
        "additionalProperties": false
      },
      "CreateConnection": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "apiToken": {
            "type": "string",
            "minLength": 8,
            "maxLength": 4096,
            "pattern": "^[\\x21-\\x7e]+$"
          },
          "expectedAccountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "defaultPermissions": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  }
                ],
                "items": false,
                "minItems": 1,
                "maxItems": 1
              },
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  },
                  {
                    "type": "string",
                    "const": "manage_ads"
                  },
                  {
                    "type": "string",
                    "const": "manage_budgets"
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              }
            ]
          },
          "flowId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "analyticsClientId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,64}$"
          }
        },
        "required": ["name", "apiToken", "expectedAccountId"],
        "additionalProperties": false
      },
      "ReplaceCredentials": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "apiToken": {
            "type": "string",
            "minLength": 8,
            "maxLength": 4096,
            "pattern": "^[\\x21-\\x7e]+$"
          },
          "expectedAccountId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_-]{1,256}$"
          },
          "defaultPermissions": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  }
                ],
                "items": false,
                "minItems": 1,
                "maxItems": 1
              },
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  },
                  {
                    "type": "string",
                    "const": "manage_ads"
                  },
                  {
                    "type": "string",
                    "const": "manage_budgets"
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              }
            ]
          },
          "flowId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "analyticsClientId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,64}$"
          }
        },
        "required": ["version", "apiToken", "expectedAccountId"],
        "additionalProperties": false
      },
      "AiAccess": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "paused": {
            "type": "boolean"
          }
        },
        "required": ["paused"],
        "additionalProperties": false
      },
      "DisconnectConnection": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          }
        },
        "required": ["version"],
        "additionalProperties": false
      },
      "ConnectionSaveResult": {
        "$schema": "https://json-schema.org/draft/2020-12/schema",
        "type": "object",
        "properties": {
          "id": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "name": {
            "type": "string",
            "minLength": 1,
            "maxLength": 120
          },
          "version": {
            "type": "integer",
            "exclusiveMinimum": 0,
            "maximum": 9007199254740991
          },
          "status": {
            "type": "string",
            "enum": ["active", "expired", "disconnected", "migration_required"]
          },
          "credentialKind": {
            "type": "string",
            "enum": ["official_api", "legacy_cookies"]
          },
          "accounts": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "id": {
                  "type": "string",
                  "pattern": "^[A-Za-z0-9_-]{1,256}$"
                },
                "name": {
                  "type": "string",
                  "minLength": 1
                },
                "currency": {
                  "type": "string",
                  "enum": ["TON", "EUR", "XTR"]
                }
              },
              "required": ["id", "name"],
              "additionalProperties": false
            }
          },
          "createdAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "updatedAt": {
            "type": "string",
            "format": "date-time",
            "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
          },
          "lastCheckedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "aiPaused": {
            "type": "boolean"
          },
          "aiPausedAt": {
            "anyOf": [
              {
                "type": "string",
                "format": "date-time",
                "pattern": "^(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))T(?:(?:[01]\\d|2[0-3]):[0-5]\\d:[0-5]\\d(?:\\.\\d+)?(?:Z))$"
              },
              {
                "type": "null"
              }
            ]
          },
          "defaultPermissions": {
            "anyOf": [
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  }
                ],
                "items": false,
                "minItems": 1,
                "maxItems": 1
              },
              {
                "type": "array",
                "prefixItems": [
                  {
                    "type": "string",
                    "const": "read"
                  },
                  {
                    "type": "string",
                    "const": "manage_ads"
                  },
                  {
                    "type": "string",
                    "const": "manage_budgets"
                  }
                ],
                "items": false,
                "minItems": 3,
                "maxItems": 3
              }
            ]
          },
          "flowId": {
            "type": "string",
            "format": "uuid",
            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
          },
          "analyticsClientId": {
            "type": "string",
            "pattern": "^[A-Za-z0-9._-]{1,64}$"
          },
          "aiAccess": {
            "type": "object",
            "properties": {
              "clients": {
                "type": "array",
                "items": {
                  "type": "object",
                  "properties": {
                    "ref": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    },
                    "clientName": {
                      "type": "string"
                    },
                    "granted": {
                      "type": "boolean"
                    }
                  },
                  "required": ["ref", "clientName", "granted"],
                  "additionalProperties": false
                }
              },
              "linkedAccounts": {
                "anyOf": [
                  {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  {
                    "type": "null"
                  }
                ],
                "description": "Linked accounts granted to each client besides the root; null when they could not be listed or verified"
              }
            },
            "required": ["clients", "linkedAccounts"],
            "additionalProperties": false
          }
        },
        "required": [
          "id",
          "name",
          "version",
          "status",
          "credentialKind",
          "accounts",
          "createdAt",
          "updatedAt",
          "lastCheckedAt",
          "aiPaused",
          "aiPausedAt"
        ],
        "additionalProperties": false
      }
    }
  }
}
