{
  "openapi": "3.1.0",
  "info": {
    "title": "Auli API",
    "version": "1.2.0",
    "description": "Auli's REST API: web analytics (Google Analytics 4), Google Search (Search Console) and outreach for your workspaces. Authenticate with a personal access key from Team → API & MCP, sent as `Authorization: Bearer auli_pat_…`. Every endpoint is also an MCP tool at /api/mcp."
  },
  "servers": [
    {
      "url": "https://auli.ai/api/v1"
    }
  ],
  "security": [
    {
      "bearer": []
    }
  ],
  "externalDocs": {
    "url": "https://auli.ai/docs/api",
    "description": "API & MCP documentation"
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "A personal access key (auli_pat_…) or an OAuth access token."
      }
    },
    "responses": {
      "Error": {
        "description": "An error.",
        "content": {
          "application/json": {
            "schema": {
              "type": "object",
              "properties": {
                "error": {
                  "type": "object",
                  "properties": {
                    "type": {
                      "type": "string"
                    },
                    "message": {
                      "type": "string"
                    },
                    "docs": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "type",
                    "message"
                  ]
                }
              }
            }
          }
        }
      }
    }
  },
  "paths": {
    "/me": {
      "get": {
        "operationId": "getMe",
        "summary": "Who the key or token acts as, and what it may do.",
        "tags": [
          "Account"
        ],
        "responses": {
          "200": {
            "description": "The caller."
          },
          "401": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools": {
      "get": {
        "operationId": "listTools",
        "summary": "Every tool this key can call, with its input schema.",
        "tags": [
          "Tools"
        ],
        "responses": {
          "200": {
            "description": "The tool catalogue."
          },
          "401": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces": {
      "get": {
        "operationId": "list_workspaces",
        "summary": "Workspaces you can reach, with your role in each.",
        "description": "Workspaces you can reach, with your role in each. Call this first: every other tool takes a workspace_id. An access key limited to chosen workspaces lists only those.\n\nSame as POST /tools/list_workspaces.",
        "tags": [
          "Workspaces"
        ],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics": {
      "get": {
        "operationId": "get_analytics_status",
        "summary": "Which Google sources are connected and what they unlock.",
        "description": "Which Google sources the workspace has connected (Google Analytics 4 property, Search Console site) and which analytics tools they unlock. Call this first when an analytics tool says a source is not connected.\n\nSame as POST /tools/get_analytics_status.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/distribution": {
      "get": {
        "operationId": "get_distribution_report",
        "summary": "Traffic and search demand in one call, with the previous period.",
        "description": "How many people reach the workspace's product in a date range: web traffic from its Google Analytics property (users, sessions, channels, key events such as sign-ups) and search demand from its Search Console site (clicks, impressions, position), each with the previous period. `sources` says which of the two are connected; a source that is not connected returns null.\n\nSame as POST /tools/get_distribution_report.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: 29 days before end_date."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD, inclusive. Default: today."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/summary": {
      "get": {
        "operationId": "get_analytics_summary",
        "summary": "GA4 and Search Console in one call: overview, daily series, top lists, opportunities.",
        "description": "Everything a traffic dashboard needs in one call: the GA4 overview with the previous period and a daily series (zero-filled, one row per day), top channels (with change), landing pages, referrers, countries, devices and key events; and Search Console totals, daily series, top queries and pages (with change) and opportunities. A source that is not connected comes back with its status instead of failing the call. Optional: include_health adds the tracking health checks.\n\nSame as POST /tools/get_analytics_summary.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "yesterday",
                "7d",
                "14d",
                "28d",
                "30d",
                "90d",
                "180d",
                "365d",
                "this_month",
                "last_month",
                "this_quarter",
                "last_quarter",
                "this_year",
                "last_year"
              ]
            },
            "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: from period."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD, inclusive. Default: today."
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Also return the previous period of the same length and the change. Default true."
          },
          {
            "name": "hostname",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Count only these hostnames in Google Analytics. Comma-separate several; \"*.example.com\" matches example.com and its subdomains; \"auto\" uses the site from the GA data stream (or Search Console). Default: every hostname."
          },
          {
            "name": "exclude_query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Leave Search Console queries containing these out (e.g. your brand). Comma-separate several."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Rows per list, 1–100. Default 10."
          },
          {
            "name": "include_health",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Also run get_tracking_health. Default false."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/health": {
      "get": {
        "operationId": "get_tracking_health",
        "summary": "Tracking health checks: stray hostnames, key events, app traffic, (not set), setup.",
        "description": "Whether the workspace's analytics can be trusted, as a list of checks (ok, warn, bad, skipped) with what to fix: Google Analytics and Search Console connected and pointing at the same site; GA receiving data; traffic on hostnames other than the real site (localhost, 127.0.0.1, *.vercel.app and *.framer.app previews, app subdomains) with each one's share; no key events set up; automatic events (page_view, session_start, first_visit, user_engagement, scroll) marked as key events; app and sign-in traffic mixed into the site (referrals from accounts.google.com or login hosts, app paths as landing pages); and a high share of \"(not set)\" landing pages. Returns suggested_filters.hostname to pass to the other reports.\n\nSame as POST /tools/get_tracking_health.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "yesterday",
                "7d",
                "14d",
                "28d",
                "30d",
                "90d",
                "180d",
                "365d",
                "this_month",
                "last_month",
                "this_quarter",
                "last_quarter",
                "this_year",
                "last_year"
              ]
            },
            "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: from period."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD, inclusive. Default: today."
          },
          {
            "name": "hostname",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "The real site's hostnames, when the GA data stream does not say (comma-separate; *.example.com allowed). Default: from the data stream, then Search Console."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/analytics/portfolio": {
      "get": {
        "operationId": "get_analytics_portfolio",
        "summary": "Headline GA4 and Search Console numbers for every workspace the key reaches.",
        "description": "Headline GA4 and Search Console numbers for every workspace you can reach (an access key limited to chosen workspaces covers only those), each with the previous period and a zero-filled daily series. Use hostname=auto to count only each workspace's own site. Workspaces without analytics say so instead of failing the call.\n\nSame as POST /tools/get_analytics_portfolio.",
        "tags": [
          "Analytics"
        ],
        "parameters": [
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "yesterday",
                "7d",
                "14d",
                "28d",
                "30d",
                "90d",
                "180d",
                "365d",
                "this_month",
                "last_month",
                "this_quarter",
                "last_quarter",
                "this_year",
                "last_year"
              ]
            },
            "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: from period."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD, inclusive. Default: today."
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Also return the previous period of the same length and the change. Default true."
          },
          {
            "name": "hostname",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "auto"
              ]
            },
            "description": "auto: count only each workspace's own site in GA (from its data stream or Search Console). Default: every hostname."
          },
          {
            "name": "include_health",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Also return each workspace's tracking health status and failing checks. Default false."
          },
          {
            "name": "workspace_ids",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only these workspaces (comma-separated ids). Default: all you can reach."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/web/realtime": {
      "get": {
        "operationId": "get_realtime_visitors",
        "summary": "Who is on the site right now.",
        "description": "Who is on the site right now: active users in the last 30 and 5 minutes, a minute-by-minute series, and breakdowns by country, page, device and event (also city, platform, audience).\n\nSame as POST /tools/get_realtime_visitors.",
        "tags": [
          "Web analytics"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "breakdowns",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Default: countries, pages, devices, events. Comma-separated."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Rows per breakdown, 1–100. Default 10."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/web/fields": {
      "get": {
        "operationId": "list_ga4_fields",
        "summary": "Every GA4 dimension and metric, including custom ones.",
        "description": "Every dimension and metric the workspace's GA4 property supports, including its custom dimensions and metrics, with descriptions. Use the names in run_ga4_report.\n\nSame as POST /tools/list_ga4_fields.",
        "tags": [
          "Web analytics"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "kind",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "dimensions",
                "metrics"
              ]
            },
            "description": "Default all."
          },
          {
            "name": "search",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only fields whose name or description contains this, e.g. \"revenue\"."
          },
          {
            "name": "custom_only",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Only the property's custom definitions. Default false."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/web/query": {
      "post": {
        "operationId": "run_ga4_report",
        "summary": "Any GA4 report: your dimensions, metrics, filters and order.",
        "description": "Any Google Analytics 4 report: up to 9 dimensions and 10 metrics by their GA4 API names (activeUsers, sessionSource, customEvent:plan…), with dimension and metric filters, ordering and paging. The same power as GA4 Explorations. list_ga4_fields lists every field, including the property's custom ones.\n\nSame as POST /tools/run_ga4_report.",
        "tags": [
          "Web analytics"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dimensions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "GA4 dimension names, e.g. [\"date\", \"sessionDefaultChannelGroup\"]. Optional."
                  },
                  "metrics": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "GA4 metric names, e.g. [\"activeUsers\", \"keyEvents\"]. At least one."
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "today",
                      "yesterday",
                      "7d",
                      "14d",
                      "28d",
                      "30d",
                      "90d",
                      "180d",
                      "365d",
                      "this_month",
                      "last_month",
                      "this_quarter",
                      "last_quarter",
                      "this_year",
                      "last_year"
                    ],
                    "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: from period."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  },
                  "compare": {
                    "type": "boolean",
                    "description": "Also return the previous period and the change. Default false."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Dimension filters, all must match. Each: {field, match, value | values, not?, case_sensitive?}. match: exact, contains, begins_with, ends_with, regex, partial_regex, in_list. Example: [{\"field\":\"country\",\"match\":\"in_list\",\"values\":[\"Germany\",\"France\"]}].",
                    "items": {
                      "type": "object"
                    }
                  },
                  "metric_filters": {
                    "type": "array",
                    "description": "Metric filters applied after aggregation. Each: {field, match, value | values}. match: eq, gt, gte, lt, lte, between. Example: [{\"field\":\"sessions\",\"match\":\"gte\",\"value\":100}].",
                    "items": {
                      "type": "object"
                    }
                  },
                  "order_by": {
                    "type": "array",
                    "description": "Sort order. Each: {field, desc?}. As a string: \"-sessions,date\". Default: first metric, highest first.",
                    "items": {
                      "type": "object"
                    }
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Rows, 1–10000. Default 100."
                  },
                  "offset": {
                    "type": "integer",
                    "description": "Rows to skip, for paging. Default 0."
                  },
                  "keep_empty_rows": {
                    "type": "boolean",
                    "description": "Include rows whose metrics are all zero. Default false."
                  }
                },
                "required": [
                  "metrics"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/web": {
      "get": {
        "operationId": "get_web_analytics_overview",
        "summary": "The overview report: headline numbers and a daily series.",
        "description": "A ready-made Google Analytics 4 report, compared with the previous period. Reports: overview (Headline numbers (users, sessions, engagement, page views, key events, revenue) with a daily series); daily (One row per day); weekly (One row per ISO week); monthly (One row per month); hourly (One row per hour (property time zone)); channels (Sessions by default channel group (Organic Search, Direct, Referral, Paid Social…)); sources (Sessions by source and medium (google / organic, linkedin.com / referral…)); referrals (Sites that send visitors through links); campaigns (Sessions by UTM campaign, with source and medium); acquisition (Where new users first came from (first-touch channel and source)); landing_pages (The first page of each session, with engagement and key events); pages (Pages and screens by views, with users and engagement time); events (Every event by count and users); key_events (Conversions (GA4 key events) such as sign-ups and purchases); countries (Users by country); regions (Users by region and country); cities (Users by city and country); languages (Users by browser language); devices (Desktop, mobile and tablet); browsers (Users by browser); operating_systems (Users by operating system); new_vs_returning (New and returning users); age (Users by age bracket. Needs Google signals; small numbers are withheld by Google); gender (Users by gender. Needs Google signals; small numbers are withheld by Google); site_search (What visitors search for on the site (needs enhanced measurement)); outbound_clicks (Links to other sites that visitors click (needs enhanced measurement)); file_downloads (Files visitors download (needs enhanced measurement)); ecommerce (Purchases, revenue and the shopping funnel); products (Items viewed, added to cart and purchased, with revenue). Every report takes the same simple filters (country, device, channel, source, medium, campaign, page, landing_page, event, hostname). For anything else use run_ga4_report.\n\nSame as POST /tools/get_web_analytics with report=overview.",
        "tags": [
          "Web analytics"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "yesterday",
                "7d",
                "14d",
                "28d",
                "30d",
                "90d",
                "180d",
                "365d",
                "this_month",
                "last_month",
                "this_quarter",
                "last_quarter",
                "this_year",
                "last_year"
              ]
            },
            "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: from period."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD, inclusive. Default: today."
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Also return the previous period of the same length and the change. Default true."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Rows to return, 1–1000. Default 25."
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Country name as GA4 shows it, e.g. \"United States\". Comma-separate several."
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "desktop, mobile or tablet. Comma-separate several."
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "e.g. \"Organic Search\", \"Direct\". Comma-separate several."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "e.g. \"google\", \"linkedin.com\"."
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "e.g. \"organic\", \"referral\", \"cpc\"."
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "UTM campaign name."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page path contains this, e.g. \"/pricing\"."
          },
          {
            "name": "landing_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Landing page contains this."
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Event name, e.g. \"sign_up\"."
          },
          {
            "name": "hostname",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only these hostnames, for properties that also record previews, localhost or an app. Comma-separate several; \"*.example.com\" matches example.com and every subdomain. e.g. \"www.example.com,example.com\"."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/web/{report}": {
      "get": {
        "operationId": "get_web_analytics_by_report",
        "summary": "A ready-made GA4 report: channels, sources, pages, countries, devices, events and more.",
        "description": "A ready-made Google Analytics 4 report, compared with the previous period. Reports: overview (Headline numbers (users, sessions, engagement, page views, key events, revenue) with a daily series); daily (One row per day); weekly (One row per ISO week); monthly (One row per month); hourly (One row per hour (property time zone)); channels (Sessions by default channel group (Organic Search, Direct, Referral, Paid Social…)); sources (Sessions by source and medium (google / organic, linkedin.com / referral…)); referrals (Sites that send visitors through links); campaigns (Sessions by UTM campaign, with source and medium); acquisition (Where new users first came from (first-touch channel and source)); landing_pages (The first page of each session, with engagement and key events); pages (Pages and screens by views, with users and engagement time); events (Every event by count and users); key_events (Conversions (GA4 key events) such as sign-ups and purchases); countries (Users by country); regions (Users by region and country); cities (Users by city and country); languages (Users by browser language); devices (Desktop, mobile and tablet); browsers (Users by browser); operating_systems (Users by operating system); new_vs_returning (New and returning users); age (Users by age bracket. Needs Google signals; small numbers are withheld by Google); gender (Users by gender. Needs Google signals; small numbers are withheld by Google); site_search (What visitors search for on the site (needs enhanced measurement)); outbound_clicks (Links to other sites that visitors click (needs enhanced measurement)); file_downloads (Files visitors download (needs enhanced measurement)); ecommerce (Purchases, revenue and the shopping funnel); products (Items viewed, added to cart and purchased, with revenue). Every report takes the same simple filters (country, device, channel, source, medium, campaign, page, landing_page, event, hostname). For anything else use run_ga4_report.\n\nSame as POST /tools/get_web_analytics.",
        "tags": [
          "Web analytics"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "report",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "overview",
                "daily",
                "weekly",
                "monthly",
                "hourly",
                "channels",
                "sources",
                "referrals",
                "campaigns",
                "acquisition",
                "landing_pages",
                "pages",
                "events",
                "key_events",
                "countries",
                "regions",
                "cities",
                "languages",
                "devices",
                "browsers",
                "operating_systems",
                "new_vs_returning",
                "age",
                "gender",
                "site_search",
                "outbound_clicks",
                "file_downloads",
                "ecommerce",
                "products"
              ]
            },
            "description": "Which report. Default overview."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "yesterday",
                "7d",
                "14d",
                "28d",
                "30d",
                "90d",
                "180d",
                "365d",
                "this_month",
                "last_month",
                "this_quarter",
                "last_quarter",
                "this_year",
                "last_year"
              ]
            },
            "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: from period."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD, inclusive. Default: today."
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Also return the previous period of the same length and the change. Default true."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Rows to return, 1–1000. Default 25."
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Country name as GA4 shows it, e.g. \"United States\". Comma-separate several."
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "desktop, mobile or tablet. Comma-separate several."
          },
          {
            "name": "channel",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "e.g. \"Organic Search\", \"Direct\". Comma-separate several."
          },
          {
            "name": "source",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "e.g. \"google\", \"linkedin.com\"."
          },
          {
            "name": "medium",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "e.g. \"organic\", \"referral\", \"cpc\"."
          },
          {
            "name": "campaign",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "UTM campaign name."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page path contains this, e.g. \"/pricing\"."
          },
          {
            "name": "landing_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Landing page contains this."
          },
          {
            "name": "event",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Event name, e.g. \"sign_up\"."
          },
          {
            "name": "hostname",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only these hostnames, for properties that also record previews, localhost or an app. Comma-separate several; \"*.example.com\" matches example.com and every subdomain. e.g. \"www.example.com,example.com\"."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/search/opportunities": {
      "get": {
        "operationId": "get_search_opportunities",
        "summary": "Striking-distance queries, weak CTR, movers and cannibalisation.",
        "description": "Where search traffic can grow or is slipping, worked out from Search Console data: striking-distance queries (position 4–20) with the clicks a top-3 spot would add, high-ranking queries with a weak click-through rate (rewrite the title and description), the queries and pages losing or gaining the most clicks against the previous period, and queries where several of your pages compete (cannibalisation). Use exclude_query for brand terms.\n\nSame as POST /tools/get_search_opportunities.",
        "tags": [
          "Search"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "yesterday",
                "7d",
                "14d",
                "28d",
                "30d",
                "90d",
                "180d",
                "365d",
                "this_month",
                "last_month",
                "this_quarter",
                "last_quarter",
                "this_year",
                "last_year"
              ]
            },
            "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: from period."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD, inclusive. Default: today."
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Also return the previous period of the same length and the change. Default true."
          },
          {
            "name": "search_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "web",
                "image",
                "video",
                "news",
                "discover",
                "googleNews"
              ]
            },
            "description": "Default web."
          },
          {
            "name": "min_impressions",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Ignore queries with fewer impressions. Default scales with the period (20 for 28 days)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Rows per list, 1–100. Default 15."
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Query contains this text. Comma-separate several to match any."
          },
          {
            "name": "exact_query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Query is exactly this."
          },
          {
            "name": "exclude_query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Leave out queries containing this, e.g. your brand name. Comma-separate several."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page URL contains this, e.g. /blog/."
          },
          {
            "name": "exact_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page URL is exactly this."
          },
          {
            "name": "exclude_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Leave out pages whose URL contains this."
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Country as an ISO 3166-1 alpha-3 code, e.g. \"usa\", \"gbr\", \"tur\"."
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "DESKTOP, MOBILE or TABLET."
          },
          {
            "name": "search_appearance",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A search appearance type, e.g. \"VIDEO\" (see the search_appearance report)."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/search/inspect": {
      "get": {
        "operationId": "inspect_url",
        "summary": "Index status of one URL (?url=…).",
        "description": "Google's index status for one page of the site, as Search Console's URL Inspection shows it: whether it is indexed and why not, last crawl, robots.txt and fetch state, Google's chosen canonical against yours, sitemaps that list it, mobile usability and rich results.\n\nSame as POST /tools/inspect_url.",
        "tags": [
          "Search"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "url",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "The full page URL, on the workspace's Search Console site."
          },
          {
            "name": "language_code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "For translated issue messages, e.g. \"en-US\". Optional."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/search/sitemaps": {
      "get": {
        "operationId": "list_sitemaps",
        "summary": "Submitted sitemaps and their state.",
        "description": "The sitemaps submitted for the workspace's Search Console site, with when Google last read them, errors and warnings, and how many URLs each lists.\n\nSame as POST /tools/list_sitemaps.",
        "tags": [
          "Search"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/search/query": {
      "post": {
        "operationId": "run_search_console_query",
        "summary": "Any Search Analytics query: dimensions, regex filters, paging.",
        "description": "Any Search Console Search Analytics query: dimensions date, hour, query, page, country, device and searchAppearance in any combination, regex filters, every search type, aggregation by page or property, fresh or final data, and up to 25,000 rows per call with paging.\n\nSame as POST /tools/run_search_console_query.",
        "tags": [
          "Search"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "dimensions": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "date",
                        "hour",
                        "query",
                        "page",
                        "country",
                        "device",
                        "searchAppearance"
                      ]
                    },
                    "description": "Optional; none gives totals."
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "today",
                      "yesterday",
                      "7d",
                      "14d",
                      "28d",
                      "30d",
                      "90d",
                      "180d",
                      "365d",
                      "this_month",
                      "last_month",
                      "this_quarter",
                      "last_quarter",
                      "this_year",
                      "last_year"
                    ],
                    "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: from period."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  },
                  "compare": {
                    "type": "boolean",
                    "description": "Also return the previous period and the change per row. Default false."
                  },
                  "search_type": {
                    "type": "string",
                    "enum": [
                      "web",
                      "image",
                      "video",
                      "news",
                      "discover",
                      "googleNews"
                    ],
                    "description": "Default web."
                  },
                  "filters": {
                    "type": "array",
                    "description": "All must match. Each: {dimension, operator, expression}. operator: equals, notEquals, contains, notContains, includingRegex, excludingRegex. Example: [{\"dimension\":\"query\",\"operator\":\"includingRegex\",\"expression\":\"(?i)pricing|cost\"}].",
                    "items": {
                      "type": "object"
                    }
                  },
                  "aggregation_type": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "byPage",
                      "byProperty",
                      "byNewsShowcasePanel"
                    ],
                    "description": "Default auto."
                  },
                  "data_state": {
                    "type": "string",
                    "enum": [
                      "final",
                      "all",
                      "hourly_all"
                    ],
                    "description": "Default all. hourly_all is needed for the hour dimension."
                  },
                  "row_limit": {
                    "type": "integer",
                    "description": "1–25000. Default 1000."
                  },
                  "start_row": {
                    "type": "integer",
                    "description": "Rows to skip, for paging. Default 0."
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/search": {
      "get": {
        "operationId": "get_search_performance_overview",
        "summary": "The overview: clicks, impressions, CTR, position and a daily series.",
        "description": "Google Search performance from Search Console, compared with the previous period: clicks, impressions, CTR and average position. Reports: overview (Clicks, impressions, CTR and average position, with a daily series); queries (What people searched for when the site appeared); pages (Pages that appeared in search, by clicks); query_pages (Each query with the page that ranked for it); countries (Searchers by country (ISO 3166-1 alpha-3 codes)); devices (Desktop, mobile and tablet); search_appearance (Rich results, videos, AMP and other result types); daily (One row per day); hourly (One row per hour for roughly the last 10 days (Search Console's hourly data)). Filters: query, exact_query, exclude_query (e.g. your brand), page, exact_page, exclude_page, country, device, search_appearance. For anything else use run_search_console_query.\n\nSame as POST /tools/get_search_performance with report=overview.",
        "tags": [
          "Search"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "yesterday",
                "7d",
                "14d",
                "28d",
                "30d",
                "90d",
                "180d",
                "365d",
                "this_month",
                "last_month",
                "this_quarter",
                "last_quarter",
                "this_year",
                "last_year"
              ]
            },
            "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: from period."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD, inclusive. Default: today."
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Also return the previous period of the same length and the change. Default true."
          },
          {
            "name": "search_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "web",
                "image",
                "video",
                "news",
                "discover",
                "googleNews"
              ]
            },
            "description": "Default web."
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "clicks",
                "impressions",
                "ctr",
                "position"
              ]
            },
            "description": "Default clicks (position sorts best first)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Rows to return, 1–1000. Default 25."
          },
          {
            "name": "data_state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "final"
              ]
            },
            "description": "all includes the freshest, still-changing days (as the Search Console UI does). Default all."
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Query contains this text. Comma-separate several to match any."
          },
          {
            "name": "exact_query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Query is exactly this."
          },
          {
            "name": "exclude_query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Leave out queries containing this, e.g. your brand name. Comma-separate several."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page URL contains this, e.g. /blog/."
          },
          {
            "name": "exact_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page URL is exactly this."
          },
          {
            "name": "exclude_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Leave out pages whose URL contains this."
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Country as an ISO 3166-1 alpha-3 code, e.g. \"usa\", \"gbr\", \"tur\"."
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "DESKTOP, MOBILE or TABLET."
          },
          {
            "name": "search_appearance",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A search appearance type, e.g. \"VIDEO\" (see the search_appearance report)."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/analytics/search/{report}": {
      "get": {
        "operationId": "get_search_performance_by_report",
        "summary": "A ready-made search report: queries, pages, countries, devices and more.",
        "description": "Google Search performance from Search Console, compared with the previous period: clicks, impressions, CTR and average position. Reports: overview (Clicks, impressions, CTR and average position, with a daily series); queries (What people searched for when the site appeared); pages (Pages that appeared in search, by clicks); query_pages (Each query with the page that ranked for it); countries (Searchers by country (ISO 3166-1 alpha-3 codes)); devices (Desktop, mobile and tablet); search_appearance (Rich results, videos, AMP and other result types); daily (One row per day); hourly (One row per hour for roughly the last 10 days (Search Console's hourly data)). Filters: query, exact_query, exclude_query (e.g. your brand), page, exact_page, exclude_page, country, device, search_appearance. For anything else use run_search_console_query.\n\nSame as POST /tools/get_search_performance.",
        "tags": [
          "Search"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "report",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "overview",
                "queries",
                "pages",
                "query_pages",
                "countries",
                "devices",
                "search_appearance",
                "daily",
                "hourly"
              ]
            },
            "description": "Which report. Default overview."
          },
          {
            "name": "period",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "today",
                "yesterday",
                "7d",
                "14d",
                "28d",
                "30d",
                "90d",
                "180d",
                "365d",
                "this_month",
                "last_month",
                "this_quarter",
                "last_quarter",
                "this_year",
                "last_year"
              ]
            },
            "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: from period."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD, inclusive. Default: today."
          },
          {
            "name": "compare",
            "in": "query",
            "required": false,
            "schema": {
              "type": "boolean"
            },
            "description": "Also return the previous period of the same length and the change. Default true."
          },
          {
            "name": "search_type",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "web",
                "image",
                "video",
                "news",
                "discover",
                "googleNews"
              ]
            },
            "description": "Default web."
          },
          {
            "name": "sort_by",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "clicks",
                "impressions",
                "ctr",
                "position"
              ]
            },
            "description": "Default clicks (position sorts best first)."
          },
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer"
            },
            "description": "Rows to return, 1–1000. Default 25."
          },
          {
            "name": "data_state",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "all",
                "final"
              ]
            },
            "description": "all includes the freshest, still-changing days (as the Search Console UI does). Default all."
          },
          {
            "name": "query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Query contains this text. Comma-separate several to match any."
          },
          {
            "name": "exact_query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Query is exactly this."
          },
          {
            "name": "exclude_query",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Leave out queries containing this, e.g. your brand name. Comma-separate several."
          },
          {
            "name": "page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page URL contains this, e.g. /blog/."
          },
          {
            "name": "exact_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Page URL is exactly this."
          },
          {
            "name": "exclude_page",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Leave out pages whose URL contains this."
          },
          {
            "name": "country",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Country as an ISO 3166-1 alpha-3 code, e.g. \"usa\", \"gbr\", \"tur\"."
          },
          {
            "name": "device",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "DESKTOP, MOBILE or TABLET."
          },
          {
            "name": "search_appearance",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "A search appearance type, e.g. \"VIDEO\" (see the search_appearance report)."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/gtm-report": {
      "get": {
        "operationId": "get_gtm_report",
        "summary": "Outreach results: funnel, campaigns, senders, inbox, pipeline and CRM sync.",
        "description": "Outreach results for a date range: funnel (invited, accepted, replied, meetings), campaigns, senders, inbox, pipeline and CRM sync.\n\nSame as POST /tools/get_gtm_report.",
        "tags": [
          "Outreach"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "start_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD. Default: 30 days ago."
          },
          {
            "name": "end_date",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "YYYY-MM-DD, inclusive. Default: today."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/campaigns": {
      "get": {
        "operationId": "list_campaigns",
        "summary": "Campaigns with their status and how many contacts are in each state.",
        "description": "Campaigns in a workspace with status and how many contacts are in each state.\n\nSame as POST /tools/list_campaigns.",
        "tags": [
          "Outreach"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/workspaces/{workspace_id}/campaigns/{campaign_id}": {
      "get": {
        "operationId": "get_campaign",
        "summary": "One campaign's sequence and progress.",
        "description": "One campaign's sequence (steps and message texts) and progress: contacts per step and status, sends, replies and accepted invitations.\n\nSame as POST /tools/get_campaign.",
        "tags": [
          "Outreach"
        ],
        "parameters": [
          {
            "name": "workspace_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Workspace id from list_workspaces."
          },
          {
            "name": "campaign_id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/list_workspaces": {
      "post": {
        "operationId": "call_list_workspaces",
        "summary": "List workspaces",
        "description": "Workspaces you can reach, with your role in each. Call this first: every other tool takes a workspace_id. An access key limited to chosen workspaces lists only those.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {}
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_gtm_report": {
      "post": {
        "operationId": "call_get_gtm_report",
        "summary": "GTM report",
        "description": "Outreach results for a date range: funnel (invited, accepted, replied, meetings), campaigns, senders, inbox, pipeline and CRM sync.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: 30 days ago."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_distribution_report": {
      "post": {
        "operationId": "call_get_distribution_report",
        "summary": "Distribution report",
        "description": "How many people reach the workspace's product in a date range: web traffic from its Google Analytics property (users, sessions, channels, key events such as sign-ups) and search demand from its Search Console site (clicks, impressions, position), each with the previous period. `sources` says which of the two are connected; a source that is not connected returns null.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: 29 days before end_date."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_analytics_status": {
      "post": {
        "operationId": "call_get_analytics_status",
        "summary": "Analytics connections",
        "description": "Which Google sources the workspace has connected (Google Analytics 4 property, Search Console site) and which analytics tools they unlock. Call this first when an analytics tool says a source is not connected.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_web_analytics": {
      "post": {
        "operationId": "call_get_web_analytics",
        "summary": "Web analytics report",
        "description": "A ready-made Google Analytics 4 report, compared with the previous period. Reports: overview (Headline numbers (users, sessions, engagement, page views, key events, revenue) with a daily series); daily (One row per day); weekly (One row per ISO week); monthly (One row per month); hourly (One row per hour (property time zone)); channels (Sessions by default channel group (Organic Search, Direct, Referral, Paid Social…)); sources (Sessions by source and medium (google / organic, linkedin.com / referral…)); referrals (Sites that send visitors through links); campaigns (Sessions by UTM campaign, with source and medium); acquisition (Where new users first came from (first-touch channel and source)); landing_pages (The first page of each session, with engagement and key events); pages (Pages and screens by views, with users and engagement time); events (Every event by count and users); key_events (Conversions (GA4 key events) such as sign-ups and purchases); countries (Users by country); regions (Users by region and country); cities (Users by city and country); languages (Users by browser language); devices (Desktop, mobile and tablet); browsers (Users by browser); operating_systems (Users by operating system); new_vs_returning (New and returning users); age (Users by age bracket. Needs Google signals; small numbers are withheld by Google); gender (Users by gender. Needs Google signals; small numbers are withheld by Google); site_search (What visitors search for on the site (needs enhanced measurement)); outbound_clicks (Links to other sites that visitors click (needs enhanced measurement)); file_downloads (Files visitors download (needs enhanced measurement)); ecommerce (Purchases, revenue and the shopping funnel); products (Items viewed, added to cart and purchased, with revenue). Every report takes the same simple filters (country, device, channel, source, medium, campaign, page, landing_page, event, hostname). For anything else use run_ga4_report.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "report": {
                    "type": "string",
                    "enum": [
                      "overview",
                      "daily",
                      "weekly",
                      "monthly",
                      "hourly",
                      "channels",
                      "sources",
                      "referrals",
                      "campaigns",
                      "acquisition",
                      "landing_pages",
                      "pages",
                      "events",
                      "key_events",
                      "countries",
                      "regions",
                      "cities",
                      "languages",
                      "devices",
                      "browsers",
                      "operating_systems",
                      "new_vs_returning",
                      "age",
                      "gender",
                      "site_search",
                      "outbound_clicks",
                      "file_downloads",
                      "ecommerce",
                      "products"
                    ],
                    "description": "Which report. Default overview."
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "today",
                      "yesterday",
                      "7d",
                      "14d",
                      "28d",
                      "30d",
                      "90d",
                      "180d",
                      "365d",
                      "this_month",
                      "last_month",
                      "this_quarter",
                      "last_quarter",
                      "this_year",
                      "last_year"
                    ],
                    "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: from period."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  },
                  "compare": {
                    "type": "boolean",
                    "description": "Also return the previous period of the same length and the change. Default true."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Rows to return, 1–1000. Default 25."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country name as GA4 shows it, e.g. \"United States\". Comma-separate several."
                  },
                  "device": {
                    "type": "string",
                    "description": "desktop, mobile or tablet. Comma-separate several."
                  },
                  "channel": {
                    "type": "string",
                    "description": "e.g. \"Organic Search\", \"Direct\". Comma-separate several."
                  },
                  "source": {
                    "type": "string",
                    "description": "e.g. \"google\", \"linkedin.com\"."
                  },
                  "medium": {
                    "type": "string",
                    "description": "e.g. \"organic\", \"referral\", \"cpc\"."
                  },
                  "campaign": {
                    "type": "string",
                    "description": "UTM campaign name."
                  },
                  "page": {
                    "type": "string",
                    "description": "Page path contains this, e.g. \"/pricing\"."
                  },
                  "landing_page": {
                    "type": "string",
                    "description": "Landing page contains this."
                  },
                  "event": {
                    "type": "string",
                    "description": "Event name, e.g. \"sign_up\"."
                  },
                  "hostname": {
                    "type": "string",
                    "description": "Only these hostnames, for properties that also record previews, localhost or an app. Comma-separate several; \"*.example.com\" matches example.com and every subdomain. e.g. \"www.example.com,example.com\"."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/run_ga4_report": {
      "post": {
        "operationId": "call_run_ga4_report",
        "summary": "Custom GA4 report",
        "description": "Any Google Analytics 4 report: up to 9 dimensions and 10 metrics by their GA4 API names (activeUsers, sessionSource, customEvent:plan…), with dimension and metric filters, ordering and paging. The same power as GA4 Explorations. list_ga4_fields lists every field, including the property's custom ones.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "dimensions": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "GA4 dimension names, e.g. [\"date\", \"sessionDefaultChannelGroup\"]. Optional."
                  },
                  "metrics": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "description": "GA4 metric names, e.g. [\"activeUsers\", \"keyEvents\"]. At least one."
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "today",
                      "yesterday",
                      "7d",
                      "14d",
                      "28d",
                      "30d",
                      "90d",
                      "180d",
                      "365d",
                      "this_month",
                      "last_month",
                      "this_quarter",
                      "last_quarter",
                      "this_year",
                      "last_year"
                    ],
                    "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: from period."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  },
                  "compare": {
                    "type": "boolean",
                    "description": "Also return the previous period and the change. Default false."
                  },
                  "filters": {
                    "type": "array",
                    "description": "Dimension filters, all must match. Each: {field, match, value | values, not?, case_sensitive?}. match: exact, contains, begins_with, ends_with, regex, partial_regex, in_list. Example: [{\"field\":\"country\",\"match\":\"in_list\",\"values\":[\"Germany\",\"France\"]}].",
                    "items": {
                      "type": "object"
                    }
                  },
                  "metric_filters": {
                    "type": "array",
                    "description": "Metric filters applied after aggregation. Each: {field, match, value | values}. match: eq, gt, gte, lt, lte, between. Example: [{\"field\":\"sessions\",\"match\":\"gte\",\"value\":100}].",
                    "items": {
                      "type": "object"
                    }
                  },
                  "order_by": {
                    "type": "array",
                    "description": "Sort order. Each: {field, desc?}. As a string: \"-sessions,date\". Default: first metric, highest first.",
                    "items": {
                      "type": "object"
                    }
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Rows, 1–10000. Default 100."
                  },
                  "offset": {
                    "type": "integer",
                    "description": "Rows to skip, for paging. Default 0."
                  },
                  "keep_empty_rows": {
                    "type": "boolean",
                    "description": "Include rows whose metrics are all zero. Default false."
                  }
                },
                "required": [
                  "workspace_id",
                  "metrics"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_realtime_visitors": {
      "post": {
        "operationId": "call_get_realtime_visitors",
        "summary": "Realtime visitors",
        "description": "Who is on the site right now: active users in the last 30 and 5 minutes, a minute-by-minute series, and breakdowns by country, page, device and event (also city, platform, audience).",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "breakdowns": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "countries",
                        "cities",
                        "pages",
                        "devices",
                        "platforms",
                        "events",
                        "audiences"
                      ]
                    },
                    "description": "Default: countries, pages, devices, events."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Rows per breakdown, 1–100. Default 10."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/list_ga4_fields": {
      "post": {
        "operationId": "call_list_ga4_fields",
        "summary": "GA4 fields",
        "description": "Every dimension and metric the workspace's GA4 property supports, including its custom dimensions and metrics, with descriptions. Use the names in run_ga4_report.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "kind": {
                    "type": "string",
                    "enum": [
                      "all",
                      "dimensions",
                      "metrics"
                    ],
                    "description": "Default all."
                  },
                  "search": {
                    "type": "string",
                    "description": "Only fields whose name or description contains this, e.g. \"revenue\"."
                  },
                  "custom_only": {
                    "type": "boolean",
                    "description": "Only the property's custom definitions. Default false."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_search_performance": {
      "post": {
        "operationId": "call_get_search_performance",
        "summary": "Search performance",
        "description": "Google Search performance from Search Console, compared with the previous period: clicks, impressions, CTR and average position. Reports: overview (Clicks, impressions, CTR and average position, with a daily series); queries (What people searched for when the site appeared); pages (Pages that appeared in search, by clicks); query_pages (Each query with the page that ranked for it); countries (Searchers by country (ISO 3166-1 alpha-3 codes)); devices (Desktop, mobile and tablet); search_appearance (Rich results, videos, AMP and other result types); daily (One row per day); hourly (One row per hour for roughly the last 10 days (Search Console's hourly data)). Filters: query, exact_query, exclude_query (e.g. your brand), page, exact_page, exclude_page, country, device, search_appearance. For anything else use run_search_console_query.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "report": {
                    "type": "string",
                    "enum": [
                      "overview",
                      "queries",
                      "pages",
                      "query_pages",
                      "countries",
                      "devices",
                      "search_appearance",
                      "daily",
                      "hourly"
                    ],
                    "description": "Which report. Default overview."
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "today",
                      "yesterday",
                      "7d",
                      "14d",
                      "28d",
                      "30d",
                      "90d",
                      "180d",
                      "365d",
                      "this_month",
                      "last_month",
                      "this_quarter",
                      "last_quarter",
                      "this_year",
                      "last_year"
                    ],
                    "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: from period."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  },
                  "compare": {
                    "type": "boolean",
                    "description": "Also return the previous period of the same length and the change. Default true."
                  },
                  "search_type": {
                    "type": "string",
                    "enum": [
                      "web",
                      "image",
                      "video",
                      "news",
                      "discover",
                      "googleNews"
                    ],
                    "description": "Default web."
                  },
                  "sort_by": {
                    "type": "string",
                    "enum": [
                      "clicks",
                      "impressions",
                      "ctr",
                      "position"
                    ],
                    "description": "Default clicks (position sorts best first)."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Rows to return, 1–1000. Default 25."
                  },
                  "data_state": {
                    "type": "string",
                    "enum": [
                      "all",
                      "final"
                    ],
                    "description": "all includes the freshest, still-changing days (as the Search Console UI does). Default all."
                  },
                  "query": {
                    "type": "string",
                    "description": "Query contains this text. Comma-separate several to match any."
                  },
                  "exact_query": {
                    "type": "string",
                    "description": "Query is exactly this."
                  },
                  "exclude_query": {
                    "type": "string",
                    "description": "Leave out queries containing this, e.g. your brand name. Comma-separate several."
                  },
                  "page": {
                    "type": "string",
                    "description": "Page URL contains this, e.g. /blog/."
                  },
                  "exact_page": {
                    "type": "string",
                    "description": "Page URL is exactly this."
                  },
                  "exclude_page": {
                    "type": "string",
                    "description": "Leave out pages whose URL contains this."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country as an ISO 3166-1 alpha-3 code, e.g. \"usa\", \"gbr\", \"tur\"."
                  },
                  "device": {
                    "type": "string",
                    "description": "DESKTOP, MOBILE or TABLET."
                  },
                  "search_appearance": {
                    "type": "string",
                    "description": "A search appearance type, e.g. \"VIDEO\" (see the search_appearance report)."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/run_search_console_query": {
      "post": {
        "operationId": "call_run_search_console_query",
        "summary": "Custom Search Console query",
        "description": "Any Search Console Search Analytics query: dimensions date, hour, query, page, country, device and searchAppearance in any combination, regex filters, every search type, aggregation by page or property, fresh or final data, and up to 25,000 rows per call with paging.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "dimensions": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "enum": [
                        "date",
                        "hour",
                        "query",
                        "page",
                        "country",
                        "device",
                        "searchAppearance"
                      ]
                    },
                    "description": "Optional; none gives totals."
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "today",
                      "yesterday",
                      "7d",
                      "14d",
                      "28d",
                      "30d",
                      "90d",
                      "180d",
                      "365d",
                      "this_month",
                      "last_month",
                      "this_quarter",
                      "last_quarter",
                      "this_year",
                      "last_year"
                    ],
                    "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: from period."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  },
                  "compare": {
                    "type": "boolean",
                    "description": "Also return the previous period and the change per row. Default false."
                  },
                  "search_type": {
                    "type": "string",
                    "enum": [
                      "web",
                      "image",
                      "video",
                      "news",
                      "discover",
                      "googleNews"
                    ],
                    "description": "Default web."
                  },
                  "filters": {
                    "type": "array",
                    "description": "All must match. Each: {dimension, operator, expression}. operator: equals, notEquals, contains, notContains, includingRegex, excludingRegex. Example: [{\"dimension\":\"query\",\"operator\":\"includingRegex\",\"expression\":\"(?i)pricing|cost\"}].",
                    "items": {
                      "type": "object"
                    }
                  },
                  "aggregation_type": {
                    "type": "string",
                    "enum": [
                      "auto",
                      "byPage",
                      "byProperty",
                      "byNewsShowcasePanel"
                    ],
                    "description": "Default auto."
                  },
                  "data_state": {
                    "type": "string",
                    "enum": [
                      "final",
                      "all",
                      "hourly_all"
                    ],
                    "description": "Default all. hourly_all is needed for the hour dimension."
                  },
                  "row_limit": {
                    "type": "integer",
                    "description": "1–25000. Default 1000."
                  },
                  "start_row": {
                    "type": "integer",
                    "description": "Rows to skip, for paging. Default 0."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_search_opportunities": {
      "post": {
        "operationId": "call_get_search_opportunities",
        "summary": "Search opportunities",
        "description": "Where search traffic can grow or is slipping, worked out from Search Console data: striking-distance queries (position 4–20) with the clicks a top-3 spot would add, high-ranking queries with a weak click-through rate (rewrite the title and description), the queries and pages losing or gaining the most clicks against the previous period, and queries where several of your pages compete (cannibalisation). Use exclude_query for brand terms.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "today",
                      "yesterday",
                      "7d",
                      "14d",
                      "28d",
                      "30d",
                      "90d",
                      "180d",
                      "365d",
                      "this_month",
                      "last_month",
                      "this_quarter",
                      "last_quarter",
                      "this_year",
                      "last_year"
                    ],
                    "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: from period."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  },
                  "compare": {
                    "type": "boolean",
                    "description": "Also return the previous period of the same length and the change. Default true."
                  },
                  "search_type": {
                    "type": "string",
                    "enum": [
                      "web",
                      "image",
                      "video",
                      "news",
                      "discover",
                      "googleNews"
                    ],
                    "description": "Default web."
                  },
                  "min_impressions": {
                    "type": "integer",
                    "description": "Ignore queries with fewer impressions. Default scales with the period (20 for 28 days)."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Rows per list, 1–100. Default 15."
                  },
                  "query": {
                    "type": "string",
                    "description": "Query contains this text. Comma-separate several to match any."
                  },
                  "exact_query": {
                    "type": "string",
                    "description": "Query is exactly this."
                  },
                  "exclude_query": {
                    "type": "string",
                    "description": "Leave out queries containing this, e.g. your brand name. Comma-separate several."
                  },
                  "page": {
                    "type": "string",
                    "description": "Page URL contains this, e.g. /blog/."
                  },
                  "exact_page": {
                    "type": "string",
                    "description": "Page URL is exactly this."
                  },
                  "exclude_page": {
                    "type": "string",
                    "description": "Leave out pages whose URL contains this."
                  },
                  "country": {
                    "type": "string",
                    "description": "Country as an ISO 3166-1 alpha-3 code, e.g. \"usa\", \"gbr\", \"tur\"."
                  },
                  "device": {
                    "type": "string",
                    "description": "DESKTOP, MOBILE or TABLET."
                  },
                  "search_appearance": {
                    "type": "string",
                    "description": "A search appearance type, e.g. \"VIDEO\" (see the search_appearance report)."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/inspect_url": {
      "post": {
        "operationId": "call_inspect_url",
        "summary": "Inspect a URL",
        "description": "Google's index status for one page of the site, as Search Console's URL Inspection shows it: whether it is indexed and why not, last crawl, robots.txt and fetch state, Google's chosen canonical against yours, sitemaps that list it, mobile usability and rich results.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "url": {
                    "type": "string",
                    "description": "The full page URL, on the workspace's Search Console site."
                  },
                  "language_code": {
                    "type": "string",
                    "description": "For translated issue messages, e.g. \"en-US\". Optional."
                  }
                },
                "required": [
                  "workspace_id",
                  "url"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/list_sitemaps": {
      "post": {
        "operationId": "call_list_sitemaps",
        "summary": "Sitemaps",
        "description": "The sitemaps submitted for the workspace's Search Console site, with when Google last read them, errors and warnings, and how many URLs each lists.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_analytics_summary": {
      "post": {
        "operationId": "call_get_analytics_summary",
        "summary": "Analytics summary",
        "description": "Everything a traffic dashboard needs in one call: the GA4 overview with the previous period and a daily series (zero-filled, one row per day), top channels (with change), landing pages, referrers, countries, devices and key events; and Search Console totals, daily series, top queries and pages (with change) and opportunities. A source that is not connected comes back with its status instead of failing the call. Optional: include_health adds the tracking health checks.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "today",
                      "yesterday",
                      "7d",
                      "14d",
                      "28d",
                      "30d",
                      "90d",
                      "180d",
                      "365d",
                      "this_month",
                      "last_month",
                      "this_quarter",
                      "last_quarter",
                      "this_year",
                      "last_year"
                    ],
                    "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: from period."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  },
                  "compare": {
                    "type": "boolean",
                    "description": "Also return the previous period of the same length and the change. Default true."
                  },
                  "hostname": {
                    "type": "string",
                    "description": "Count only these hostnames in Google Analytics. Comma-separate several; \"*.example.com\" matches example.com and its subdomains; \"auto\" uses the site from the GA data stream (or Search Console). Default: every hostname."
                  },
                  "exclude_query": {
                    "type": "string",
                    "description": "Leave Search Console queries containing these out (e.g. your brand). Comma-separate several."
                  },
                  "limit": {
                    "type": "integer",
                    "description": "Rows per list, 1–100. Default 10."
                  },
                  "include_health": {
                    "type": "boolean",
                    "description": "Also run get_tracking_health. Default false."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_tracking_health": {
      "post": {
        "operationId": "call_get_tracking_health",
        "summary": "Tracking health",
        "description": "Whether the workspace's analytics can be trusted, as a list of checks (ok, warn, bad, skipped) with what to fix: Google Analytics and Search Console connected and pointing at the same site; GA receiving data; traffic on hostnames other than the real site (localhost, 127.0.0.1, *.vercel.app and *.framer.app previews, app subdomains) with each one's share; no key events set up; automatic events (page_view, session_start, first_visit, user_engagement, scroll) marked as key events; app and sign-in traffic mixed into the site (referrals from accounts.google.com or login hosts, app paths as landing pages); and a high share of \"(not set)\" landing pages. Returns suggested_filters.hostname to pass to the other reports.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "period": {
                    "type": "string",
                    "enum": [
                      "today",
                      "yesterday",
                      "7d",
                      "14d",
                      "28d",
                      "30d",
                      "90d",
                      "180d",
                      "365d",
                      "this_month",
                      "last_month",
                      "this_quarter",
                      "last_quarter",
                      "this_year",
                      "last_year"
                    ],
                    "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: from period."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  },
                  "hostname": {
                    "type": "string",
                    "description": "The real site's hostnames, when the GA data stream does not say (comma-separate; *.example.com allowed). Default: from the data stream, then Search Console."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_analytics_portfolio": {
      "post": {
        "operationId": "call_get_analytics_portfolio",
        "summary": "Analytics across workspaces",
        "description": "Headline GA4 and Search Console numbers for every workspace you can reach (an access key limited to chosen workspaces covers only those), each with the previous period and a zero-filled daily series. Use hostname=auto to count only each workspace's own site. Workspaces without analytics say so instead of failing the call.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "period": {
                    "type": "string",
                    "enum": [
                      "today",
                      "yesterday",
                      "7d",
                      "14d",
                      "28d",
                      "30d",
                      "90d",
                      "180d",
                      "365d",
                      "this_month",
                      "last_month",
                      "this_quarter",
                      "last_quarter",
                      "this_year",
                      "last_year"
                    ],
                    "description": "A named period. Default 28d. Ignored when start_date or end_date is given."
                  },
                  "start_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD. Default: from period."
                  },
                  "end_date": {
                    "type": "string",
                    "description": "YYYY-MM-DD, inclusive. Default: today."
                  },
                  "compare": {
                    "type": "boolean",
                    "description": "Also return the previous period of the same length and the change. Default true."
                  },
                  "hostname": {
                    "type": "string",
                    "enum": [
                      "auto"
                    ],
                    "description": "auto: count only each workspace's own site in GA (from its data stream or Search Console). Default: every hostname."
                  },
                  "include_health": {
                    "type": "boolean",
                    "description": "Also return each workspace's tracking health status and failing checks. Default false."
                  },
                  "workspace_ids": {
                    "type": "string",
                    "description": "Only these workspaces (comma-separated ids). Default: all you can reach."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/list_campaigns": {
      "post": {
        "operationId": "call_list_campaigns",
        "summary": "List campaigns",
        "description": "Campaigns in a workspace with status and how many contacts are in each state.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_campaign": {
      "post": {
        "operationId": "call_get_campaign",
        "summary": "Campaign details",
        "description": "One campaign's sequence (steps and message texts) and progress: contacts per step and status, sends, replies and accepted invitations.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "campaign_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "workspace_id",
                  "campaign_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/search_contacts": {
      "post": {
        "operationId": "call_search_contacts",
        "summary": "Search contacts",
        "description": "Find contacts by name, email or company. Returns ids for other tools.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "query": {
                    "type": "string",
                    "description": "Name, email or company. Empty lists recent contacts."
                  },
                  "limit": {
                    "type": "number",
                    "description": "Max 50, default 20."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/list_conversations": {
      "post": {
        "operationId": "call_list_conversations",
        "summary": "List inbox conversations",
        "description": "Inbox conversations, newest first. Filter to unread or by reply label.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "unread_only": {
                    "type": "boolean"
                  },
                  "label": {
                    "type": "string",
                    "description": "interested, not_interested, meeting_booked, out_of_office, referral, …"
                  },
                  "limit": {
                    "type": "number",
                    "description": "Max 50, default 20."
                  }
                },
                "required": [
                  "workspace_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/get_conversation": {
      "post": {
        "operationId": "call_get_conversation",
        "summary": "Read a conversation",
        "description": "All messages in one inbox conversation, oldest first, plus scheduled replies.",
        "tags": [
          "Tools"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "conversation_id": {
                    "type": "string"
                  }
                },
                "required": [
                  "workspace_id",
                  "conversation_id"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/send_reply": {
      "post": {
        "operationId": "call_send_reply",
        "summary": "Send a reply",
        "description": "Sends a reply in an inbox conversation right away, on its channel (LinkedIn message or email) from the connected account. Confirm the text with the user first.\n\nChanges data: needs a key with write access.",
        "tags": [
          "Tools that change data"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "conversation_id": {
                    "type": "string"
                  },
                  "body": {
                    "type": "string"
                  },
                  "subject": {
                    "type": "string",
                    "description": "Email only; defaults to Re: the thread subject."
                  }
                },
                "required": [
                  "workspace_id",
                  "conversation_id",
                  "body"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/schedule_reply": {
      "post": {
        "operationId": "call_schedule_reply",
        "summary": "Schedule a reply",
        "description": "Schedules a reply in an inbox conversation for a later time (sent within 5 minutes of it). Use an ISO 8601 time with offset, e.g. 2026-11-10T09:00:00-05:00.\n\nChanges data: needs a key with write access.",
        "tags": [
          "Tools that change data"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "conversation_id": {
                    "type": "string"
                  },
                  "body": {
                    "type": "string"
                  },
                  "send_at": {
                    "type": "string",
                    "description": "ISO 8601 with offset."
                  },
                  "time_zone": {
                    "type": "string",
                    "description": "IANA zone to show it in, e.g. Europe/Istanbul."
                  },
                  "subject": {
                    "type": "string"
                  }
                },
                "required": [
                  "workspace_id",
                  "conversation_id",
                  "body",
                  "send_at"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/enroll_contacts": {
      "post": {
        "operationId": "call_enroll_contacts",
        "summary": "Add contacts to a campaign",
        "description": "Adds contacts to a campaign. Contacts already active in another campaign are skipped. In an active campaign they start within minutes.\n\nChanges data: needs a key with write access.",
        "tags": [
          "Tools that change data"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "campaign_id": {
                    "type": "string"
                  },
                  "contact_ids": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    },
                    "maxItems": 500
                  }
                },
                "required": [
                  "workspace_id",
                  "campaign_id",
                  "contact_ids"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    },
    "/tools/set_campaign_status": {
      "post": {
        "operationId": "call_set_campaign_status",
        "summary": "Pause or resume a campaign",
        "description": "Pauses an active campaign or resumes a paused one. Launching a draft is done in the Auli app.\n\nChanges data: needs a key with write access.",
        "tags": [
          "Tools that change data"
        ],
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "workspace_id": {
                    "type": "string",
                    "description": "Workspace id from list_workspaces."
                  },
                  "campaign_id": {
                    "type": "string"
                  },
                  "status": {
                    "type": "string",
                    "enum": [
                      "paused",
                      "active"
                    ]
                  }
                },
                "required": [
                  "workspace_id",
                  "campaign_id",
                  "status"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The tool's result."
          },
          "400": {
            "$ref": "#/components/responses/Error"
          },
          "401": {
            "$ref": "#/components/responses/Error"
          },
          "403": {
            "$ref": "#/components/responses/Error"
          },
          "404": {
            "$ref": "#/components/responses/Error"
          }
        }
      }
    }
  }
}