{
  "openapi": "3.1.0",
  "info": {
    "title": "BrandVisibility Reporting API",
    "version": "1.0.0",
    "description": "Read-only reporting data for the teams your credential can access."
  },
  "servers": [
    {
      "url": "https://api.brandvisibility.ai"
    }
  ],
  "paths": {
    "/api/v1/reporting/teams": {
      "get": {
        "tags": [
          "Reporting API"
        ],
        "summary": "List teams you can access",
        "description": "List the teams this credential may read.",
        "operationId": "teams",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Page size, 1-200",
              "default": 50,
              "title": "Limit"
            },
            "description": "Page size, 1-200"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "next_cursor from the previous page",
              "title": "Cursor"
            },
            "description": "next_cursor from the previous page"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_Team_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, parameter or cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Credential lacks the scope, or the organization's plan has lapsed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not accessible to this caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reporting/teams/{team_id}": {
      "get": {
        "tags": [
          "Reporting API"
        ],
        "summary": "Get a team",
        "operationId": "team",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Team Id"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Item_Team_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, parameter or cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Credential lacks the scope, or the organization's plan has lapsed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not accessible to this caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        },
        "description": "Read a team this credential may access."
      }
    },
    "/api/v1/reporting/teams/{team_id}/rankings": {
      "get": {
        "tags": [
          "Reporting API"
        ],
        "summary": "Rankings by query, brand and model",
        "description": "Read rankings and sentiment by query, brand and model.",
        "operationId": "rankings",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Team Id"
            }
          },
          {
            "name": "brand_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "title": "Brand Id"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Restrict to one AI provider",
              "title": "Provider Id"
            },
            "description": "Restrict to one AI provider"
          },
          {
            "name": "tag_ids",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "array",
                  "items": {
                    "type": "string",
                    "format": "uuid"
                  },
                  "maxItems": 50
                },
                {
                  "type": "null"
                }
              ],
              "title": "Tag Ids"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "prompt",
                "brand_name",
                "model",
                "current_rank",
                "current_sentiment",
                "response_count",
                "latest_date"
              ],
              "type": "string",
              "default": "prompt",
              "title": "Sort"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "asc",
              "title": "Direction"
            }
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Page size, 1-200",
              "default": 50,
              "title": "Limit"
            },
            "description": "Page size, 1-200"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "next_cursor from the previous page",
              "title": "Cursor"
            },
            "description": "next_cursor from the previous page"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive, YYYY-MM-DD. Default: 29 days before end_date.",
              "title": "Start Date"
            },
            "description": "Inclusive, YYYY-MM-DD. Default: 29 days before end_date."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive, YYYY-MM-DD. Default: today (UTC).",
              "title": "End Date"
            },
            "description": "Inclusive, YYYY-MM-DD. Default: today (UTC)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_Ranking_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, parameter or cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Credential lacks the scope, or the organization's plan has lapsed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not accessible to this caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reporting/teams/{team_id}/visibility": {
      "get": {
        "tags": [
          "Reporting API"
        ],
        "summary": "Brand visibility rate",
        "description": "Read brand visibility for the selected period and compare it with the preceding period.",
        "operationId": "visibility",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Team Id"
            }
          },
          {
            "name": "interval",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "day",
                "week",
                "month"
              ],
              "type": "string",
              "description": "Bucket size for mentions_by_period",
              "default": "day",
              "title": "Interval"
            },
            "description": "Bucket size for mentions_by_period"
          },
          {
            "name": "provider_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Restrict to one AI provider",
              "title": "Provider Id"
            },
            "description": "Restrict to one AI provider"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive, YYYY-MM-DD. Default: 29 days before end_date.",
              "title": "Start Date"
            },
            "description": "Inclusive, YYYY-MM-DD. Default: 29 days before end_date."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive, YYYY-MM-DD. Default: today (UTC).",
              "title": "End Date"
            },
            "description": "Inclusive, YYYY-MM-DD. Default: today (UTC)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_BrandVisibility_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, parameter or cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Credential lacks the scope, or the organization's plan has lapsed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not accessible to this caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reporting/teams/{team_id}/competitors": {
      "get": {
        "tags": [
          "Reporting API"
        ],
        "summary": "Competitor visibility rates",
        "description": "Compare visibility for your brand and its competitors.",
        "operationId": "competitors",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Team Id"
            }
          },
          {
            "name": "scope",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "all",
                "verified",
                "top"
              ],
              "type": "string",
              "description": "Row filter; rates don't change with it",
              "default": "all",
              "title": "Scope"
            },
            "description": "Row filter; rates don't change with it"
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "minLength": 1,
                  "maxLength": 100
                },
                {
                  "type": "null"
                }
              ],
              "description": "Brand-name substring",
              "title": "Search"
            },
            "description": "Brand-name substring"
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "visibility_rate",
                "name"
              ],
              "type": "string",
              "default": "visibility_rate",
              "title": "Sort"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Direction"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Restrict to one AI provider",
              "title": "Provider Id"
            },
            "description": "Restrict to one AI provider"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Page size, 1-200",
              "default": 50,
              "title": "Limit"
            },
            "description": "Page size, 1-200"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "next_cursor from the previous page",
              "title": "Cursor"
            },
            "description": "next_cursor from the previous page"
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive, YYYY-MM-DD. Default: 29 days before end_date.",
              "title": "Start Date"
            },
            "description": "Inclusive, YYYY-MM-DD. Default: 29 days before end_date."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "date"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Inclusive, YYYY-MM-DD. Default: today (UTC).",
              "title": "End Date"
            },
            "description": "Inclusive, YYYY-MM-DD. Default: today (UTC)."
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_CompetitorVisibility_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, parameter or cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Credential lacks the scope, or the organization's plan has lapsed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not accessible to this caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    },
    "/api/v1/reporting/teams/{team_id}/citations": {
      "get": {
        "tags": [
          "Reporting API"
        ],
        "summary": "Sources cited by AI responses",
        "description": "Read cited domains or URLs, including rolling 90-day and all-time measures.",
        "operationId": "citations",
        "security": [
          {
            "BearerAuth": []
          }
        ],
        "parameters": [
          {
            "name": "team_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "format": "uuid",
              "title": "Team Id"
            }
          },
          {
            "name": "level",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "domain",
                "url"
              ],
              "type": "string",
              "default": "domain",
              "title": "Level"
            }
          },
          {
            "name": "sort",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "references_last_90_days",
                "references_all_time",
                "first_cited_at",
                "last_cited_at",
                "source"
              ],
              "type": "string",
              "default": "references_last_90_days",
              "title": "Sort"
            }
          },
          {
            "name": "direction",
            "in": "query",
            "required": false,
            "schema": {
              "enum": [
                "asc",
                "desc"
              ],
              "type": "string",
              "default": "desc",
              "title": "Direction"
            }
          },
          {
            "name": "provider_id",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string",
                  "format": "uuid"
                },
                {
                  "type": "null"
                }
              ],
              "description": "Restrict to one AI provider",
              "title": "Provider Id"
            },
            "description": "Restrict to one AI provider"
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "maximum": 200,
              "minimum": 1,
              "description": "Page size, 1-200",
              "default": 50,
              "title": "Limit"
            },
            "description": "Page size, 1-200"
          },
          {
            "name": "cursor",
            "in": "query",
            "required": false,
            "schema": {
              "anyOf": [
                {
                  "type": "string"
                },
                {
                  "type": "null"
                }
              ],
              "description": "next_cursor from the previous page",
              "title": "Cursor"
            },
            "description": "next_cursor from the previous page"
          }
        ],
        "responses": {
          "200": {
            "description": "Successful Response",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Page_Citation_"
                }
              }
            }
          },
          "400": {
            "description": "Invalid request, parameter or cursor",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid credentials",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "403": {
            "description": "Credential lacks the scope, or the organization's plan has lapsed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "404": {
            "description": "Not found, or not accessible to this caller",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "429": {
            "description": "Rate limit exceeded",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          },
          "500": {
            "description": "Internal error",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ErrorResponse"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "BearerAuth": {
        "type": "http",
        "scheme": "bearer",
        "description": "An organisation API key or MCP OAuth token with reporting:read access."
      }
    },
    "schemas": {
      "BrandVisibility": {
        "properties": {
          "brand_name": {
            "type": "string",
            "title": "Brand Name"
          },
          "visibility_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visibility Rate",
            "description": "Percentage of possible responses mentioning the brand"
          },
          "previous_visibility_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Visibility Rate",
            "description": "Same measure over the equal-length preceding period"
          },
          "change": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Change",
            "description": "Period-over-period change, percentage points"
          },
          "mentions": {
            "type": "number",
            "title": "Mentions",
            "default": 0
          },
          "previous_mentions": {
            "type": "number",
            "title": "Previous Mentions",
            "default": 0
          },
          "query_count": {
            "type": "integer",
            "title": "Query Count",
            "default": 0
          },
          "day_count": {
            "type": "integer",
            "title": "Day Count",
            "default": 0
          },
          "provider_count": {
            "type": "integer",
            "title": "Provider Count",
            "default": 0
          },
          "mentions_by_period": {
            "additionalProperties": {
              "additionalProperties": {
                "type": "number"
              },
              "type": "object"
            },
            "type": "object",
            "title": "Mentions By Period",
            "description": "period start (per `interval`) -> provider name -> mention count"
          }
        },
        "type": "object",
        "required": [
          "brand_name"
        ],
        "title": "BrandVisibility",
        "description": "How often a brand appears in AI responses over the period.\n\nSame calculation as the dashboard Rankings page (get_brand_comparison):\nmentions / (queries x days with data x providers)."
      },
      "Citation": {
        "properties": {
          "source": {
            "type": "string",
            "title": "Source",
            "description": "Domain (level=domain) or URL (level=url)"
          },
          "level": {
            "type": "string",
            "title": "Level"
          },
          "domain_ranking": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Domain Ranking"
          },
          "references_last_90_days": {
            "type": "integer",
            "title": "References Last 90 Days",
            "default": 0
          },
          "share_last_90_days": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Share Last 90 Days"
          },
          "mentions_own_brand_last_90_days": {
            "type": "boolean",
            "title": "Mentions Own Brand Last 90 Days",
            "default": false
          },
          "references_all_time": {
            "type": "integer",
            "title": "References All Time",
            "default": 0
          },
          "share_all_time": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Share All Time"
          },
          "first_cited_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "First Cited At"
          },
          "last_cited_at": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Last Cited At"
          },
          "is_own_domain": {
            "type": "boolean",
            "title": "Is Own Domain",
            "default": false
          },
          "competitor_brand_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Competitor Brand Id"
          },
          "competitor_name": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Competitor Name"
          }
        },
        "type": "object",
        "required": [
          "source",
          "level"
        ],
        "title": "Citation",
        "description": "A domain or URL that AI responses cited, with reference counts."
      },
      "CompetitorVisibility": {
        "properties": {
          "brand_id": {
            "type": "string",
            "title": "Brand Id"
          },
          "brand_name": {
            "type": "string",
            "title": "Brand Name"
          },
          "is_own_brand": {
            "type": "boolean",
            "title": "Is Own Brand"
          },
          "is_verified": {
            "type": "boolean",
            "title": "Is Verified"
          },
          "is_pinned": {
            "type": "boolean",
            "title": "Is Pinned"
          },
          "visibility_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Visibility Rate"
          },
          "previous_visibility_rate": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Visibility Rate"
          },
          "visibility_rate_by_provider": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Visibility Rate By Provider"
          },
          "previous_visibility_rate_by_provider": {
            "additionalProperties": {
              "anyOf": [
                {
                  "type": "number"
                },
                {
                  "type": "null"
                }
              ]
            },
            "type": "object",
            "title": "Previous Visibility Rate By Provider"
          },
          "merged_brand_names": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Merged Brand Names"
          }
        },
        "type": "object",
        "required": [
          "brand_id",
          "brand_name",
          "is_own_brand",
          "is_verified",
          "is_pinned"
        ],
        "title": "CompetitorVisibility",
        "description": "A brand's visibility rate on the team's tracked queries.\n\nSame calculation as the dashboard Competitors page (get_brand_model_percentages)."
      },
      "ErrorBody": {
        "properties": {
          "code": {
            "type": "string",
            "enum": [
              "invalid_request",
              "invalid_cursor",
              "unauthenticated",
              "forbidden",
              "not_found",
              "conflict",
              "rate_limited",
              "internal_error",
              "unavailable"
            ],
            "title": "Code"
          },
          "message": {
            "type": "string",
            "title": "Message"
          },
          "request_id": {
            "type": "string",
            "title": "Request Id"
          }
        },
        "type": "object",
        "required": [
          "code",
          "message",
          "request_id"
        ],
        "title": "ErrorBody"
      },
      "ErrorResponse": {
        "properties": {
          "error": {
            "$ref": "#/components/schemas/ErrorBody"
          }
        },
        "type": "object",
        "required": [
          "error"
        ],
        "title": "ErrorResponse",
        "description": "Documented on every public route so the OpenAPI schema carries it."
      },
      "Item_Team_": {
        "properties": {
          "data": {
            "$ref": "#/components/schemas/Team"
          }
        },
        "type": "object",
        "required": [
          "data"
        ],
        "title": "Item[Team]"
      },
      "Page_BrandVisibility_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/BrandVisibility"
            },
            "type": "array",
            "title": "Data"
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "Page[BrandVisibility]"
      },
      "Page_Citation_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Citation"
            },
            "type": "array",
            "title": "Data"
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "Page[Citation]"
      },
      "Page_CompetitorVisibility_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/CompetitorVisibility"
            },
            "type": "array",
            "title": "Data"
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "Page[CompetitorVisibility]"
      },
      "Page_Ranking_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Ranking"
            },
            "type": "array",
            "title": "Data"
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "Page[Ranking]"
      },
      "Page_Team_": {
        "properties": {
          "data": {
            "items": {
              "$ref": "#/components/schemas/Team"
            },
            "type": "array",
            "title": "Data"
          },
          "pagination": {
            "$ref": "#/components/schemas/Pagination"
          }
        },
        "type": "object",
        "required": [
          "data",
          "pagination"
        ],
        "title": "Page[Team]"
      },
      "Pagination": {
        "properties": {
          "limit": {
            "type": "integer",
            "title": "Limit"
          },
          "next_cursor": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Next Cursor"
          },
          "has_more": {
            "type": "boolean",
            "title": "Has More"
          },
          "total": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Total"
          }
        },
        "type": "object",
        "required": [
          "limit",
          "next_cursor",
          "has_more"
        ],
        "title": "Pagination"
      },
      "Ranking": {
        "properties": {
          "prompt": {
            "type": "string",
            "title": "Prompt"
          },
          "model": {
            "type": "string",
            "title": "Model"
          },
          "brand_name": {
            "type": "string",
            "title": "Brand Name"
          },
          "brand_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Brand Id"
          },
          "query_id": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Query Id"
          },
          "current_rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Rank"
          },
          "current_sentiment": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Current Sentiment"
          },
          "previous_rank": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Rank"
          },
          "previous_sentiment": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Previous Sentiment"
          },
          "rank_change": {
            "anyOf": [
              {
                "type": "integer"
              },
              {
                "type": "null"
              }
            ],
            "title": "Rank Change"
          },
          "sentiment_change": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Sentiment Change"
          },
          "response_count": {
            "type": "integer",
            "title": "Response Count",
            "default": 0
          },
          "days_with_responses": {
            "type": "integer",
            "title": "Days With Responses",
            "default": 0
          },
          "percentage_days_with_responses": {
            "anyOf": [
              {
                "type": "number"
              },
              {
                "type": "null"
              }
            ],
            "title": "Percentage Days With Responses"
          },
          "latest_date": {
            "anyOf": [
              {
                "type": "string"
              },
              {
                "type": "null"
              }
            ],
            "title": "Latest Date"
          },
          "tags": {
            "items": {
              "type": "string"
            },
            "type": "array",
            "title": "Tags"
          }
        },
        "type": "object",
        "required": [
          "prompt",
          "model",
          "brand_name"
        ],
        "title": "Ranking",
        "description": "One query x brand x model snapshot: latest rank and sentiment vs the previous date.\n\n`current_*` are the latest values; `previous_*` are from the most recent\nearlier date; `*_change` are latest-vs-previous deltas.\n`percentage_days_with_responses` is the brand-visibility metric\n(% of days in the window the brand appeared)."
      },
      "Team": {
        "properties": {
          "team_id": {
            "type": "string",
            "title": "Team Id"
          },
          "organization_id": {
            "type": "string",
            "title": "Organization Id"
          },
          "name": {
            "type": "string",
            "title": "Name"
          }
        },
        "type": "object",
        "required": [
          "team_id",
          "organization_id",
          "name"
        ],
        "title": "Team"
      }
    }
  }
}
