{
  "components": {
    "responses": {
      "Forbidden": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "enum": [
                    "forbidden"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "error"
              ],
              "type": "object"
            }
          }
        },
        "description": "The key or session lacks the required scope, the publisher is not active, or the operation is not allowed for this actor."
      },
      "RateLimited": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "enum": [
                    "rate_limited"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "error"
              ],
              "type": "object"
            }
          }
        },
        "description": "Rate limit exceeded; retry after the number of seconds in `Retry-After`.",
        "headers": {
          "RateLimit-Limit": {
            "description": "Requests allowed per 60-second window for this tier.",
            "schema": {
              "type": "integer"
            }
          },
          "RateLimit-Remaining": {
            "description": "Requests left in the current window.",
            "schema": {
              "type": "integer"
            }
          },
          "RateLimit-Reset": {
            "description": "Seconds until the current window ends.",
            "schema": {
              "type": "integer"
            }
          },
          "Retry-After": {
            "description": "Seconds to wait before retrying.",
            "schema": {
              "type": "integer"
            }
          }
        }
      },
      "Unauthorized": {
        "content": {
          "application/json": {
            "schema": {
              "properties": {
                "error": {
                  "enum": [
                    "unauthorized"
                  ],
                  "type": "string"
                }
              },
              "required": [
                "error"
              ],
              "type": "object"
            }
          }
        },
        "description": "Missing, invalid or revoked API key / session."
      }
    },
    "securitySchemes": {
      "bearer": {
        "description": "API key `adk_...` created in the dashboard.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "title": "AGIMone Publisher API",
    "version": "2026-10"
  },
  "openapi": "3.0.3",
  "paths": {
    "/v1/balance": {
      "get": {
        "description": "Current balance of the publisher: `available` is the amount that can be requested for payout, `pending` is estimated revenue (days AGIMone has not finalized yet; not payable until final), `requested` is the amount in open payout requests, `paid_total` is the total already paid out, and `min_payout` is the minimum payout amount. All amounts are money strings. Same numbers as the `balance` field of GET /v1/earnings. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "getBalance",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "available": {
                      "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                      "type": "string"
                    },
                    "held": {
                      "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                      "type": "string"
                    },
                    "min_payout": {
                      "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                      "type": "string"
                    },
                    "paid_total": {
                      "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                      "type": "string"
                    },
                    "pending": {
                      "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                      "type": "string"
                    },
                    "requested": {
                      "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                      "type": "string"
                    }
                  },
                  "required": [
                    "pending",
                    "held",
                    "available",
                    "requested",
                    "paid_total",
                    "min_payout"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Get balance",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/disputes": {
      "get": {
        "description": "Publisher disputes with first-response (48 hours) and resolution (7 days) deadlines, overdue first. Requires `publisher:read`. Rate limit tier: `read`.",
        "operationId": "listDisputes",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "amount_returned": {
                        "nullable": true,
                        "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                        "type": "string"
                      },
                      "first_response_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "first_response_due_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "id": {
                        "exclusiveMinimum": true,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "opened_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "overdue": {
                        "type": "boolean"
                      },
                      "resolution": {
                        "enum": [
                          "upheld",
                          "rejected",
                          "partial"
                        ],
                        "nullable": true,
                        "type": "string"
                      },
                      "resolve_due_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "resolved_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "status": {
                        "enum": [
                          "open",
                          "answered",
                          "resolved"
                        ],
                        "type": "string"
                      },
                      "subject_id": {
                        "exclusiveMinimum": true,
                        "minimum": 0,
                        "nullable": true,
                        "type": "integer"
                      },
                      "subject_type": {
                        "enum": [
                          "hold",
                          "adjustment",
                          "ivt",
                          "zone_quality",
                          "payout",
                          "other"
                        ],
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "subject_type",
                      "subject_id",
                      "status",
                      "opened_at",
                      "first_response_due_at",
                      "first_response_at",
                      "resolve_due_at",
                      "resolved_at",
                      "resolution",
                      "amount_returned",
                      "overdue"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "List disputes",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      },
      "post": {
        "description": "Create a dispute with a message of up to 5,000 Unicode characters. At most five unresolved disputes per publisher and one zone-quality dispute per zone in 24 hours. Subjects must belong to the publisher. Requires `publisher:write`; view-as is read-only. Rate limit tier: `write`.",
        "operationId": "createDispute",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "message": {
                    "description": "Unicode text, 1–5000 code points",
                    "type": "string"
                  },
                  "subject_id": {
                    "exclusiveMinimum": true,
                    "minimum": 0,
                    "nullable": true,
                    "type": "integer"
                  },
                  "subject_type": {
                    "enum": [
                      "hold",
                      "adjustment",
                      "ivt",
                      "zone_quality",
                      "payout",
                      "other"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "subject_type",
                  "message"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "amount_returned": {
                      "nullable": true,
                      "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                      "type": "string"
                    },
                    "first_response_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "first_response_due_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "messages": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "author_type": {
                            "enum": [
                              "publisher",
                              "admin"
                            ],
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "created_at": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "id": {
                            "exclusiveMinimum": true,
                            "minimum": 0,
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id",
                          "author_type",
                          "body",
                          "created_at"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "opened_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "overdue": {
                      "type": "boolean"
                    },
                    "resolution": {
                      "enum": [
                        "upheld",
                        "rejected",
                        "partial"
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "resolve_due_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "resolved_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "open",
                        "answered",
                        "resolved"
                      ],
                      "type": "string"
                    },
                    "subject_id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "nullable": true,
                      "type": "integer"
                    },
                    "subject_type": {
                      "enum": [
                        "hold",
                        "adjustment",
                        "ivt",
                        "zone_quality",
                        "payout",
                        "other"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "subject_type",
                    "subject_id",
                    "status",
                    "opened_at",
                    "first_response_due_at",
                    "first_response_at",
                    "resolve_due_at",
                    "resolved_at",
                    "resolution",
                    "amount_returned",
                    "overdue",
                    "messages"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Create dispute",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "write",
        "x-required-scope": "publisher:write"
      }
    },
    "/v1/disputes/{id}": {
      "get": {
        "description": "A publisher-owned dispute and its message thread. Requires `publisher:read`. Rate limit tier: `read`.",
        "operationId": "getDispute",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "amount_returned": {
                      "nullable": true,
                      "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                      "type": "string"
                    },
                    "first_response_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "first_response_due_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "messages": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "author_type": {
                            "enum": [
                              "publisher",
                              "admin"
                            ],
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "created_at": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "id": {
                            "exclusiveMinimum": true,
                            "minimum": 0,
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id",
                          "author_type",
                          "body",
                          "created_at"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "opened_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "overdue": {
                      "type": "boolean"
                    },
                    "resolution": {
                      "enum": [
                        "upheld",
                        "rejected",
                        "partial"
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "resolve_due_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "resolved_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "open",
                        "answered",
                        "resolved"
                      ],
                      "type": "string"
                    },
                    "subject_id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "nullable": true,
                      "type": "integer"
                    },
                    "subject_type": {
                      "enum": [
                        "hold",
                        "adjustment",
                        "ivt",
                        "zone_quality",
                        "payout",
                        "other"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "subject_type",
                    "subject_id",
                    "status",
                    "opened_at",
                    "first_response_due_at",
                    "first_response_at",
                    "resolve_due_at",
                    "resolved_at",
                    "resolution",
                    "amount_returned",
                    "overdue",
                    "messages"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Get dispute",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/disputes/{id}/messages": {
      "post": {
        "description": "Send up to 5,000 Unicode characters to an unresolved publisher-owned dispute. A publisher reply reopens an answered dispute. Requires `publisher:write`; view-as is read-only. Rate limit tier: `write`.",
        "operationId": "createDisputeMessage",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "message": {
                    "description": "Unicode text, 1–5000 code points",
                    "type": "string"
                  }
                },
                "required": [
                  "message"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "amount_returned": {
                      "nullable": true,
                      "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                      "type": "string"
                    },
                    "first_response_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "first_response_due_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "messages": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "author_type": {
                            "enum": [
                              "publisher",
                              "admin"
                            ],
                            "type": "string"
                          },
                          "body": {
                            "type": "string"
                          },
                          "created_at": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "id": {
                            "exclusiveMinimum": true,
                            "minimum": 0,
                            "type": "integer"
                          }
                        },
                        "required": [
                          "id",
                          "author_type",
                          "body",
                          "created_at"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "opened_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "overdue": {
                      "type": "boolean"
                    },
                    "resolution": {
                      "enum": [
                        "upheld",
                        "rejected",
                        "partial"
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "resolve_due_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "resolved_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "open",
                        "answered",
                        "resolved"
                      ],
                      "type": "string"
                    },
                    "subject_id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "nullable": true,
                      "type": "integer"
                    },
                    "subject_type": {
                      "enum": [
                        "hold",
                        "adjustment",
                        "ivt",
                        "zone_quality",
                        "payout",
                        "other"
                      ],
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "subject_type",
                    "subject_id",
                    "status",
                    "opened_at",
                    "first_response_due_at",
                    "first_response_at",
                    "resolve_due_at",
                    "resolved_at",
                    "resolution",
                    "amount_returned",
                    "overdue",
                    "messages"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Create dispute message",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "write",
        "x-required-scope": "publisher:write"
      }
    },
    "/v1/earnings": {
      "get": {
        "description": "Daily earnings in a date range together with the current balance. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "getEarnings",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "adjustments": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "amount": {
                            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                            "type": "string"
                          },
                          "detected_on": {
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                            "type": "string"
                          },
                          "earnings_day_id": {
                            "exclusiveMinimum": true,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "for_date": {
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                            "type": "string"
                          },
                          "source": {
                            "enum": [
                              "network",
                              "dispute"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "earnings_day_id",
                          "detected_on",
                          "for_date",
                          "amount",
                          "source"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "balance": {
                      "additionalProperties": false,
                      "properties": {
                        "available": {
                          "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        },
                        "held": {
                          "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        },
                        "min_payout": {
                          "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        },
                        "paid_total": {
                          "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        },
                        "pending": {
                          "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        },
                        "requested": {
                          "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        }
                      },
                      "required": [
                        "pending",
                        "held",
                        "available",
                        "requested",
                        "paid_total",
                        "min_payout"
                      ],
                      "type": "object"
                    },
                    "count_basis": {
                      "enum": [
                        "valid",
                        "legacy",
                        "mixed"
                      ],
                      "type": "string"
                    },
                    "currency": {
                      "enum": [
                        "USD"
                      ],
                      "type": "string"
                    },
                    "days": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "adjustment": {
                            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                            "type": "string"
                          },
                          "count_basis": {
                            "enum": [
                              "valid",
                              "legacy",
                              "mixed"
                            ],
                            "type": "string"
                          },
                          "date": {
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                            "type": "string"
                          },
                          "pops": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "revenue": {
                            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                            "type": "string"
                          },
                          "status": {
                            "enum": [
                              "estimated",
                              "reported",
                              "final",
                              "mixed"
                            ],
                            "type": "string"
                          }
                        },
                        "required": [
                          "date",
                          "pops",
                          "revenue",
                          "adjustment"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "estimated_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "forecast_basis_version": {
                      "enum": [
                        "forecast-basis-v1"
                      ],
                      "type": "string"
                    },
                    "forecast_generation": {
                      "allOf": [
                        {
                          "maxLength": 19,
                          "pattern": "^[1-9]\\d*$",
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "forecast_updated_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "measurement_definition": {
                      "additionalProperties": false,
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "includes_direct": {
                          "type": "boolean"
                        },
                        "includes_legacy": {
                          "type": "boolean"
                        },
                        "tag_valid_after_ms": {
                          "items": {
                            "maximum": 30000,
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "maxItems": 30,
                          "type": "array"
                        }
                      },
                      "required": [
                        "tag_valid_after_ms",
                        "includes_direct",
                        "includes_legacy",
                        "complete"
                      ],
                      "type": "object"
                    },
                    "measurement_generation": {
                      "allOf": [
                        {
                          "maxLength": 19,
                          "pattern": "^[1-9]\\d*$",
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "measurement_status": {
                      "enum": [
                        "ok",
                        "stale",
                        "updating"
                      ],
                      "type": "string"
                    },
                    "measurement_updated_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "money_basis_version": {
                      "pattern": "^money-basis-v[123]:[a-f0-9]{64}$",
                      "type": "string"
                    },
                    "money_generation": {
                      "allOf": [
                        {
                          "maxLength": 19,
                          "pattern": "^[1-9]\\d*$",
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "updated_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "currency",
                    "balance",
                    "days",
                    "adjustments"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "summary": "Get earnings",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/holds": {
      "get": {
        "description": "Up to 200 publisher holds, newest first, including evidence, decision status, seven-day forfeiture boundary and automatic release time. Active holds already reduce available balance. Requires `publisher:read`. Rate limit tier: `read`.",
        "operationId": "listHolds",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "amount": {
                        "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                        "type": "string"
                      },
                      "auto_release_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "created_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "date_from": {
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string"
                      },
                      "date_to": {
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string"
                      },
                      "decided_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "decision_note": {
                        "nullable": true,
                        "type": "string"
                      },
                      "evidence": {
                        "type": "string"
                      },
                      "evidence_data": {
                        "additionalProperties": false,
                        "properties": {
                          "cap": {
                            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                            "type": "string"
                          },
                          "ivt": {
                            "additionalProperties": false,
                            "nullable": true,
                            "properties": {
                              "by_reason": {
                                "additionalProperties": false,
                                "properties": {
                                  "asn_hosting": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "automation": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "fast_gesture": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "host_mismatch": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "ip_rate": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "ip_rate_soft": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "ip_tor": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "ip_vpn": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "prefix_burst": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "tag_automation": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "tag_headless_hint": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "ua_bot": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "ua_hints_mismatch": {
                                    "minimum": 0,
                                    "type": "integer"
                                  },
                                  "unclassified": {
                                    "minimum": 0,
                                    "type": "integer"
                                  }
                                },
                                "required": [
                                  "ua_bot",
                                  "automation",
                                  "ip_rate",
                                  "asn_hosting",
                                  "ip_vpn",
                                  "ip_tor",
                                  "tag_automation",
                                  "host_mismatch",
                                  "ua_hints_mismatch",
                                  "prefix_burst",
                                  "tag_headless_hint",
                                  "ip_rate_soft",
                                  "fast_gesture",
                                  "unclassified"
                                ],
                                "type": "object"
                              },
                              "filtered": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "ivt_rate_pre": {
                                "maximum": 1,
                                "minimum": 0,
                                "nullable": true,
                                "type": "number"
                              },
                              "requests": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            },
                            "required": [
                              "requests",
                              "filtered",
                              "ivt_rate_pre",
                              "by_reason"
                            ],
                            "type": "object"
                          },
                          "network_report_ref": {
                            "maxLength": 200,
                            "nullable": true,
                            "type": "string"
                          },
                          "reported_deduction": {
                            "nullable": true,
                            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                            "type": "string"
                          },
                          "revenue_publisher": {
                            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                            "type": "string"
                          },
                          "revshare_pct": {
                            "type": "number"
                          },
                          "suspect_pct": {
                            "maximum": 100,
                            "minimum": 0,
                            "nullable": true,
                            "type": "number"
                          }
                        },
                        "required": [
                          "revenue_publisher",
                          "revshare_pct",
                          "cap",
                          "suspect_pct",
                          "reported_deduction",
                          "network_report_ref",
                          "ivt"
                        ],
                        "type": "object"
                      },
                      "forfeit_not_before": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "id": {
                        "exclusiveMinimum": true,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "original_amount": {
                        "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                        "type": "string"
                      },
                      "reason_code": {
                        "enum": [
                          "ivt_suspected",
                          "network_clawback_pending",
                          "policy_violation"
                        ],
                        "type": "string"
                      },
                      "status": {
                        "enum": [
                          "active",
                          "released",
                          "forfeited"
                        ],
                        "type": "string"
                      },
                      "zone_id": {
                        "exclusiveMinimum": true,
                        "minimum": 0,
                        "nullable": true,
                        "type": "integer"
                      },
                      "zone_name": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "zone_id",
                      "zone_name",
                      "date_from",
                      "date_to",
                      "amount",
                      "original_amount",
                      "reason_code",
                      "evidence",
                      "evidence_data",
                      "status",
                      "created_at",
                      "auto_release_at",
                      "forfeit_not_before",
                      "decided_at",
                      "decision_note"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "List payout holds",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/me": {
      "get": {
        "description": "Profile of the signed-in user (and publisher). Requires a user actor (API key of a user or web session). GET and HEAD use rate limit tier `me`: 600 requests/minute per user, shared by web sessions and user API keys. Other reads and profile writes keep their own rate limit tiers.",
        "operationId": "getMe",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "email": {
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "locale": {
                      "enum": [
                        "en",
                        "vi",
                        "es",
                        "pt",
                        "fr",
                        "id",
                        "ru",
                        "zh",
                        "ar"
                      ],
                      "type": "string"
                    },
                    "mfa_enabled": {
                      "type": "boolean"
                    },
                    "publisher": {
                      "additionalProperties": false,
                      "nullable": true,
                      "properties": {
                        "display_name": {
                          "type": "string"
                        },
                        "id": {
                          "exclusiveMinimum": true,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "min_payout": {
                          "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        },
                        "payout_details_masked": {
                          "nullable": true,
                          "type": "string"
                        },
                        "payout_method": {
                          "enum": [
                            "paypal",
                            "usdt",
                            "bank"
                          ],
                          "nullable": true,
                          "type": "string"
                        },
                        "payout_method_pending": {
                          "additionalProperties": false,
                          "nullable": true,
                          "properties": {
                            "effective_at": {
                              "format": "date-time",
                              "type": "string"
                            },
                            "masked": {
                              "type": "string"
                            },
                            "method": {
                              "enum": [
                                "paypal",
                                "usdt",
                                "bank"
                              ],
                              "type": "string"
                            },
                            "requested_at": {
                              "format": "date-time",
                              "type": "string"
                            }
                          },
                          "required": [
                            "method",
                            "masked",
                            "requested_at",
                            "effective_at"
                          ],
                          "type": "object"
                        },
                        "permissions": {
                          "additionalProperties": false,
                          "description": "Advanced permissions enabled for this publisher account by support.",
                          "properties": {
                            "auto_approve_sites": {
                              "type": "boolean"
                            },
                            "direct_link": {
                              "type": "boolean"
                            },
                            "manage": {
                              "type": "boolean"
                            }
                          },
                          "required": [
                            "direct_link",
                            "auto_approve_sites",
                            "manage"
                          ],
                          "type": "object"
                        },
                        "revshare_pct": {
                          "type": "number"
                        },
                        "status": {
                          "enum": [
                            "active",
                            "pending",
                            "suspended"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "id",
                        "display_name",
                        "status",
                        "revshare_pct",
                        "min_payout",
                        "payout_method",
                        "payout_details_masked",
                        "payout_method_pending",
                        "permissions"
                      ],
                      "type": "object"
                    },
                    "role": {
                      "enum": [
                        "admin",
                        "publisher",
                        "advertiser"
                      ],
                      "type": "string"
                    },
                    "security_notice": {
                      "additionalProperties": false,
                      "nullable": true,
                      "properties": {
                        "at": {
                          "format": "date-time",
                          "type": "string"
                        },
                        "kind": {
                          "enum": [
                            "mfa_enabled",
                            "mfa_disabled",
                            "mfa_reset_by_admin",
                            "recovery_regenerated",
                            "recovery_used",
                            "password_changed",
                            "login_new_device",
                            "session_revoked",
                            "payout_method_requested",
                            "payout_method_applied",
                            "payout_method_cancelled",
                            "telegram_linked",
                            "telegram_unlinked",
                            "telegram_payout_enabled",
                            "telegram_payout_disabled"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "kind",
                        "at"
                      ],
                      "type": "object"
                    },
                    "timezone": {
                      "type": "string"
                    },
                    "view_as": {
                      "additionalProperties": false,
                      "nullable": true,
                      "properties": {
                        "display_name": {
                          "type": "string"
                        },
                        "publisher_id": {
                          "exclusiveMinimum": true,
                          "minimum": 0,
                          "type": "integer"
                        }
                      },
                      "required": [
                        "publisher_id",
                        "display_name"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "id",
                    "email",
                    "role",
                    "locale",
                    "timezone",
                    "publisher",
                    "view_as",
                    "mfa_enabled",
                    "security_notice"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Get my profile",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "me",
        "x-required-scope": "any"
      }
    },
    "/v1/me/api-keys": {
      "get": {
        "description": "List active API keys of the publisher (the secret is never returned again). Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "listApiKeys",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "created_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "id": {
                        "exclusiveMinimum": true,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "last_used_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "name": {
                        "type": "string"
                      },
                      "scopes": {
                        "items": {
                          "enum": [
                            "publisher:read",
                            "publisher:write",
                            "admin:read",
                            "admin:write",
                            "infra:read",
                            "infra:write",
                            "adv:read",
                            "adv:write",
                            "scan:work",
                            "dsp0:review"
                          ],
                          "type": "string"
                        },
                        "type": "array"
                      }
                    },
                    "required": [
                      "id",
                      "name",
                      "scopes",
                      "created_at",
                      "last_used_at"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "List API keys",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/me/api-keys/{id}": {
      "delete": {
        "description": "Revoke an API key, for example one that leaked. Requires scope `publisher:write` (API key or web session); not available in view-as. Rate limit tier: `write`.",
        "operationId": "revokeApiKey",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {
                "schema": {
                  "not": {}
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Revoke an API key",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "write",
        "x-required-scope": "publisher:write"
      }
    },
    "/v1/notifications/prefs": {
      "get": {
        "description": "Which notification events are enabled on each channel. Changing them is web-only (signed-in person). Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "getNotificationPrefs",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "items": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "channel": {
                            "enum": [
                              "email",
                              "telegram",
                              "webhook",
                              "webpush"
                            ],
                            "type": "string"
                          },
                          "enabled": {
                            "type": "boolean"
                          },
                          "event_type": {
                            "enum": [
                              "payout.upcoming",
                              "payout.status_changed",
                              "hold.created",
                              "hold.decided",
                              "dispute.replied",
                              "kyc.status_changed",
                              "zone.quality_changed",
                              "ivt.threshold_exceeded",
                              "zone.traffic_stopped",
                              "zone.traffic_resumed",
                              "day.finalized",
                              "report.daily",
                              "site.status_changed",
                              "referral.credited",
                              "support.replied",
                              "webhook.endpoint_disabled",
                              "account.security",
                              "ping"
                            ],
                            "type": "string"
                          },
                          "locked": {
                            "type": "boolean"
                          }
                        },
                        "required": [
                          "channel",
                          "event_type",
                          "enabled",
                          "locked"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "report_hour": {
                      "maximum": 23,
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "items"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Get notification preferences",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/openapi/publisher.json": {
      "get": {
        "description": "The OpenAPI 3 document of this API (publisher operations only). No authentication. Rate limit tier: `public` (60 requests/minute per IP). Cached for 5 minutes.",
        "operationId": "getOpenApiPublisher",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": {},
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "security": [],
        "summary": "Get the OpenAPI document",
        "tags": [
          "public"
        ],
        "x-rate-limit-tier": "public"
      }
    },
    "/v1/payouts": {
      "get": {
        "description": "List the publisher's payout requests and their status. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "listPayouts",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "amount": {
                        "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                        "type": "string"
                      },
                      "decided_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "id": {
                        "exclusiveMinimum": true,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "method": {
                        "enum": [
                          "paypal",
                          "usdt",
                          "bank"
                        ],
                        "type": "string"
                      },
                      "notes": {
                        "nullable": true,
                        "type": "string"
                      },
                      "paid_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "requested_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "status": {
                        "enum": [
                          "requested",
                          "approved",
                          "paid",
                          "rejected"
                        ],
                        "type": "string"
                      },
                      "tx_ref": {
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "amount",
                      "method",
                      "status",
                      "requested_at",
                      "decided_at",
                      "paid_at",
                      "tx_ref",
                      "notes"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "List payouts",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/public/payout-terms": {
      "get": {
        "description": "Current manual payout schedule, enforced publisher defaults and IVT policy. Public; cached for 300 seconds. Rate limit tier: `public`.",
        "operationId": "getPayoutTerms",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "generated_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "ivt_policy": {
                      "additionalProperties": false,
                      "properties": {
                        "effective_from": {
                          "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                          "type": "string"
                        },
                        "status": {
                          "enum": [
                            "draft",
                            "approved"
                          ],
                          "type": "string"
                        },
                        "version": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "version",
                        "effective_from",
                        "status"
                      ],
                      "type": "object"
                    },
                    "methods": {
                      "items": {
                        "enum": [
                          "usdt"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "minimum_payout": {
                      "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                      "type": "string"
                    },
                    "revshare_default_pct": {
                      "maximum": 100,
                      "minimum": 0,
                      "type": "number"
                    },
                    "schedule": {
                      "additionalProperties": false,
                      "properties": {
                        "approval_business_days": {
                          "exclusiveMinimum": true,
                          "minimum": 0,
                          "nullable": true,
                          "type": "integer"
                        },
                        "mode": {
                          "enum": [
                            "manual",
                            "net7"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "mode",
                        "approval_business_days"
                      ],
                      "type": "object"
                    },
                    "upcoming_changes": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "effective_from": {
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                            "type": "string"
                          },
                          "summary": {
                            "additionalProperties": false,
                            "properties": {
                              "en": {
                                "type": "string"
                              },
                              "vi": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "en",
                              "vi"
                            ],
                            "type": "object"
                          }
                        },
                        "required": [
                          "effective_from",
                          "summary"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "schedule",
                    "minimum_payout",
                    "methods",
                    "revshare_default_pct",
                    "ivt_policy",
                    "upcoming_changes",
                    "generated_at"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Get public payout terms",
        "tags": [
          "public"
        ],
        "x-rate-limit-tier": "public"
      }
    },
    "/v1/quality/ivt": {
      "get": {
        "description": "Daily IVT totals and filtering reasons for this publisher, by zone and fixed EST date (UTC-5), up to 92 days inclusive. Requires `publisher:read`. Rate limit tier: `read`.",
        "operationId": "getIvtReport",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "zone_id",
            "required": false,
            "schema": {
              "exclusiveMinimum": true,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "rows": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "by_reason": {
                            "additionalProperties": false,
                            "properties": {
                              "asn_hosting": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "automation": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "fast_gesture": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "host_mismatch": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "ip_rate": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "ip_rate_soft": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "ip_tor": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "ip_vpn": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "prefix_burst": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "tag_automation": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "tag_headless_hint": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "ua_bot": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "ua_hints_mismatch": {
                                "minimum": 0,
                                "type": "integer"
                              },
                              "unclassified": {
                                "minimum": 0,
                                "type": "integer"
                              }
                            },
                            "required": [
                              "ua_bot",
                              "automation",
                              "ip_rate",
                              "asn_hosting",
                              "ip_vpn",
                              "ip_tor",
                              "tag_automation",
                              "host_mismatch",
                              "ua_hints_mismatch",
                              "prefix_burst",
                              "tag_headless_hint",
                              "ip_rate_soft",
                              "fast_gesture",
                              "unclassified"
                            ],
                            "type": "object"
                          },
                          "capped": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "date": {
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                            "type": "string"
                          },
                          "demand_as_of": {
                            "format": "date-time",
                            "nullable": true,
                            "type": "string"
                          },
                          "demand_ivt_amount": {
                            "nullable": true,
                            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                            "type": "string"
                          },
                          "filtered": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "final": {
                            "type": "boolean"
                          },
                          "ivt_rate_pre": {
                            "maximum": 1,
                            "minimum": 0,
                            "nullable": true,
                            "type": "number"
                          },
                          "level": {
                            "enum": [
                              "ok",
                              "watch",
                              "strict",
                              "limited",
                              "paused_quality"
                            ],
                            "type": "string"
                          },
                          "paused": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "requests": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "sent": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "zone_id": {
                            "exclusiveMinimum": true,
                            "minimum": 0,
                            "type": "integer"
                          }
                        },
                        "required": [
                          "date",
                          "zone_id",
                          "requests",
                          "sent",
                          "filtered",
                          "paused",
                          "capped",
                          "ivt_rate_pre",
                          "by_reason",
                          "demand_ivt_amount",
                          "demand_as_of",
                          "level",
                          "final"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "rows"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Get IVT report",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/sites": {
      "get": {
        "description": "List the publisher's live sites. Use `include=deleted` to also include deleted sites. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "listSites",
        "parameters": [
          {
            "in": "query",
            "name": "include",
            "required": false,
            "schema": {
              "enum": [
                "deleted"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "category": {
                        "enum": [
                          "mainstream",
                          "adult",
                          "network"
                        ],
                        "type": "string"
                      },
                      "created_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "deleted_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "domain": {
                        "type": "string"
                      },
                      "id": {
                        "exclusiveMinimum": true,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "notes": {
                        "nullable": true,
                        "type": "string"
                      },
                      "pending_category": {
                        "description": "Category change awaiting review; the site keeps running with `category` until the review is done. null when there is no pending request.",
                        "enum": [
                          "mainstream",
                          "adult",
                          "network"
                        ],
                        "nullable": true,
                        "type": "string"
                      },
                      "pending_category_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "publisher_note": {
                        "description": "Your note for the review team (max 500 characters).",
                        "nullable": true,
                        "type": "string"
                      },
                      "status": {
                        "enum": [
                          "pending",
                          "approved",
                          "rejected"
                        ],
                        "type": "string"
                      },
                      "zones_count": {
                        "minimum": 0,
                        "type": "integer"
                      }
                    },
                    "required": [
                      "id",
                      "domain",
                      "category",
                      "status",
                      "notes",
                      "zones_count",
                      "created_at",
                      "pending_category",
                      "pending_category_at",
                      "deleted_at",
                      "publisher_note"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "List sites",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      },
      "post": {
        "description": "Register a new site (201). If you have the manage permission, adding your deleted site again restores it with the requested category (200). A conflict returns reason `domain_exists` for your live site, `domain_taken` for a domain reserved by another publisher, or `domain_archived` if you lack permission to restore your site. Requires scope `publisher:write` (API key or web session); not available in view-as. Rate limit tier: `write`.",
        "operationId": "createSite",
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "category": {
                    "description": "mainstream or adult for a regular site; network for an ad network or a group of sites, where each zone carries its own category.",
                    "enum": [
                      "mainstream",
                      "adult",
                      "network"
                    ],
                    "type": "string"
                  },
                  "domain": {
                    "allOf": [
                      {
                        "type": "string"
                      },
                      {
                        "maxLength": 253,
                        "minLength": 3,
                        "pattern": "^([a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)(\\.[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?)+$",
                        "type": "string"
                      }
                    ]
                  }
                },
                "required": [
                  "domain",
                  "category"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "category": {
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "deleted_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "notes": {
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category": {
                      "description": "Category change awaiting review; the site keeps running with `category` until the review is done. null when there is no pending request.",
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "publisher_note": {
                      "description": "Your note for the review team (max 500 characters).",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "pending",
                        "approved",
                        "rejected"
                      ],
                      "type": "string"
                    },
                    "zones_count": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "id",
                    "domain",
                    "category",
                    "status",
                    "notes",
                    "zones_count",
                    "created_at",
                    "pending_category",
                    "pending_category_at",
                    "deleted_at",
                    "publisher_note"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "category": {
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "deleted_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "notes": {
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category": {
                      "description": "Category change awaiting review; the site keeps running with `category` until the review is done. null when there is no pending request.",
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "publisher_note": {
                      "description": "Your note for the review team (max 500 characters).",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "pending",
                        "approved",
                        "rejected"
                      ],
                      "type": "string"
                    },
                    "zones_count": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "id",
                    "domain",
                    "category",
                    "status",
                    "notes",
                    "zones_count",
                    "created_at",
                    "pending_category",
                    "pending_category_at",
                    "deleted_at",
                    "publisher_note"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Create a site",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "write",
        "x-required-scope": "publisher:write"
      }
    },
    "/v1/sites/{id}": {
      "delete": {
        "description": "Delete a site and all of its zones. Requires the manage permission on your account (ask support to enable it); otherwise 403 with reason manage_not_allowed. With an API key, send the header X-Adnet-Confirm: true. Traffic stops within seconds; statistics and earnings are kept. Add the same domain again to restore the site. Requires scope publisher:write; not available in view-as. Rate limit tier: write.",
        "operationId": "deleteSite",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Send `true` to confirm a destructive action when calling with an API key. Required for: deleting a site or zone; pausing a zone (status: paused); turning Smart Link off (direct_url_enabled: false). Not needed for renaming, changing frequency, resuming a zone, or turning Smart Link on. Web sessions do not need it.",
            "in": "header",
            "name": "x-adnet-confirm",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {
                "schema": {
                  "not": {}
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Delete a site",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "write",
        "x-required-scope": "publisher:write"
      },
      "get": {
        "description": "Return one live site owned by the publisher. Use `include=deleted` to also look up deleted sites you own. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "getSite",
        "parameters": [
          {
            "in": "query",
            "name": "include",
            "required": false,
            "schema": {
              "enum": [
                "deleted"
              ],
              "type": "string"
            }
          },
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "category": {
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "deleted_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "notes": {
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category": {
                      "description": "Category change awaiting review; the site keeps running with `category` until the review is done. null when there is no pending request.",
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "publisher_note": {
                      "description": "Your note for the review team (max 500 characters).",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "pending",
                        "approved",
                        "rejected"
                      ],
                      "type": "string"
                    },
                    "zones_count": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "id",
                    "domain",
                    "category",
                    "status",
                    "notes",
                    "zones_count",
                    "created_at",
                    "pending_category",
                    "pending_category_at",
                    "deleted_at",
                    "publisher_note"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Get a site",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      },
      "patch": {
        "description": "Update a site. `category`: mainstream, adult or network. Some changes on an approved site need review: the response is 202 and `pending_category` shows the requested value; the site keeps running with its current `category` until the review is done. Send the current category to cancel a pending request. Requires scope `publisher:write` (API key or web session); not available in view-as. Rate limit tier: `write`. `notes`: a note for the review team (max 500 characters); null or empty clears it.",
        "operationId": "patchSite",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "category": {
                    "enum": [
                      "mainstream",
                      "adult",
                      "network"
                    ],
                    "type": "string"
                  },
                  "notes": {
                    "description": "A note for the review team (max 500 characters). null or empty clears it.",
                    "maxLength": 500,
                    "nullable": true,
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "category": {
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "deleted_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "notes": {
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category": {
                      "description": "Category change awaiting review; the site keeps running with `category` until the review is done. null when there is no pending request.",
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "publisher_note": {
                      "description": "Your note for the review team (max 500 characters).",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "pending",
                        "approved",
                        "rejected"
                      ],
                      "type": "string"
                    },
                    "zones_count": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "id",
                    "domain",
                    "category",
                    "status",
                    "notes",
                    "zones_count",
                    "created_at",
                    "pending_category",
                    "pending_category_at",
                    "deleted_at",
                    "publisher_note"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "category": {
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "deleted_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "notes": {
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category": {
                      "description": "Category change awaiting review; the site keeps running with `category` until the review is done. null when there is no pending request.",
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "publisher_note": {
                      "description": "Your note for the review team (max 500 characters).",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "pending",
                        "approved",
                        "rejected"
                      ],
                      "type": "string"
                    },
                    "zones_count": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "id",
                    "domain",
                    "category",
                    "status",
                    "notes",
                    "zones_count",
                    "created_at",
                    "pending_category",
                    "pending_category_at",
                    "deleted_at",
                    "publisher_note"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Update a site (partial)",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "write",
        "x-required-scope": "publisher:write"
      },
      "put": {
        "description": "Change the category of a site owned by the publisher: mainstream, adult or network. Prefer PATCH /v1/sites/{id}. Some changes on an approved site need review: the response is 202 and `pending_category` shows the requested value; the site keeps running with its current `category` until the review is done. Send the current category to cancel a pending request. Requires scope `publisher:write` (API key or web session); not available in view-as. Rate limit tier: `write`.",
        "operationId": "updateSite",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "category": {
                    "enum": [
                      "mainstream",
                      "adult",
                      "network"
                    ],
                    "type": "string"
                  }
                },
                "required": [
                  "category"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "category": {
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "deleted_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "notes": {
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category": {
                      "description": "Category change awaiting review; the site keeps running with `category` until the review is done. null when there is no pending request.",
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "publisher_note": {
                      "description": "Your note for the review team (max 500 characters).",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "pending",
                        "approved",
                        "rejected"
                      ],
                      "type": "string"
                    },
                    "zones_count": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "id",
                    "domain",
                    "category",
                    "status",
                    "notes",
                    "zones_count",
                    "created_at",
                    "pending_category",
                    "pending_category_at",
                    "deleted_at",
                    "publisher_note"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "202": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "category": {
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "deleted_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "notes": {
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category": {
                      "description": "Category change awaiting review; the site keeps running with `category` until the review is done. null when there is no pending request.",
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "publisher_note": {
                      "description": "Your note for the review team (max 500 characters).",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "pending",
                        "approved",
                        "rejected"
                      ],
                      "type": "string"
                    },
                    "zones_count": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "id",
                    "domain",
                    "category",
                    "status",
                    "notes",
                    "zones_count",
                    "created_at",
                    "pending_category",
                    "pending_category_at",
                    "deleted_at",
                    "publisher_note"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Update a site",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "write",
        "x-required-scope": "publisher:write"
      }
    },
    "/v1/sites/{id}/restore": {
      "post": {
        "description": "Restore a deleted site you own and the zones deleted with it. Restored zones stay paused. A live site is returned unchanged. Requires the manage permission and scope `publisher:write` (API key or web session); not available in view-as. A domain in use returns `domain_taken`. Rate limit tier: `write`.",
        "operationId": "restoreSite",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "category": {
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "deleted_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "domain": {
                      "type": "string"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "notes": {
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category": {
                      "description": "Category change awaiting review; the site keeps running with `category` until the review is done. null when there is no pending request.",
                      "enum": [
                        "mainstream",
                        "adult",
                        "network"
                      ],
                      "nullable": true,
                      "type": "string"
                    },
                    "pending_category_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "publisher_note": {
                      "description": "Your note for the review team (max 500 characters).",
                      "nullable": true,
                      "type": "string"
                    },
                    "status": {
                      "enum": [
                        "pending",
                        "approved",
                        "rejected"
                      ],
                      "type": "string"
                    },
                    "zones_count": {
                      "minimum": 0,
                      "type": "integer"
                    }
                  },
                  "required": [
                    "id",
                    "domain",
                    "category",
                    "status",
                    "notes",
                    "zones_count",
                    "created_at",
                    "pending_category",
                    "pending_category_at",
                    "deleted_at",
                    "publisher_note"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Restore a site",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "write",
        "x-required-scope": "publisher:write"
      }
    },
    "/v1/sites/{id}/zones": {
      "get": {
        "description": "List the ad zones of one site. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "listSiteZones",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "adblock_rate": {
                        "maximum": 1,
                        "minimum": 0,
                        "nullable": true,
                        "type": "number"
                      },
                      "category": {
                        "description": "Effective category of the zone.",
                        "enum": [
                          "mainstream",
                          "adult"
                        ],
                        "type": "string"
                      },
                      "category_source": {
                        "description": "zone when the category is set on the zone (network sites), site when inherited.",
                        "enum": [
                          "site",
                          "zone"
                        ],
                        "type": "string"
                      },
                      "created_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "direct_url_enabled": {
                        "type": "boolean"
                      },
                      "freq": {
                        "additionalProperties": false,
                        "properties": {
                          "cap_count": {
                            "maximum": 100,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "cap_window_s": {
                            "maximum": 604800,
                            "minimum": 60,
                            "type": "integer"
                          },
                          "delay_s": {
                            "maximum": 60,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "min_interval_s": {
                            "type": "integer"
                          },
                          "per_page": {
                            "maximum": 5,
                            "minimum": 1,
                            "nullable": true,
                            "type": "integer"
                          },
                          "preset": {
                            "enum": [
                              "light",
                              "balanced",
                              "strong",
                              "per_page",
                              "custom"
                            ],
                            "type": "string"
                          },
                          "repeat_after_s": {
                            "anyOf": [
                              {
                                "enum": [
                                  0
                                ],
                                "type": "number"
                              },
                              {
                                "maximum": 86400,
                                "minimum": 60,
                                "type": "integer"
                              }
                            ],
                            "default": 0,
                            "description": "Seconds before the page quota refills: 0 disables refill, otherwise 60–86400. Requires custom frequency and a finite per_page quota."
                          }
                        },
                        "required": [
                          "preset",
                          "per_page",
                          "min_interval_s",
                          "cap_count",
                          "cap_window_s",
                          "delay_s"
                        ],
                        "type": "object"
                      },
                      "freq_cap_count": {
                        "type": "integer"
                      },
                      "freq_cap_hours": {
                        "type": "integer"
                      },
                      "id": {
                        "exclusiveMinimum": true,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "last_load_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "last_request_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "loads_24h": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "name": {
                        "type": "string"
                      },
                      "requests_24h": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "site_domain": {
                        "type": "string"
                      },
                      "site_id": {
                        "exclusiveMinimum": true,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "status": {
                        "enum": [
                          "active",
                          "paused"
                        ],
                        "type": "string"
                      },
                      "tag_state": {
                        "enum": [
                          "never",
                          "stale",
                          "live"
                        ],
                        "type": "string"
                      },
                      "via": {
                        "enum": [
                          "tag",
                          "smart_link",
                          "both"
                        ],
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "site_id",
                      "site_domain",
                      "name",
                      "category",
                      "category_source",
                      "freq_cap_count",
                      "freq_cap_hours",
                      "freq",
                      "direct_url_enabled",
                      "status",
                      "tag_state",
                      "loads_24h",
                      "last_load_at",
                      "adblock_rate",
                      "requests_24h",
                      "last_request_at",
                      "via",
                      "created_at"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "List zones of a site",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      },
      "post": {
        "description": "Create an ad zone under a site. Requires scope `publisher:write` (API key or web session); not available in view-as. Rate limit tier: `write`.",
        "operationId": "createZone",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "category": {
                    "description": "Required when the site category is network; not allowed otherwise. Changeable by the publisher only while the site is pending.",
                    "enum": [
                      "mainstream",
                      "adult"
                    ],
                    "type": "string"
                  },
                  "direct_url_enabled": {
                    "description": "Turn the zone's Smart Link on or off. Changing it requires the Direct Link permission on your account (ask support to enable it); otherwise the API returns 403 with reason direct_link_not_allowed. Turning it off with an API key requires the header X-Adnet-Confirm: true.",
                    "type": "boolean"
                  },
                  "freq": {
                    "additionalProperties": false,
                    "description": "Frequency settings. Use a preset (light, balanced, strong, per_page) or custom with explicit values. Send freq or the legacy freq_cap_count/freq_cap_hours, never both. No special permission is needed.",
                    "properties": {
                      "cap_count": {
                        "maximum": 100,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "cap_window_s": {
                        "maximum": 604800,
                        "minimum": 60,
                        "type": "integer"
                      },
                      "delay_s": {
                        "maximum": 60,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "min_interval_s": {
                        "type": "integer"
                      },
                      "per_page": {
                        "maximum": 5,
                        "minimum": 1,
                        "nullable": true,
                        "type": "integer"
                      },
                      "preset": {
                        "enum": [
                          "light",
                          "balanced",
                          "strong",
                          "per_page",
                          "custom"
                        ],
                        "type": "string"
                      },
                      "repeat_after_s": {
                        "anyOf": [
                          {
                            "enum": [
                              0
                            ],
                            "type": "number"
                          },
                          {
                            "maximum": 86400,
                            "minimum": 60,
                            "type": "integer"
                          }
                        ],
                        "description": "Seconds before the page quota refills: 0 disables refill, otherwise 60–86400. Requires custom frequency and a finite per_page quota."
                      }
                    },
                    "required": [
                      "preset"
                    ],
                    "type": "object"
                  },
                  "freq_cap_count": {
                    "maximum": 100,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "freq_cap_hours": {
                    "maximum": 168,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "name": {
                    "maxLength": 80,
                    "minLength": 1,
                    "type": "string"
                  }
                },
                "required": [
                  "name"
                ],
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "201": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "adblock_rate": {
                      "maximum": 1,
                      "minimum": 0,
                      "nullable": true,
                      "type": "number"
                    },
                    "category": {
                      "description": "Effective category of the zone.",
                      "enum": [
                        "mainstream",
                        "adult"
                      ],
                      "type": "string"
                    },
                    "category_source": {
                      "description": "zone when the category is set on the zone (network sites), site when inherited.",
                      "enum": [
                        "site",
                        "zone"
                      ],
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "direct_url_enabled": {
                      "type": "boolean"
                    },
                    "freq": {
                      "additionalProperties": false,
                      "properties": {
                        "cap_count": {
                          "maximum": 100,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "cap_window_s": {
                          "maximum": 604800,
                          "minimum": 60,
                          "type": "integer"
                        },
                        "delay_s": {
                          "maximum": 60,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "min_interval_s": {
                          "type": "integer"
                        },
                        "per_page": {
                          "maximum": 5,
                          "minimum": 1,
                          "nullable": true,
                          "type": "integer"
                        },
                        "preset": {
                          "enum": [
                            "light",
                            "balanced",
                            "strong",
                            "per_page",
                            "custom"
                          ],
                          "type": "string"
                        },
                        "repeat_after_s": {
                          "anyOf": [
                            {
                              "enum": [
                                0
                              ],
                              "type": "number"
                            },
                            {
                              "maximum": 86400,
                              "minimum": 60,
                              "type": "integer"
                            }
                          ],
                          "default": 0,
                          "description": "Seconds before the page quota refills: 0 disables refill, otherwise 60–86400. Requires custom frequency and a finite per_page quota."
                        }
                      },
                      "required": [
                        "preset",
                        "per_page",
                        "min_interval_s",
                        "cap_count",
                        "cap_window_s",
                        "delay_s"
                      ],
                      "type": "object"
                    },
                    "freq_cap_count": {
                      "type": "integer"
                    },
                    "freq_cap_hours": {
                      "type": "integer"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "last_load_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "last_request_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "loads_24h": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "requests_24h": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "site_domain": {
                      "type": "string"
                    },
                    "site_id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "status": {
                      "enum": [
                        "active",
                        "paused"
                      ],
                      "type": "string"
                    },
                    "tag_state": {
                      "enum": [
                        "never",
                        "stale",
                        "live"
                      ],
                      "type": "string"
                    },
                    "via": {
                      "enum": [
                        "tag",
                        "smart_link",
                        "both"
                      ],
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "site_domain",
                    "name",
                    "category",
                    "category_source",
                    "freq_cap_count",
                    "freq_cap_hours",
                    "freq",
                    "direct_url_enabled",
                    "status",
                    "tag_state",
                    "loads_24h",
                    "last_load_at",
                    "adblock_rate",
                    "requests_24h",
                    "last_request_at",
                    "via",
                    "created_at"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Create a zone",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "write",
        "x-required-scope": "publisher:write"
      }
    },
    "/v1/stats": {
      "get": {
        "description": "Pops, revenue and eCPM for the publisher, grouped by date, hour, site, zone, country, device, os, browser or page_domain; JSON or CSV. The browser filter accepts canonical browser keys. Revenue by browser is allocated in proportion to impressions. The browser view may be unavailable or switched off; check /v1/stats/availability. Unavailable browser grouping or filtering returns 400 breakdown_unavailable with breakdown browser (JSON and CSV) before statistics queries. Grouping or filtering by page_domain is available only once measurement is active: before that it returns 400 `page_domain_unavailable`, and JSON responses carry `page_domain_available`. With group_by containing `hour` the range (both ends inclusive, EST business days) must be at most 31 days, otherwise 400 `hour_range`; hourly revenue of finalized days is an allocation of the daily revenue (response has `hourly_revenue_allocated: true`), not a per-hour measurement; hours of days not yet finalized are estimates. JSON hours are ISO UTC; CSV hours display EST (UTC-5). Each row has status estimated, reported, final or mixed; zero valid impressions have null eCPM. The response identifies the accepted count and money snapshot. Requires scope publisher:read (API key or web session). Rate limit tier: stats.",
        "operationId": "getStats",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "group_by",
            "required": false,
            "schema": {
              "allOf": [
                {
                  "allOf": [
                    {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      ]
                    },
                    {
                      "items": {
                        "enum": [
                          "date",
                          "hour",
                          "site",
                          "zone",
                          "country",
                          "device",
                          "os",
                          "browser",
                          "page_domain"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    }
                  ]
                },
                {
                  "items": {
                    "enum": [
                      "date",
                      "hour",
                      "site",
                      "zone",
                      "country",
                      "device",
                      "os",
                      "browser",
                      "page_domain"
                    ],
                    "type": "string"
                  },
                  "maxItems": 3,
                  "type": "array"
                }
              ],
              "default": ""
            }
          },
          {
            "in": "query",
            "name": "metrics",
            "required": false,
            "schema": {
              "allOf": [
                {
                  "allOf": [
                    {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      ]
                    },
                    {
                      "items": {
                        "enum": [
                          "pops",
                          "revenue",
                          "ecpm"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    }
                  ]
                },
                {
                  "items": {
                    "enum": [
                      "pops",
                      "revenue",
                      "ecpm"
                    ],
                    "type": "string"
                  },
                  "minItems": 1,
                  "type": "array"
                }
              ],
              "default": "pops,revenue,ecpm"
            }
          },
          {
            "in": "query",
            "name": "site_id",
            "required": false,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "zone_id",
            "required": false,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "country",
            "required": false,
            "schema": {
              "pattern": "^[A-Z]{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "browser",
            "required": false,
            "schema": {
              "enum": [
                "chrome",
                "safari",
                "firefox",
                "edge",
                "samsung_internet",
                "opera",
                "uc_browser",
                "yandex",
                "other"
              ],
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "page_domain",
            "required": false,
            "schema": {
              "maxLength": 253,
              "minLength": 1,
              "pattern": "^[a-z0-9][a-z0-9.-]*$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "enum": [
                "json",
                "csv"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "browser_missing_days": {
                      "items": {
                        "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                        "type": "string"
                      },
                      "type": "array"
                    },
                    "count_basis": {
                      "enum": [
                        "valid",
                        "legacy",
                        "mixed"
                      ],
                      "type": "string"
                    },
                    "currency": {
                      "enum": [
                        "USD"
                      ],
                      "type": "string"
                    },
                    "data_as_of": {
                      "default": null,
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "estimated_from": {
                      "nullable": true,
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                      "type": "string"
                    },
                    "forecast_basis_version": {
                      "enum": [
                        "forecast-basis-v1"
                      ],
                      "type": "string"
                    },
                    "forecast_generation": {
                      "allOf": [
                        {
                          "maxLength": 19,
                          "pattern": "^[1-9]\\d*$",
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "forecast_updated_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "hourly_revenue_allocated": {
                      "enum": [
                        true
                      ],
                      "type": "boolean"
                    },
                    "measurement_definition": {
                      "additionalProperties": false,
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "includes_direct": {
                          "type": "boolean"
                        },
                        "includes_legacy": {
                          "type": "boolean"
                        },
                        "tag_valid_after_ms": {
                          "items": {
                            "maximum": 30000,
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "maxItems": 30,
                          "type": "array"
                        }
                      },
                      "required": [
                        "tag_valid_after_ms",
                        "includes_direct",
                        "includes_legacy",
                        "complete"
                      ],
                      "type": "object"
                    },
                    "measurement_generation": {
                      "allOf": [
                        {
                          "maxLength": 19,
                          "pattern": "^[1-9]\\d*$",
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "measurement_status": {
                      "enum": [
                        "ok",
                        "stale",
                        "updating"
                      ],
                      "type": "string"
                    },
                    "measurement_updated_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "money_basis_version": {
                      "pattern": "^money-basis-v[123]:[a-f0-9]{64}$",
                      "type": "string"
                    },
                    "money_generation": {
                      "allOf": [
                        {
                          "maxLength": 19,
                          "pattern": "^[1-9]\\d*$",
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "page_domain_available": {
                      "type": "boolean"
                    },
                    "rows": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "browser": {
                            "enum": [
                              "chrome",
                              "safari",
                              "firefox",
                              "edge",
                              "samsung_internet",
                              "opera",
                              "uc_browser",
                              "yandex",
                              "other"
                            ],
                            "type": "string"
                          },
                          "country": {
                            "type": "string"
                          },
                          "date": {
                            "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                            "type": "string"
                          },
                          "device": {
                            "type": "string"
                          },
                          "ecpm": {
                            "nullable": true,
                            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                            "type": "string"
                          },
                          "hour": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "os": {
                            "type": "string"
                          },
                          "page_domain": {
                            "maxLength": 253,
                            "minLength": 1,
                            "nullable": true,
                            "pattern": "^[a-z0-9][a-z0-9.-]*$",
                            "type": "string"
                          },
                          "pops": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "publisher_id": {
                            "exclusiveMinimum": true,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "revenue": {
                            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                            "type": "string"
                          },
                          "site_deleted": {
                            "enum": [
                              true
                            ],
                            "type": "boolean"
                          },
                          "site_domain": {
                            "type": "string"
                          },
                          "site_id": {
                            "exclusiveMinimum": true,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "status": {
                            "enum": [
                              "estimated",
                              "reported",
                              "final",
                              "mixed"
                            ],
                            "type": "string"
                          },
                          "zone_deleted": {
                            "enum": [
                              true
                            ],
                            "type": "boolean"
                          },
                          "zone_id": {
                            "exclusiveMinimum": true,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "zone_name": {
                            "type": "string"
                          }
                        },
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "totals": {
                      "additionalProperties": false,
                      "properties": {
                        "ecpm": {
                          "nullable": true,
                          "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        },
                        "pops": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "revenue": {
                          "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        },
                        "status": {
                          "enum": [
                            "estimated",
                            "reported",
                            "final",
                            "mixed"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "pops",
                        "revenue",
                        "ecpm"
                      ],
                      "type": "object"
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "updated_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "rows",
                    "totals",
                    "currency",
                    "estimated_from"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "anyOf": [
                    {
                      "additionalProperties": false,
                      "properties": {
                        "breakdown": {
                          "enum": [
                            "browser"
                          ],
                          "type": "string"
                        },
                        "error": {
                          "enum": [
                            "breakdown_unavailable"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "error",
                        "breakdown"
                      ],
                      "type": "object"
                    },
                    {
                      "additionalProperties": false,
                      "properties": {
                        "error": {
                          "type": "string"
                        },
                        "message": {
                          "type": "string"
                        },
                        "reason": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "error"
                      ],
                      "type": "object"
                    }
                  ]
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "summary": "Get statistics",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "stats",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/stats/availability": {
      "get": {
        "description": "Returns browser_available: true when statistics may be grouped or filtered by browser, or false when this view is unavailable for the account configuration. Also returns browser_enabled: false when the browser view is switched off (hide the option) and browser_data_since: the first EST business day (YYYY-MM-DD) from which every hour carries a browser label, or null when unknown; earlier traffic is grouped as other. Check before selecting a browser view. Unavailable browser grouping or filtering returns 400 breakdown_unavailable with breakdown browser for JSON and CSV. Requires scope publisher:read (API key or web session). Rate limit tier: read.",
        "operationId": "getStatsAvailability",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "browser_available": {
                      "type": "boolean"
                    },
                    "browser_data_since": {
                      "nullable": true,
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                      "type": "string"
                    },
                    "browser_enabled": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "browser_available"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Get available statistics views",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/stats/subid": {
      "get": {
        "description": "Pops, revenue and eCPM grouped by sub1, sub2 and sub3, for at most 90 days; JSON or CSV. Revenue per subid is an allocation of the revenue reported by /v1/stats for each zone and country in proportion to pops, not a separate measurement (`revenue_allocated` is always true); the totals equal the totals of /v1/stats for the same range and filters. Rows are sorted by revenue; rows beyond `limit` are merged into one row whose subid is `~other`. A null subid means no subid was sent. Requires scope publisher:read (API key or web session). Rate limit tier: stats.",
        "operationId": "getSubidStats",
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "required": true,
            "schema": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "to",
            "required": true,
            "schema": {
              "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "group_by",
            "required": false,
            "schema": {
              "allOf": [
                {
                  "allOf": [
                    {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      ]
                    },
                    {
                      "items": {
                        "enum": [
                          "sub1",
                          "sub2",
                          "sub3"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    }
                  ]
                },
                {
                  "items": {
                    "enum": [
                      "sub1",
                      "sub2",
                      "sub3"
                    ],
                    "type": "string"
                  },
                  "maxItems": 3,
                  "minItems": 1,
                  "type": "array"
                }
              ],
              "default": "sub1"
            }
          },
          {
            "in": "query",
            "name": "site_id",
            "required": false,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "zone_id",
            "required": false,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "sub1",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z0-9._-]{1,64}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sub2",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z0-9._-]{1,64}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "sub3",
            "required": false,
            "schema": {
              "pattern": "^[A-Za-z0-9._-]{1,64}$",
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "required": false,
            "schema": {
              "maximum": 1000,
              "minimum": 1,
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "format",
            "required": false,
            "schema": {
              "enum": [
                "json",
                "csv"
              ],
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "count_basis": {
                      "enum": [
                        "valid",
                        "legacy",
                        "mixed"
                      ],
                      "type": "string"
                    },
                    "currency": {
                      "enum": [
                        "USD"
                      ],
                      "type": "string"
                    },
                    "estimated_from": {
                      "nullable": true,
                      "pattern": "^\\d{4}-\\d{2}-\\d{2}$",
                      "type": "string"
                    },
                    "forecast_basis_version": {
                      "enum": [
                        "forecast-basis-v1"
                      ],
                      "type": "string"
                    },
                    "forecast_generation": {
                      "allOf": [
                        {
                          "maxLength": 19,
                          "pattern": "^[1-9]\\d*$",
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "forecast_updated_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "measurement_definition": {
                      "additionalProperties": false,
                      "properties": {
                        "complete": {
                          "type": "boolean"
                        },
                        "includes_direct": {
                          "type": "boolean"
                        },
                        "includes_legacy": {
                          "type": "boolean"
                        },
                        "tag_valid_after_ms": {
                          "items": {
                            "maximum": 30000,
                            "minimum": 1000,
                            "type": "integer"
                          },
                          "maxItems": 30,
                          "type": "array"
                        }
                      },
                      "required": [
                        "tag_valid_after_ms",
                        "includes_direct",
                        "includes_legacy",
                        "complete"
                      ],
                      "type": "object"
                    },
                    "measurement_generation": {
                      "allOf": [
                        {
                          "maxLength": 19,
                          "pattern": "^[1-9]\\d*$",
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "measurement_status": {
                      "enum": [
                        "ok",
                        "stale",
                        "updating"
                      ],
                      "type": "string"
                    },
                    "measurement_updated_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "money_basis_version": {
                      "pattern": "^money-basis-v[123]:[a-f0-9]{64}$",
                      "type": "string"
                    },
                    "money_generation": {
                      "allOf": [
                        {
                          "maxLength": 19,
                          "pattern": "^[1-9]\\d*$",
                          "type": "string"
                        },
                        {
                          "type": "string"
                        }
                      ]
                    },
                    "revenue_allocated": {
                      "enum": [
                        true
                      ],
                      "type": "boolean"
                    },
                    "rows": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "ecpm": {
                            "nullable": true,
                            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                            "type": "string"
                          },
                          "pops": {
                            "minimum": 0,
                            "type": "integer"
                          },
                          "revenue": {
                            "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                            "type": "string"
                          },
                          "status": {
                            "enum": [
                              "estimated",
                              "reported",
                              "final",
                              "mixed"
                            ],
                            "type": "string"
                          },
                          "sub1": {
                            "nullable": true,
                            "type": "string"
                          },
                          "sub2": {
                            "nullable": true,
                            "type": "string"
                          },
                          "sub3": {
                            "nullable": true,
                            "type": "string"
                          }
                        },
                        "required": [
                          "pops",
                          "revenue",
                          "ecpm"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "totals": {
                      "additionalProperties": false,
                      "properties": {
                        "ecpm": {
                          "nullable": true,
                          "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        },
                        "pops": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "revenue": {
                          "pattern": "^-?\\d+(\\.\\d{1,6})?$",
                          "type": "string"
                        },
                        "status": {
                          "enum": [
                            "estimated",
                            "reported",
                            "final",
                            "mixed"
                          ],
                          "type": "string"
                        }
                      },
                      "required": [
                        "pops",
                        "revenue",
                        "ecpm"
                      ],
                      "type": "object"
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "updated_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "rows",
                    "totals",
                    "currency",
                    "estimated_from",
                    "revenue_allocated"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          }
        },
        "summary": "Get statistics by subid",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "stats",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/stats/subid/availability": {
      "get": {
        "description": "Whether statistics by subid are enabled. Requires scope publisher:read (API key or web session).",
        "operationId": "getSubidStatsAvailability",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "enabled": {
                      "type": "boolean"
                    }
                  },
                  "required": [
                    "enabled"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Subid statistics availability",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/telegram/links": {
      "get": {
        "description": "Active and blocked Telegram links for this publisher. Chat identifiers are private. Returns enabled:false when Telegram is unavailable. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "listTelegramLinks",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "bot_username": {
                      "nullable": true,
                      "type": "string"
                    },
                    "enabled": {
                      "type": "boolean"
                    },
                    "links": {
                      "items": {
                        "additionalProperties": false,
                        "properties": {
                          "created_at": {
                            "format": "date-time",
                            "type": "string"
                          },
                          "id": {
                            "exclusiveMinimum": true,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "locale": {
                            "enum": [
                              "en",
                              "vi",
                              "es",
                              "pt",
                              "fr",
                              "id",
                              "ru",
                              "zh",
                              "ar"
                            ],
                            "type": "string"
                          },
                          "status": {
                            "enum": [
                              "active",
                              "blocked"
                            ],
                            "type": "string"
                          },
                          "tg_username": {
                            "nullable": true,
                            "type": "string"
                          }
                        },
                        "required": [
                          "id",
                          "tg_username",
                          "locale",
                          "status",
                          "created_at"
                        ],
                        "type": "object"
                      },
                      "type": "array"
                    },
                    "max_links": {
                      "enum": [
                        3
                      ],
                      "type": "number"
                    }
                  },
                  "required": [
                    "enabled",
                    "bot_username",
                    "max_links",
                    "links"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "List Telegram links",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/whoami": {
      "get": {
        "description": "Actor behind the current API key or session, with its scopes. Any authenticated actor. Rate limit tier: `read`.",
        "operationId": "whoAmI",
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "actor_id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "nullable": true,
                      "type": "integer"
                    },
                    "actor_type": {
                      "type": "string"
                    },
                    "api_key_id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "nullable": true,
                      "type": "integer"
                    },
                    "scopes": {
                      "items": {
                        "enum": [
                          "publisher:read",
                          "publisher:write",
                          "admin:read",
                          "admin:write",
                          "infra:read",
                          "infra:write",
                          "adv:read",
                          "adv:write",
                          "scan:work",
                          "dsp0:review"
                        ],
                        "type": "string"
                      },
                      "type": "array"
                    }
                  },
                  "required": [
                    "actor_type",
                    "actor_id",
                    "api_key_id",
                    "scopes"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Who am I",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "any"
      }
    },
    "/v1/zones": {
      "get": {
        "description": "List all ad zones of the publisher, optionally filtered by site_id. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "listZones",
        "parameters": [
          {
            "in": "query",
            "name": "site_id",
            "required": false,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "items": {
                    "additionalProperties": false,
                    "properties": {
                      "adblock_rate": {
                        "maximum": 1,
                        "minimum": 0,
                        "nullable": true,
                        "type": "number"
                      },
                      "category": {
                        "description": "Effective category of the zone.",
                        "enum": [
                          "mainstream",
                          "adult"
                        ],
                        "type": "string"
                      },
                      "category_source": {
                        "description": "zone when the category is set on the zone (network sites), site when inherited.",
                        "enum": [
                          "site",
                          "zone"
                        ],
                        "type": "string"
                      },
                      "created_at": {
                        "format": "date-time",
                        "type": "string"
                      },
                      "direct_url_enabled": {
                        "type": "boolean"
                      },
                      "freq": {
                        "additionalProperties": false,
                        "properties": {
                          "cap_count": {
                            "maximum": 100,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "cap_window_s": {
                            "maximum": 604800,
                            "minimum": 60,
                            "type": "integer"
                          },
                          "delay_s": {
                            "maximum": 60,
                            "minimum": 0,
                            "type": "integer"
                          },
                          "min_interval_s": {
                            "type": "integer"
                          },
                          "per_page": {
                            "maximum": 5,
                            "minimum": 1,
                            "nullable": true,
                            "type": "integer"
                          },
                          "preset": {
                            "enum": [
                              "light",
                              "balanced",
                              "strong",
                              "per_page",
                              "custom"
                            ],
                            "type": "string"
                          },
                          "repeat_after_s": {
                            "anyOf": [
                              {
                                "enum": [
                                  0
                                ],
                                "type": "number"
                              },
                              {
                                "maximum": 86400,
                                "minimum": 60,
                                "type": "integer"
                              }
                            ],
                            "default": 0,
                            "description": "Seconds before the page quota refills: 0 disables refill, otherwise 60–86400. Requires custom frequency and a finite per_page quota."
                          }
                        },
                        "required": [
                          "preset",
                          "per_page",
                          "min_interval_s",
                          "cap_count",
                          "cap_window_s",
                          "delay_s"
                        ],
                        "type": "object"
                      },
                      "freq_cap_count": {
                        "type": "integer"
                      },
                      "freq_cap_hours": {
                        "type": "integer"
                      },
                      "id": {
                        "exclusiveMinimum": true,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "last_load_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "last_request_at": {
                        "format": "date-time",
                        "nullable": true,
                        "type": "string"
                      },
                      "loads_24h": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "name": {
                        "type": "string"
                      },
                      "requests_24h": {
                        "minimum": 0,
                        "type": "integer"
                      },
                      "site_domain": {
                        "type": "string"
                      },
                      "site_id": {
                        "exclusiveMinimum": true,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "status": {
                        "enum": [
                          "active",
                          "paused"
                        ],
                        "type": "string"
                      },
                      "tag_state": {
                        "enum": [
                          "never",
                          "stale",
                          "live"
                        ],
                        "type": "string"
                      },
                      "via": {
                        "enum": [
                          "tag",
                          "smart_link",
                          "both"
                        ],
                        "nullable": true,
                        "type": "string"
                      }
                    },
                    "required": [
                      "id",
                      "site_id",
                      "site_domain",
                      "name",
                      "category",
                      "category_source",
                      "freq_cap_count",
                      "freq_cap_hours",
                      "freq",
                      "direct_url_enabled",
                      "status",
                      "tag_state",
                      "loads_24h",
                      "last_load_at",
                      "adblock_rate",
                      "requests_24h",
                      "last_request_at",
                      "via",
                      "created_at"
                    ],
                    "type": "object"
                  },
                  "type": "array"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "List zones",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    },
    "/v1/zones/{id}": {
      "delete": {
        "description": "Delete a zone. Requires the manage permission on your account (ask support to enable it); otherwise 403 with reason manage_not_allowed. With an API key, send the header X-Adnet-Confirm: true. Traffic stops within seconds; statistics and earnings are kept. Contact support to restore the zone. Requires scope publisher:write; not available in view-as. Rate limit tier: write.",
        "operationId": "deleteZone",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Send `true` to confirm a destructive action when calling with an API key. Required for: deleting a site or zone; pausing a zone (status: paused); turning Smart Link off (direct_url_enabled: false). Not needed for renaming, changing frequency, resuming a zone, or turning Smart Link on. Web sessions do not need it.",
            "in": "header",
            "name": "x-adnet-confirm",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "204": {
            "content": {
              "application/json": {
                "schema": {
                  "not": {}
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Delete a zone",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "write",
        "x-required-scope": "publisher:write"
      },
      "get": {
        "description": "Return one zone owned by the publisher. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "getZone",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "adblock_rate": {
                      "maximum": 1,
                      "minimum": 0,
                      "nullable": true,
                      "type": "number"
                    },
                    "category": {
                      "description": "Effective category of the zone.",
                      "enum": [
                        "mainstream",
                        "adult"
                      ],
                      "type": "string"
                    },
                    "category_source": {
                      "description": "zone when the category is set on the zone (network sites), site when inherited.",
                      "enum": [
                        "site",
                        "zone"
                      ],
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "direct_url_enabled": {
                      "type": "boolean"
                    },
                    "freq": {
                      "additionalProperties": false,
                      "properties": {
                        "cap_count": {
                          "maximum": 100,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "cap_window_s": {
                          "maximum": 604800,
                          "minimum": 60,
                          "type": "integer"
                        },
                        "delay_s": {
                          "maximum": 60,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "min_interval_s": {
                          "type": "integer"
                        },
                        "per_page": {
                          "maximum": 5,
                          "minimum": 1,
                          "nullable": true,
                          "type": "integer"
                        },
                        "preset": {
                          "enum": [
                            "light",
                            "balanced",
                            "strong",
                            "per_page",
                            "custom"
                          ],
                          "type": "string"
                        },
                        "repeat_after_s": {
                          "anyOf": [
                            {
                              "enum": [
                                0
                              ],
                              "type": "number"
                            },
                            {
                              "maximum": 86400,
                              "minimum": 60,
                              "type": "integer"
                            }
                          ],
                          "default": 0,
                          "description": "Seconds before the page quota refills: 0 disables refill, otherwise 60–86400. Requires custom frequency and a finite per_page quota."
                        }
                      },
                      "required": [
                        "preset",
                        "per_page",
                        "min_interval_s",
                        "cap_count",
                        "cap_window_s",
                        "delay_s"
                      ],
                      "type": "object"
                    },
                    "freq_cap_count": {
                      "type": "integer"
                    },
                    "freq_cap_hours": {
                      "type": "integer"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "last_load_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "last_request_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "loads_24h": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "requests_24h": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "site_domain": {
                      "type": "string"
                    },
                    "site_id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "status": {
                      "enum": [
                        "active",
                        "paused"
                      ],
                      "type": "string"
                    },
                    "tag_state": {
                      "enum": [
                        "never",
                        "stale",
                        "live"
                      ],
                      "type": "string"
                    },
                    "via": {
                      "enum": [
                        "tag",
                        "smart_link",
                        "both"
                      ],
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "site_domain",
                    "name",
                    "category",
                    "category_source",
                    "freq_cap_count",
                    "freq_cap_hours",
                    "freq",
                    "direct_url_enabled",
                    "status",
                    "tag_state",
                    "loads_24h",
                    "last_load_at",
                    "adblock_rate",
                    "requests_24h",
                    "last_request_at",
                    "via",
                    "created_at"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Get a zone",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      },
      "put": {
        "description": "Update fields of a zone owned by the publisher. Requires scope `publisher:write` (API key or web session); not available in view-as. Renaming and changing frequency need no confirmation. With an API key, pausing an active zone or turning its Smart Link off requires the header `X-Adnet-Confirm: true` (otherwise 428). Changing `direct_url_enabled` needs the Direct Link permission (403 `direct_link_not_allowed`). After the site is approved, changing the category of a network-site zone from mainstream to adult is always allowed; from adult to mainstream requires the manage permission (409 `manage_not_allowed`). Rate limit tier: `write`.",
        "operationId": "updateZone",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          },
          {
            "description": "Send `true` to confirm a destructive action when calling with an API key. Required for: deleting a site or zone; pausing a zone (status: paused); turning Smart Link off (direct_url_enabled: false). Not needed for renaming, changing frequency, resuming a zone, or turning Smart Link on. Web sessions do not need it.",
            "in": "header",
            "name": "x-adnet-confirm",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "schema": {
                "additionalProperties": false,
                "properties": {
                  "category": {
                    "description": "Required when the site category is network; not allowed otherwise. Changeable by the publisher only while the site is pending.",
                    "enum": [
                      "mainstream",
                      "adult"
                    ],
                    "type": "string"
                  },
                  "direct_url_enabled": {
                    "description": "Turn the zone's Smart Link on or off. Changing it requires the Direct Link permission on your account (ask support to enable it); otherwise the API returns 403 with reason direct_link_not_allowed. Turning it off with an API key requires the header X-Adnet-Confirm: true.",
                    "type": "boolean"
                  },
                  "freq": {
                    "additionalProperties": false,
                    "description": "Frequency settings. Use a preset (light, balanced, strong, per_page) or custom with explicit values. Send freq or the legacy freq_cap_count/freq_cap_hours, never both. No special permission is needed.",
                    "properties": {
                      "cap_count": {
                        "maximum": 100,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "cap_window_s": {
                        "maximum": 604800,
                        "minimum": 60,
                        "type": "integer"
                      },
                      "delay_s": {
                        "maximum": 60,
                        "minimum": 0,
                        "type": "integer"
                      },
                      "min_interval_s": {
                        "type": "integer"
                      },
                      "per_page": {
                        "maximum": 5,
                        "minimum": 1,
                        "nullable": true,
                        "type": "integer"
                      },
                      "preset": {
                        "enum": [
                          "light",
                          "balanced",
                          "strong",
                          "per_page",
                          "custom"
                        ],
                        "type": "string"
                      },
                      "repeat_after_s": {
                        "anyOf": [
                          {
                            "enum": [
                              0
                            ],
                            "type": "number"
                          },
                          {
                            "maximum": 86400,
                            "minimum": 60,
                            "type": "integer"
                          }
                        ],
                        "description": "Seconds before the page quota refills: 0 disables refill, otherwise 60–86400. Requires custom frequency and a finite per_page quota."
                      }
                    },
                    "required": [
                      "preset"
                    ],
                    "type": "object"
                  },
                  "freq_cap_count": {
                    "maximum": 100,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "freq_cap_hours": {
                    "maximum": 168,
                    "minimum": 1,
                    "type": "integer"
                  },
                  "name": {
                    "maxLength": 80,
                    "minLength": 1,
                    "type": "string"
                  },
                  "status": {
                    "enum": [
                      "active",
                      "paused"
                    ],
                    "type": "string"
                  }
                },
                "type": "object"
              }
            }
          },
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "adblock_rate": {
                      "maximum": 1,
                      "minimum": 0,
                      "nullable": true,
                      "type": "number"
                    },
                    "category": {
                      "description": "Effective category of the zone.",
                      "enum": [
                        "mainstream",
                        "adult"
                      ],
                      "type": "string"
                    },
                    "category_source": {
                      "description": "zone when the category is set on the zone (network sites), site when inherited.",
                      "enum": [
                        "site",
                        "zone"
                      ],
                      "type": "string"
                    },
                    "created_at": {
                      "format": "date-time",
                      "type": "string"
                    },
                    "direct_url_enabled": {
                      "type": "boolean"
                    },
                    "freq": {
                      "additionalProperties": false,
                      "properties": {
                        "cap_count": {
                          "maximum": 100,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "cap_window_s": {
                          "maximum": 604800,
                          "minimum": 60,
                          "type": "integer"
                        },
                        "delay_s": {
                          "maximum": 60,
                          "minimum": 0,
                          "type": "integer"
                        },
                        "min_interval_s": {
                          "type": "integer"
                        },
                        "per_page": {
                          "maximum": 5,
                          "minimum": 1,
                          "nullable": true,
                          "type": "integer"
                        },
                        "preset": {
                          "enum": [
                            "light",
                            "balanced",
                            "strong",
                            "per_page",
                            "custom"
                          ],
                          "type": "string"
                        },
                        "repeat_after_s": {
                          "anyOf": [
                            {
                              "enum": [
                                0
                              ],
                              "type": "number"
                            },
                            {
                              "maximum": 86400,
                              "minimum": 60,
                              "type": "integer"
                            }
                          ],
                          "default": 0,
                          "description": "Seconds before the page quota refills: 0 disables refill, otherwise 60–86400. Requires custom frequency and a finite per_page quota."
                        }
                      },
                      "required": [
                        "preset",
                        "per_page",
                        "min_interval_s",
                        "cap_count",
                        "cap_window_s",
                        "delay_s"
                      ],
                      "type": "object"
                    },
                    "freq_cap_count": {
                      "type": "integer"
                    },
                    "freq_cap_hours": {
                      "type": "integer"
                    },
                    "id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "last_load_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "last_request_at": {
                      "format": "date-time",
                      "nullable": true,
                      "type": "string"
                    },
                    "loads_24h": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "requests_24h": {
                      "minimum": 0,
                      "type": "integer"
                    },
                    "site_domain": {
                      "type": "string"
                    },
                    "site_id": {
                      "exclusiveMinimum": true,
                      "minimum": 0,
                      "type": "integer"
                    },
                    "status": {
                      "enum": [
                        "active",
                        "paused"
                      ],
                      "type": "string"
                    },
                    "tag_state": {
                      "enum": [
                        "never",
                        "stale",
                        "live"
                      ],
                      "type": "string"
                    },
                    "via": {
                      "enum": [
                        "tag",
                        "smart_link",
                        "both"
                      ],
                      "nullable": true,
                      "type": "string"
                    }
                  },
                  "required": [
                    "id",
                    "site_id",
                    "site_domain",
                    "name",
                    "category",
                    "category_source",
                    "freq_cap_count",
                    "freq_cap_hours",
                    "freq",
                    "direct_url_enabled",
                    "status",
                    "tag_state",
                    "loads_24h",
                    "last_load_at",
                    "adblock_rate",
                    "requests_24h",
                    "last_request_at",
                    "via",
                    "created_at"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "409": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "428": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Update a zone",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "write",
        "x-required-scope": "publisher:write"
      }
    },
    "/v1/zones/{id}/code": {
      "get": {
        "description": "Return the embed code snippet for a zone. Requires scope `publisher:read` (API key or web session). Rate limit tier: `read`.",
        "operationId": "getZoneCode",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "exclusiveMinimum": true,
              "maximum": 2147483647,
              "minimum": 0,
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "direct_url": {
                      "nullable": true,
                      "type": "string"
                    },
                    "loader": {
                      "type": "string"
                    },
                    "tag": {
                      "additionalProperties": false,
                      "properties": {
                        "adblock_rate": {
                          "maximum": 1,
                          "minimum": 0,
                          "nullable": true,
                          "type": "number"
                        },
                        "last_load_at": {
                          "format": "date-time",
                          "nullable": true,
                          "type": "string"
                        },
                        "last_request_at": {
                          "format": "date-time",
                          "nullable": true,
                          "type": "string"
                        },
                        "loads_24h": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "requests_24h": {
                          "minimum": 0,
                          "type": "integer"
                        },
                        "state": {
                          "enum": [
                            "never",
                            "stale",
                            "live"
                          ],
                          "type": "string"
                        },
                        "via": {
                          "enum": [
                            "tag",
                            "smart_link",
                            "both"
                          ],
                          "nullable": true,
                          "type": "string"
                        }
                      },
                      "required": [
                        "state",
                        "loads_24h",
                        "last_load_at",
                        "adblock_rate",
                        "requests_24h",
                        "last_request_at",
                        "via"
                      ],
                      "type": "object"
                    }
                  },
                  "required": [
                    "loader",
                    "direct_url",
                    "tag"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "401": {
            "$ref": "#/components/responses/Unauthorized"
          },
          "403": {
            "$ref": "#/components/responses/Forbidden"
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "additionalProperties": false,
                  "properties": {
                    "error": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "reason": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "error"
                  ],
                  "type": "object"
                }
              }
            },
            "description": "Default Response"
          },
          "429": {
            "$ref": "#/components/responses/RateLimited"
          }
        },
        "summary": "Get zone embed code",
        "tags": [
          "publisher"
        ],
        "x-rate-limit-tier": "read",
        "x-required-scope": "publisher:read"
      }
    }
  },
  "security": [
    {
      "bearer": []
    }
  ],
  "servers": [
    {
      "url": "https://app.agimone.com"
    }
  ],
  "tags": [
    {
      "description": "Publisher data: sites, zones, statistics, earnings, balance, payouts, profile and API keys. Requires an API key (`Authorization: Bearer adk_...`) with scope `publisher:read` or `publisher:write`.",
      "name": "publisher"
    },
    {
      "description": "Public operations that need no authentication (rate limited per IP).",
      "name": "public"
    }
  ]
}
