{
  "openapi": "3.0.1",
  "info": {
    "title": "UTM Link Builder & Auditor (Bulk) · SiteVerdict",
    "description": "Build clean UTM links in bulk, or audit the links on your site or in an email: finds broken and inconsistent UTMs, typos, PII, Unassigned GA4 channels and redirects that drop tracking. Naming-convention rules, CSV export, optional AI taxonomy.",
    "version": "1.0",
    "x-build-id": "JsM3QgHDY5by6ZxE2"
  },
  "servers": [
    {
      "url": "https://api.apify.com/v2"
    }
  ],
  "paths": {
    "/acts/siteverdict~siteverdict-utm-link-auditor/run-sync-get-dataset-items": {
      "post": {
        "operationId": "run-sync-get-dataset-items-siteverdict-siteverdict-utm-link-auditor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for its completion, and returns Actor's dataset items in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    },
    "/acts/siteverdict~siteverdict-utm-link-auditor/runs": {
      "post": {
        "operationId": "runs-sync-siteverdict-siteverdict-utm-link-auditor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor and returns information about the initiated run in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/runsResponseSchema"
                }
              }
            }
          }
        }
      }
    },
    "/acts/siteverdict~siteverdict-utm-link-auditor/run-sync": {
      "post": {
        "operationId": "run-sync-siteverdict-siteverdict-utm-link-auditor",
        "x-openai-isConsequential": false,
        "summary": "Executes an Actor, waits for completion, and returns the OUTPUT from Key-value store in response.",
        "tags": [
          "Run Actor"
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/inputSchema"
              }
            }
          }
        },
        "parameters": [
          {
            "name": "token",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "Enter your Apify token here"
          }
        ],
        "responses": {
          "200": {
            "description": "OK"
          }
        }
      }
    }
  },
  "components": {
    "schemas": {
      "inputSchema": {
        "type": "object",
        "properties": {
          "executionMode": {
            "title": "Run type",
            "enum": [
              "live",
              "sample"
            ],
            "type": "string",
            "description": "<b>Live</b> uses your input. <b>Sample</b> audits a recorded newsletter full of typical UTM mistakes (free, no network).",
            "default": "live"
          },
          "mode": {
            "title": "What to do",
            "enum": [
              "audit",
              "build"
            ],
            "type": "string",
            "description": "<b>Audit</b> existing links (on web pages, in an email, or pasted). <b>Build</b> tagged links from rows of base URL + source/medium/campaign.",
            "default": "audit"
          },
          "pages": {
            "title": "Pages to scan (audit)",
            "type": "array",
            "description": "Pages whose links are audited, e.g. your homepage, a landing page or the web version of a newsletter.",
            "items": {
              "type": "object",
              "required": [
                "url"
              ],
              "properties": {
                "url": {
                  "type": "string",
                  "title": "URL of a web page",
                  "format": "uri"
                }
              }
            }
          },
          "crawlSameSite": {
            "title": "Also crawl same-site pages",
            "type": "boolean",
            "description": "Follow links to other pages on the same host (breadth-first) up to 'Max pages'. robots.txt is respected.",
            "default": false
          },
          "maxPages": {
            "title": "Max pages",
            "minimum": 1,
            "maximum": 200,
            "type": "integer",
            "description": "Cap on pages fetched when crawling.",
            "default": 20
          },
          "emailHtml": {
            "title": "Email HTML (audit)",
            "type": "string",
            "description": "Paste the HTML source of an email or newsletter to audit every link in it (export it from Mailchimp, Klaviyo, HubSpot …). Max 5 MB."
          },
          "linksToAudit": {
            "title": "Links to audit",
            "type": "array",
            "description": "Paste links directly (ad final URLs, bio links, QR-code targets …).",
            "items": {
              "type": "string"
            }
          },
          "onlyTaggedLinks": {
            "title": "Only report tagged links",
            "type": "boolean",
            "description": "Report only links that carry utm_* parameters or click IDs (recommended). Turn off to list every link found.",
            "default": true
          },
          "buildRows": {
            "title": "Links to build",
            "type": "array",
            "description": "JSON rows: url (required), source, medium, campaign, term, content, id. Example: [{\"url\": \"https://shop.example/sale\", \"source\": \"newsletter\", \"medium\": \"email\", \"campaign\": \"Black Friday 2026\"}]"
          },
          "buildCsv": {
            "title": "Links to build (CSV)",
            "type": "string",
            "description": "Or paste CSV with a header row: url, source, medium, campaign, term, content, id (aliases such as landing_page, utm_source and keyword are understood)."
          },
          "checkRedirects": {
            "title": "Follow links and check redirects",
            "type": "boolean",
            "description": "Request each link to confirm it is not broken and that redirects (shorteners, http→https, trailing slashes) keep every UTM parameter. Billed per link followed.",
            "default": false
          },
          "maxRedirectChecks": {
            "title": "Max links to follow",
            "minimum": 0,
            "maximum": 2000,
            "type": "integer",
            "description": "Safety cap on destination checks per run.",
            "default": 200
          },
          "caseRule": {
            "title": "Case rule",
            "enum": [
              "lower",
              "any"
            ],
            "type": "string",
            "description": "GA4 is case-sensitive: 'Email' and 'email' are reported separately.",
            "default": "lower"
          },
          "separator": {
            "title": "Word separator",
            "enum": [
              "any",
              "-",
              "_"
            ],
            "type": "string",
            "description": "The separator your team uses inside values. Spaces are always flagged.",
            "default": "any"
          },
          "requiredParams": {
            "title": "Required parameters",
            "type": "array",
            "description": "Parameters every tagged link must have.",
            "default": [
              "utm_source",
              "utm_medium",
              "utm_campaign"
            ],
            "items": {
              "type": "string"
            }
          },
          "allowedSources": {
            "title": "Allowed sources (optional)",
            "type": "array",
            "description": "If set, any other utm_source is flagged, e.g. google, facebook, linkedin, newsletter.",
            "items": {
              "type": "string"
            }
          },
          "allowedMediums": {
            "title": "Allowed mediums (optional)",
            "type": "array",
            "description": "If set, any other utm_medium is flagged, e.g. cpc, paid-social, social, email, display, affiliate, referral.",
            "items": {
              "type": "string"
            }
          },
          "customPatterns": {
            "title": "Custom patterns (optional)",
            "type": "object",
            "description": "One regular expression per parameter, e.g. {\"utm_campaign\": \"^\\\\d{4}-[a-z0-9-]+$\"} to require a year prefix."
          },
          "maxValueLength": {
            "title": "Max value length",
            "minimum": 10,
            "maximum": 1000,
            "type": "integer",
            "description": "Longer values are flagged.",
            "default": 100
          },
          "flagInternalUtm": {
            "title": "Flag UTMs on internal links",
            "type": "boolean",
            "description": "UTMs on links to your own site overwrite the visitor's real source in GA4.",
            "default": true
          },
          "maxConcurrency": {
            "title": "Parallel requests",
            "minimum": 1,
            "maximum": 10,
            "type": "integer",
            "description": "Requests to one host are sequential, at most 1 per second.",
            "default": 4
          },
          "timeoutSecs": {
            "title": "Request timeout (seconds)",
            "minimum": 5,
            "maximum": 60,
            "type": "integer",
            "description": "Per request.",
            "default": 20
          },
          "aiEnabled": {
            "title": "AI fix suggestions (your own key)",
            "type": "boolean",
            "description": "Off by default. When inconsistent or invalid values are found, your LLM (with YOUR key) proposes a clean naming convention and an old→new value mapping using only the values found. One 'ai-fix' event per run when it succeeds; your provider bills tokens separately.",
            "default": false
          },
          "aiProvider": {
            "title": "AI provider",
            "enum": [
              "anthropic",
              "openai"
            ],
            "type": "string",
            "description": "Which API your key belongs to.",
            "default": "anthropic"
          },
          "aiApiKey": {
            "title": "AI API key",
            "type": "string",
            "description": "Your Anthropic or OpenAI API key. Stored encrypted by Apify, never logged or written to the output."
          },
          "aiModel": {
            "title": "AI model (optional)",
            "type": "string",
            "description": "Leave empty for the default (Anthropic: claude-sonnet-5-5, OpenAI: gpt-5-mini)."
          }
        }
      },
      "runsResponseSchema": {
        "type": "object",
        "properties": {
          "data": {
            "type": "object",
            "properties": {
              "id": {
                "type": "string"
              },
              "actId": {
                "type": "string"
              },
              "userId": {
                "type": "string"
              },
              "startedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "finishedAt": {
                "type": "string",
                "format": "date-time",
                "example": "2025-01-08T00:00:00.000Z"
              },
              "status": {
                "type": "string",
                "example": "READY"
              },
              "meta": {
                "type": "object",
                "properties": {
                  "origin": {
                    "type": "string",
                    "example": "API"
                  },
                  "userAgent": {
                    "type": "string"
                  }
                }
              },
              "stats": {
                "type": "object",
                "properties": {
                  "inputBodyLen": {
                    "type": "integer",
                    "example": 2000
                  },
                  "rebootCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "restartCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "resurrectCount": {
                    "type": "integer",
                    "example": 0
                  },
                  "computeUnits": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "options": {
                "type": "object",
                "properties": {
                  "build": {
                    "type": "string",
                    "example": "latest"
                  },
                  "timeoutSecs": {
                    "type": "integer",
                    "example": 300
                  },
                  "memoryMbytes": {
                    "type": "integer",
                    "example": 1024
                  },
                  "diskMbytes": {
                    "type": "integer",
                    "example": 2048
                  }
                }
              },
              "buildId": {
                "type": "string"
              },
              "defaultKeyValueStoreId": {
                "type": "string"
              },
              "defaultDatasetId": {
                "type": "string"
              },
              "defaultRequestQueueId": {
                "type": "string"
              },
              "buildNumber": {
                "type": "string",
                "example": "1.0.0"
              },
              "containerUrl": {
                "type": "string"
              },
              "usage": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "integer",
                    "example": 1
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              },
              "usageTotalUsd": {
                "type": "number",
                "example": 0.00005
              },
              "usageUsd": {
                "type": "object",
                "properties": {
                  "ACTOR_COMPUTE_UNITS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATASET_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "KEY_VALUE_STORE_WRITES": {
                    "type": "number",
                    "example": 0.00005
                  },
                  "KEY_VALUE_STORE_LISTS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_READS": {
                    "type": "integer",
                    "example": 0
                  },
                  "REQUEST_QUEUE_WRITES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_INTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "DATA_TRANSFER_EXTERNAL_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_RESIDENTIAL_TRANSFER_GBYTES": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_SERPS": {
                    "type": "integer",
                    "example": 0
                  },
                  "PROXY_UNBLOCKER_UNITS": {
                    "type": "integer",
                    "example": 0
                  }
                }
              }
            }
          }
        }
      }
    }
  }
}