[{"data":1,"prerenderedAt":2100},["ShallowReactive",2],{"docs-\u002Fapi\u002Fscan\u002F":3},{"id":4,"title":5,"body":6,"breadcrumb":2054,"coderail":2061,"dateModified":2087,"datePublished":2087,"description":2088,"extension":2089,"meta":2090,"navigation":2091,"next":2092,"path":2093,"prev":2094,"schemaType":2095,"seo":2096,"stem":2097,"wide":2098,"__hash__":2099},"docs\u002Fapi\u002Fscan.md","POST \u002Fscan",{"type":7,"value":8,"toc":2040},"minimark",[9,16,55,62,67,72,77,142,146,313,316,323,328,427,430,439,443,455,554,575,600,1625,1629,1671,1678,1682,1980,1984,1987,1990,1998,2001,2009,2013,2036],[10,11,12],"p",{},[13,14,15],"strong",{},"Summary",[17,18,19,29,35,43,49],"ul",{},[20,21,22,25,26],"li",{},[13,23,24],{},"endpoint"," — ",[27,28,5],"code",{},[20,30,31,34],{},[13,32,33],{},"purpose"," — audit a GTM container sent in the request body, without fetching any URLs",[20,36,37,25,40],{},[13,38,39],{},"mcp equivalent",[27,41,42],{},"scan_container",[20,44,45,48],{},[13,46,47],{},"rate limit"," — 200\u002Fday per user",[20,50,51,54],{},[13,52,53],{},"synchronous"," — yes",[10,56,57,58,61],{},"Send a GTM container in the request body and receive findings, per-category counts, and a health score. The endpoint fetches nothing: no page and no ",[27,59,60],{},"gtm.js",". Use it when you have the container export file from GTM, including one for a workspace that is not published.",[63,64],"endpoint-bar",{"method":65,"path":66},"POST","\u002Fv1\u002Fscan",[68,69,71],"h2",{"id":70},"request","Request",[73,74,76],"h3",{"id":75},"headers","Headers",[78,79,80,96],"table",{},[81,82,83],"thead",{},[84,85,86,90,93],"tr",{},[87,88,89],"th",{},"Header",[87,91,92],{},"Required",[87,94,95],{},"Value",[97,98,99,126],"tbody",{},[84,100,101,107,110],{},[102,103,104],"td",{},[27,105,106],{},"Authorization",[102,108,109],{},"yes",[102,111,112,115,116,119,120,125],{},[27,113,114],{},"Bearer \u003Ctoken>",". An API key, or an MCP access token with the ",[27,117,118],{},"mcp:tools"," scope. See ",[121,122,124],"a",{"href":123},"\u002Fauth\u002F","Authentication",".",[84,127,128,133,136],{},[102,129,130],{},[27,131,132],{},"Content-Type",[102,134,135],{},"recommended",[102,137,138,141],{},[27,139,140],{},"application\u002Fjson",". The body is read as JSON whether or not the header is sent.",[73,143,145],{"id":144},"body-parameters","Body parameters",[78,147,148,163],{},[81,149,150],{},[84,151,152,155,158,160],{},[87,153,154],{},"Field",[87,156,157],{},"Type",[87,159,92],{},[87,161,162],{},"Description",[97,164,165,181,229,256,279],{},[84,166,167,172,175,178],{},[102,168,169],{},[27,170,171],{},"data",[102,173,174],{},"object",[102,176,177],{},"required",[102,179,180],{},"The container. Either the GTM JSON export as downloaded, or an already parsed container. See below.",[84,182,183,188,191,194],{},[102,184,185],{},[27,186,187],{},"category",[102,189,190],{},"string",[102,192,193],{},"optional",[102,195,196,197,200,201,200,204,200,207,200,210,200,213,200,216,200,219,200,222,225,226,125],{},"Restrict findings to one category: ",[27,198,199],{},"consent",", ",[27,202,203],{},"ga4",[27,205,206],{},"ads",[27,208,209],{},"ecommerce",[27,211,212],{},"security",[27,214,215],{},"pii",[27,217,218],{},"performance",[27,220,221],{},"quality",[27,223,224],{},"organization"," or ",[27,227,228],{},"dead-code",[84,230,231,236,238,240],{},[102,232,233],{},[27,234,235],{},"tier",[102,237,190],{},[102,239,193],{},[102,241,242,243,200,246,200,249,252,253,125],{},"Restrict findings to one tier: ",[27,244,245],{},"error",[27,247,248],{},"warning",[27,250,251],{},"optimization",", or ",[27,254,255],{},"info",[84,257,258,263,266,268],{},[102,259,260],{},[27,261,262],{},"top_n",[102,264,265],{},"number",[102,267,193],{},[102,269,270,271,274,275,278],{},"Maximum findings to return, most important first (by tier, then severity). Must be 0 or more. ",[27,272,273],{},"0"," returns no findings. Returns all findings when omitted. Numeric text such as ",[27,276,277],{},"\"10\""," is accepted; a fraction is rounded down.",[84,280,281,286,289,291],{},[102,282,283],{},[27,284,285],{},"include_evidence",[102,287,288],{},"boolean",[102,290,193],{},[102,292,293,294,200,297,300,301,304,305,308,309,312],{},"Return the longer finding: ",[27,295,296],{},"description",[27,298,299],{},"evidence",", and the affected items the rule reports (some rules list only the first 10 or 20) in place of the first three. Default ",[27,302,303],{},"false",". The text ",[27,306,307],{},"\"true\""," and ",[27,310,311],{},"\"false\""," are accepted.",[10,314,315],{},"Any other field in the body is refused with a 400, so a misspelt filter is never silently ignored.",[73,317,319,320,322],{"id":318},"what-data-accepts","What ",[27,321,171],{}," accepts",[10,324,325,327],{},[27,326,171],{}," takes one of two forms.",[329,330,331,384],"ol",{},[20,332,333,336,337,340,341,344,345,348,349,352,353,356,357,359,360,363,364,367,368,200,371,200,374,225,377,380,381,383],{},[13,334,335],{},"A GTM JSON export."," This is the file from ",[13,338,339],{},"Admin → Export container"," in GTM, sent unchanged. The endpoint recognises it by its ",[27,342,343],{},"containerVersion"," key and parses it. ",[27,346,347],{},"containerVersion.container"," must carry the container's ",[27,350,351],{},"publicId"," (a ",[27,354,355],{},"containerId"," is accepted in its place). With only a ",[27,358,355],{},", the container is still audited and ",[27,361,362],{},"container.gtm_id"," in the response is the text ",[27,365,366],{},"Unknown",". If ",[27,369,370],{},"tag",[27,372,373],{},"trigger",[27,375,376],{},"variable",[27,378,379],{},"folder"," are present under ",[27,382,343],{},", each must be an array of objects.",[20,385,386,389,390,200,393,308,396,399,400,403,404,407,408,403,410,413,414,308,417,420,421,308,423,426],{},[13,387,388],{},"A parsed container."," This is the form TagManifest's own parser produces: an object with ",[27,391,392],{},"tags",[27,394,395],{},"triggers",[27,397,398],{},"variables",", each an array of objects. Every tag needs a string ",[27,401,402],{},"type"," and a ",[27,405,406],{},"firingTriggerIds"," array. Every trigger and every variable needs a string ",[27,409,402],{},[27,411,412],{},"referencedByTags"," array. ",[27,415,416],{},"meta.publicId",[27,418,419],{},"meta.containerName"," are optional and fill ",[27,422,362],{},[27,424,425],{},"container.name"," in the response.",[10,428,429],{},"Most callers should send the export. Anything that is neither form is refused with a 400 and is not audited.",[431,432,433],"callout",{},[10,434,435,438],{},[13,436,437],{},"Synchronous."," The endpoint returns when the audit completes. No scan IDs, no polling, no webhooks.",[68,440,442],{"id":441},"response","Response",[10,444,445,446,450,451,454],{},"Returns a scan object with container metadata, a findings array sorted by tier then severity, per-category and per-tier counts, and a health score. The shape is the same as ",[121,447,449],{"href":448},"\u002Fapi\u002Fscan-url\u002F","POST \u002Fscan-url"," without the ",[27,452,453],{},"site"," object.",[78,456,457,465],{},[81,458,459],{},[84,460,461,463],{},[87,462,154],{},[87,464,162],{},[97,466,467,481,499,511,527,540],{},[84,468,469,474],{},[102,470,471],{},[27,472,473],{},"container",[102,475,476,477,480],{},"Tag, trigger and variable counts, plus the GTM ID and container name read from the container (or ",[27,478,479],{},"null",").",[84,482,483,488],{},[102,484,485],{},[27,486,487],{},"findings",[102,489,490,491,308,493,495,496,498],{},"The findings after the ",[27,492,187],{},[27,494,235],{}," filters and the ",[27,497,262],{}," cut.",[84,500,501,506],{},[102,502,503],{},[27,504,505],{},"findings_total",[102,507,508,509,125],{},"How many findings match the filters, before ",[27,510,262],{},[84,512,513,518],{},[102,514,515],{},[27,516,517],{},"findings_truncated",[102,519,520,523,524,526],{},[27,521,522],{},"true"," when ",[27,525,262],{}," cut the list short.",[84,528,529,537],{},[102,530,531,200,534],{},[27,532,533],{},"by_category",[27,535,536],{},"by_tier",[102,538,539],{},"Counts of all findings in the container. Filters do not change them.",[84,541,542,547],{},[102,543,544],{},[27,545,546],{},"health_score",[102,548,549,550,125],{},"The score for the whole container. Filters do not change it. See ",[121,551,553],{"href":552},"\u002Fhealth-score\u002F","Health score",[10,555,556,559,560,403,563,566,567,570,571,574],{},[27,557,558],{},"affected_items"," is a list of objects, one per tag, trigger or variable. Each has an ",[27,561,562],{},"id",[27,564,565],{},"name",", and some rules add fields such as ",[27,568,569],{},"eventName",". By default the list holds the first three items and ",[27,572,573],{},"affected_items_total"," gives the number of items the rule reported.",[10,576,577,578,581,582,308,584,586,587,589,590,308,593,595,596,599],{},"With ",[27,579,580],{},"include_evidence: true"," a finding has ",[27,583,296],{},[27,585,299],{}," as well, ",[27,588,558],{}," holds the affected items the rule reports (some rules list only the first 10 or 20), and ",[27,591,592],{},"finding_count",[27,594,573],{}," are left out. The set of fields is fixed: a rule's own extra fields, such as ",[27,597,598],{},"subType",", are not returned.",[601,602,604],"details",{"summary":603},"Full response shape",[605,606,611],"pre",{"className":607,"code":608,"language":609,"meta":610,"style":610},"language-json shiki shiki-themes github-light github-dark","{\n  \"scanned_at\": \"2026-05-04T14:00:00.000Z\",\n  \"duration_ms\": 38,\n  \"container\": {\n    \"tag_count\": 42,\n    \"trigger_count\": 18,\n    \"variable_count\": 31,\n    \"gtm_id\": \"GTM-EXAMPLE\",\n    \"name\": \"My Website\"\n  },\n  \"findings\": [\n    {\n      \"rule_id\": \"ga4-event-name-invalid-chars\",\n      \"title\": \"GA4 event names with invalid characters\",\n      \"severity\": \"high\",\n      \"tier\": \"warning\",\n      \"category\": \"ga4\",\n      \"finding_count\": 1,\n      \"affected_items\": [\n        {\n          \"id\": \"14\",\n          \"name\": \"GA4 - Form Submit\",\n          \"eventName\": \"form-submit\"\n        }\n      ],\n      \"affected_items_total\": 1,\n      \"action\": \"Fix event name characters\",\n      \"recommendation\": \"Rename events to use only letters, numbers, and underscores. Replace hyphens and spaces with underscores.\"\n    },\n    {\n      \"rule_id\": \"consent-no-cmp\",\n      \"title\": \"No Consent Management Platform (CMP) detected\",\n      \"severity\": \"medium\",\n      \"tier\": \"warning\",\n      \"category\": \"consent\",\n      \"finding_count\": 1,\n      \"affected_items\": [\n        {\n          \"id\": \"21\",\n          \"name\": \"Google Ads - Conversion\"\n        },\n        {\n          \"id\": \"22\",\n          \"name\": \"Google Ads - Remarketing\"\n        }\n      ],\n      \"affected_items_total\": 2,\n      \"action\": \"Deploy a CMP\",\n      \"recommendation\": \"Verify whether consent management is deployed outside GTM (check for CMP scripts in your page source). If consent is managed externally, no action needed in GTM. If no CMP exists and your site serves visitors in regions requiring consent, consider deploying one.\"\n    },\n    {\n      \"rule_id\": \"ga4-debug-mode-hardcoded\",\n      \"title\": \"GA4 debug_mode hardcoded to \\\"true\\\"\",\n      \"severity\": \"high\",\n      \"tier\": \"optimization\",\n      \"category\": \"ga4\",\n      \"finding_count\": 1,\n      \"affected_items\": [\n        {\n          \"id\": \"9\",\n          \"name\": \"GA4 - Config\"\n        }\n      ],\n      \"affected_items_total\": 1,\n      \"action\": \"Fix debug_mode configuration\",\n      \"recommendation\": \"Remove the debug_mode parameter, or replace the literal \\\"true\\\" with a GTM variable that is only enabled in preview\u002Fdebug environments.\"\n    }\n  ],\n  \"findings_total\": 3,\n  \"findings_truncated\": false,\n  \"by_category\": {\n    \"ga4\": 2,\n    \"consent\": 1\n  },\n  \"by_tier\": {\n    \"warning\": 2,\n    \"optimization\": 1\n  },\n  \"health_score\": {\n    \"score\": 87,\n    \"grade\": \"B\",\n    \"label\": \"Healthy\",\n    \"deductions\": {\n      \"error\": 0,\n      \"warning\": 8,\n      \"optimization\": 5,\n      \"info\": 0,\n      \"byCategory\": {\n        \"ga4\": 2,\n        \"consent\": 1\n      }\n    },\n    \"caps\": {\n      \"error\": 35,\n      \"warning\": 20,\n      \"optimization\": 25,\n      \"info\": 0\n    },\n    \"functionalIssueCount\": 3\n  }\n}\n","json","",[27,612,613,622,639,652,661,674,687,700,713,724,730,739,745,758,771,784,797,810,823,831,837,850,863,874,880,886,898,911,922,928,933,945,957,969,980,992,1003,1010,1015,1027,1037,1043,1048,1060,1070,1075,1080,1092,1104,1114,1119,1124,1136,1158,1169,1181,1192,1203,1210,1215,1227,1237,1242,1247,1258,1270,1289,1295,1301,1314,1326,1334,1346,1357,1362,1370,1382,1392,1397,1405,1418,1431,1444,1452,1464,1477,1490,1502,1510,1522,1532,1538,1543,1551,1563,1575,1587,1597,1602,1613,1619],{"__ignoreMap":610},[614,615,618],"span",{"class":616,"line":617},"line",1,[614,619,621],{"class":620},"sVt8B","{\n",[614,623,625,629,632,636],{"class":616,"line":624},2,[614,626,628],{"class":627},"sj4cs","  \"scanned_at\"",[614,630,631],{"class":620},": ",[614,633,635],{"class":634},"sZZnC","\"2026-05-04T14:00:00.000Z\"",[614,637,638],{"class":620},",\n",[614,640,642,645,647,650],{"class":616,"line":641},3,[614,643,644],{"class":627},"  \"duration_ms\"",[614,646,631],{"class":620},[614,648,649],{"class":627},"38",[614,651,638],{"class":620},[614,653,655,658],{"class":616,"line":654},4,[614,656,657],{"class":627},"  \"container\"",[614,659,660],{"class":620},": {\n",[614,662,664,667,669,672],{"class":616,"line":663},5,[614,665,666],{"class":627},"    \"tag_count\"",[614,668,631],{"class":620},[614,670,671],{"class":627},"42",[614,673,638],{"class":620},[614,675,677,680,682,685],{"class":616,"line":676},6,[614,678,679],{"class":627},"    \"trigger_count\"",[614,681,631],{"class":620},[614,683,684],{"class":627},"18",[614,686,638],{"class":620},[614,688,690,693,695,698],{"class":616,"line":689},7,[614,691,692],{"class":627},"    \"variable_count\"",[614,694,631],{"class":620},[614,696,697],{"class":627},"31",[614,699,638],{"class":620},[614,701,703,706,708,711],{"class":616,"line":702},8,[614,704,705],{"class":627},"    \"gtm_id\"",[614,707,631],{"class":620},[614,709,710],{"class":634},"\"GTM-EXAMPLE\"",[614,712,638],{"class":620},[614,714,716,719,721],{"class":616,"line":715},9,[614,717,718],{"class":627},"    \"name\"",[614,720,631],{"class":620},[614,722,723],{"class":634},"\"My Website\"\n",[614,725,727],{"class":616,"line":726},10,[614,728,729],{"class":620},"  },\n",[614,731,733,736],{"class":616,"line":732},11,[614,734,735],{"class":627},"  \"findings\"",[614,737,738],{"class":620},": [\n",[614,740,742],{"class":616,"line":741},12,[614,743,744],{"class":620},"    {\n",[614,746,748,751,753,756],{"class":616,"line":747},13,[614,749,750],{"class":627},"      \"rule_id\"",[614,752,631],{"class":620},[614,754,755],{"class":634},"\"ga4-event-name-invalid-chars\"",[614,757,638],{"class":620},[614,759,761,764,766,769],{"class":616,"line":760},14,[614,762,763],{"class":627},"      \"title\"",[614,765,631],{"class":620},[614,767,768],{"class":634},"\"GA4 event names with invalid characters\"",[614,770,638],{"class":620},[614,772,774,777,779,782],{"class":616,"line":773},15,[614,775,776],{"class":627},"      \"severity\"",[614,778,631],{"class":620},[614,780,781],{"class":634},"\"high\"",[614,783,638],{"class":620},[614,785,787,790,792,795],{"class":616,"line":786},16,[614,788,789],{"class":627},"      \"tier\"",[614,791,631],{"class":620},[614,793,794],{"class":634},"\"warning\"",[614,796,638],{"class":620},[614,798,800,803,805,808],{"class":616,"line":799},17,[614,801,802],{"class":627},"      \"category\"",[614,804,631],{"class":620},[614,806,807],{"class":634},"\"ga4\"",[614,809,638],{"class":620},[614,811,813,816,818,821],{"class":616,"line":812},18,[614,814,815],{"class":627},"      \"finding_count\"",[614,817,631],{"class":620},[614,819,820],{"class":627},"1",[614,822,638],{"class":620},[614,824,826,829],{"class":616,"line":825},19,[614,827,828],{"class":627},"      \"affected_items\"",[614,830,738],{"class":620},[614,832,834],{"class":616,"line":833},20,[614,835,836],{"class":620},"        {\n",[614,838,840,843,845,848],{"class":616,"line":839},21,[614,841,842],{"class":627},"          \"id\"",[614,844,631],{"class":620},[614,846,847],{"class":634},"\"14\"",[614,849,638],{"class":620},[614,851,853,856,858,861],{"class":616,"line":852},22,[614,854,855],{"class":627},"          \"name\"",[614,857,631],{"class":620},[614,859,860],{"class":634},"\"GA4 - Form Submit\"",[614,862,638],{"class":620},[614,864,866,869,871],{"class":616,"line":865},23,[614,867,868],{"class":627},"          \"eventName\"",[614,870,631],{"class":620},[614,872,873],{"class":634},"\"form-submit\"\n",[614,875,877],{"class":616,"line":876},24,[614,878,879],{"class":620},"        }\n",[614,881,883],{"class":616,"line":882},25,[614,884,885],{"class":620},"      ],\n",[614,887,889,892,894,896],{"class":616,"line":888},26,[614,890,891],{"class":627},"      \"affected_items_total\"",[614,893,631],{"class":620},[614,895,820],{"class":627},[614,897,638],{"class":620},[614,899,901,904,906,909],{"class":616,"line":900},27,[614,902,903],{"class":627},"      \"action\"",[614,905,631],{"class":620},[614,907,908],{"class":634},"\"Fix event name characters\"",[614,910,638],{"class":620},[614,912,914,917,919],{"class":616,"line":913},28,[614,915,916],{"class":627},"      \"recommendation\"",[614,918,631],{"class":620},[614,920,921],{"class":634},"\"Rename events to use only letters, numbers, and underscores. Replace hyphens and spaces with underscores.\"\n",[614,923,925],{"class":616,"line":924},29,[614,926,927],{"class":620},"    },\n",[614,929,931],{"class":616,"line":930},30,[614,932,744],{"class":620},[614,934,936,938,940,943],{"class":616,"line":935},31,[614,937,750],{"class":627},[614,939,631],{"class":620},[614,941,942],{"class":634},"\"consent-no-cmp\"",[614,944,638],{"class":620},[614,946,948,950,952,955],{"class":616,"line":947},32,[614,949,763],{"class":627},[614,951,631],{"class":620},[614,953,954],{"class":634},"\"No Consent Management Platform (CMP) detected\"",[614,956,638],{"class":620},[614,958,960,962,964,967],{"class":616,"line":959},33,[614,961,776],{"class":627},[614,963,631],{"class":620},[614,965,966],{"class":634},"\"medium\"",[614,968,638],{"class":620},[614,970,972,974,976,978],{"class":616,"line":971},34,[614,973,789],{"class":627},[614,975,631],{"class":620},[614,977,794],{"class":634},[614,979,638],{"class":620},[614,981,983,985,987,990],{"class":616,"line":982},35,[614,984,802],{"class":627},[614,986,631],{"class":620},[614,988,989],{"class":634},"\"consent\"",[614,991,638],{"class":620},[614,993,995,997,999,1001],{"class":616,"line":994},36,[614,996,815],{"class":627},[614,998,631],{"class":620},[614,1000,820],{"class":627},[614,1002,638],{"class":620},[614,1004,1006,1008],{"class":616,"line":1005},37,[614,1007,828],{"class":627},[614,1009,738],{"class":620},[614,1011,1013],{"class":616,"line":1012},38,[614,1014,836],{"class":620},[614,1016,1018,1020,1022,1025],{"class":616,"line":1017},39,[614,1019,842],{"class":627},[614,1021,631],{"class":620},[614,1023,1024],{"class":634},"\"21\"",[614,1026,638],{"class":620},[614,1028,1030,1032,1034],{"class":616,"line":1029},40,[614,1031,855],{"class":627},[614,1033,631],{"class":620},[614,1035,1036],{"class":634},"\"Google Ads - Conversion\"\n",[614,1038,1040],{"class":616,"line":1039},41,[614,1041,1042],{"class":620},"        },\n",[614,1044,1046],{"class":616,"line":1045},42,[614,1047,836],{"class":620},[614,1049,1051,1053,1055,1058],{"class":616,"line":1050},43,[614,1052,842],{"class":627},[614,1054,631],{"class":620},[614,1056,1057],{"class":634},"\"22\"",[614,1059,638],{"class":620},[614,1061,1063,1065,1067],{"class":616,"line":1062},44,[614,1064,855],{"class":627},[614,1066,631],{"class":620},[614,1068,1069],{"class":634},"\"Google Ads - Remarketing\"\n",[614,1071,1073],{"class":616,"line":1072},45,[614,1074,879],{"class":620},[614,1076,1078],{"class":616,"line":1077},46,[614,1079,885],{"class":620},[614,1081,1083,1085,1087,1090],{"class":616,"line":1082},47,[614,1084,891],{"class":627},[614,1086,631],{"class":620},[614,1088,1089],{"class":627},"2",[614,1091,638],{"class":620},[614,1093,1095,1097,1099,1102],{"class":616,"line":1094},48,[614,1096,903],{"class":627},[614,1098,631],{"class":620},[614,1100,1101],{"class":634},"\"Deploy a CMP\"",[614,1103,638],{"class":620},[614,1105,1107,1109,1111],{"class":616,"line":1106},49,[614,1108,916],{"class":627},[614,1110,631],{"class":620},[614,1112,1113],{"class":634},"\"Verify whether consent management is deployed outside GTM (check for CMP scripts in your page source). If consent is managed externally, no action needed in GTM. If no CMP exists and your site serves visitors in regions requiring consent, consider deploying one.\"\n",[614,1115,1117],{"class":616,"line":1116},50,[614,1118,927],{"class":620},[614,1120,1122],{"class":616,"line":1121},51,[614,1123,744],{"class":620},[614,1125,1127,1129,1131,1134],{"class":616,"line":1126},52,[614,1128,750],{"class":627},[614,1130,631],{"class":620},[614,1132,1133],{"class":634},"\"ga4-debug-mode-hardcoded\"",[614,1135,638],{"class":620},[614,1137,1139,1141,1143,1146,1149,1151,1153,1156],{"class":616,"line":1138},53,[614,1140,763],{"class":627},[614,1142,631],{"class":620},[614,1144,1145],{"class":634},"\"GA4 debug_mode hardcoded to ",[614,1147,1148],{"class":627},"\\\"",[614,1150,522],{"class":634},[614,1152,1148],{"class":627},[614,1154,1155],{"class":634},"\"",[614,1157,638],{"class":620},[614,1159,1161,1163,1165,1167],{"class":616,"line":1160},54,[614,1162,776],{"class":627},[614,1164,631],{"class":620},[614,1166,781],{"class":634},[614,1168,638],{"class":620},[614,1170,1172,1174,1176,1179],{"class":616,"line":1171},55,[614,1173,789],{"class":627},[614,1175,631],{"class":620},[614,1177,1178],{"class":634},"\"optimization\"",[614,1180,638],{"class":620},[614,1182,1184,1186,1188,1190],{"class":616,"line":1183},56,[614,1185,802],{"class":627},[614,1187,631],{"class":620},[614,1189,807],{"class":634},[614,1191,638],{"class":620},[614,1193,1195,1197,1199,1201],{"class":616,"line":1194},57,[614,1196,815],{"class":627},[614,1198,631],{"class":620},[614,1200,820],{"class":627},[614,1202,638],{"class":620},[614,1204,1206,1208],{"class":616,"line":1205},58,[614,1207,828],{"class":627},[614,1209,738],{"class":620},[614,1211,1213],{"class":616,"line":1212},59,[614,1214,836],{"class":620},[614,1216,1218,1220,1222,1225],{"class":616,"line":1217},60,[614,1219,842],{"class":627},[614,1221,631],{"class":620},[614,1223,1224],{"class":634},"\"9\"",[614,1226,638],{"class":620},[614,1228,1230,1232,1234],{"class":616,"line":1229},61,[614,1231,855],{"class":627},[614,1233,631],{"class":620},[614,1235,1236],{"class":634},"\"GA4 - Config\"\n",[614,1238,1240],{"class":616,"line":1239},62,[614,1241,879],{"class":620},[614,1243,1245],{"class":616,"line":1244},63,[614,1246,885],{"class":620},[614,1248,1250,1252,1254,1256],{"class":616,"line":1249},64,[614,1251,891],{"class":627},[614,1253,631],{"class":620},[614,1255,820],{"class":627},[614,1257,638],{"class":620},[614,1259,1261,1263,1265,1268],{"class":616,"line":1260},65,[614,1262,903],{"class":627},[614,1264,631],{"class":620},[614,1266,1267],{"class":634},"\"Fix debug_mode configuration\"",[614,1269,638],{"class":620},[614,1271,1273,1275,1277,1280,1282,1284,1286],{"class":616,"line":1272},66,[614,1274,916],{"class":627},[614,1276,631],{"class":620},[614,1278,1279],{"class":634},"\"Remove the debug_mode parameter, or replace the literal ",[614,1281,1148],{"class":627},[614,1283,522],{"class":634},[614,1285,1148],{"class":627},[614,1287,1288],{"class":634}," with a GTM variable that is only enabled in preview\u002Fdebug environments.\"\n",[614,1290,1292],{"class":616,"line":1291},67,[614,1293,1294],{"class":620},"    }\n",[614,1296,1298],{"class":616,"line":1297},68,[614,1299,1300],{"class":620},"  ],\n",[614,1302,1304,1307,1309,1312],{"class":616,"line":1303},69,[614,1305,1306],{"class":627},"  \"findings_total\"",[614,1308,631],{"class":620},[614,1310,1311],{"class":627},"3",[614,1313,638],{"class":620},[614,1315,1317,1320,1322,1324],{"class":616,"line":1316},70,[614,1318,1319],{"class":627},"  \"findings_truncated\"",[614,1321,631],{"class":620},[614,1323,303],{"class":627},[614,1325,638],{"class":620},[614,1327,1329,1332],{"class":616,"line":1328},71,[614,1330,1331],{"class":627},"  \"by_category\"",[614,1333,660],{"class":620},[614,1335,1337,1340,1342,1344],{"class":616,"line":1336},72,[614,1338,1339],{"class":627},"    \"ga4\"",[614,1341,631],{"class":620},[614,1343,1089],{"class":627},[614,1345,638],{"class":620},[614,1347,1349,1352,1354],{"class":616,"line":1348},73,[614,1350,1351],{"class":627},"    \"consent\"",[614,1353,631],{"class":620},[614,1355,1356],{"class":627},"1\n",[614,1358,1360],{"class":616,"line":1359},74,[614,1361,729],{"class":620},[614,1363,1365,1368],{"class":616,"line":1364},75,[614,1366,1367],{"class":627},"  \"by_tier\"",[614,1369,660],{"class":620},[614,1371,1373,1376,1378,1380],{"class":616,"line":1372},76,[614,1374,1375],{"class":627},"    \"warning\"",[614,1377,631],{"class":620},[614,1379,1089],{"class":627},[614,1381,638],{"class":620},[614,1383,1385,1388,1390],{"class":616,"line":1384},77,[614,1386,1387],{"class":627},"    \"optimization\"",[614,1389,631],{"class":620},[614,1391,1356],{"class":627},[614,1393,1395],{"class":616,"line":1394},78,[614,1396,729],{"class":620},[614,1398,1400,1403],{"class":616,"line":1399},79,[614,1401,1402],{"class":627},"  \"health_score\"",[614,1404,660],{"class":620},[614,1406,1408,1411,1413,1416],{"class":616,"line":1407},80,[614,1409,1410],{"class":627},"    \"score\"",[614,1412,631],{"class":620},[614,1414,1415],{"class":627},"87",[614,1417,638],{"class":620},[614,1419,1421,1424,1426,1429],{"class":616,"line":1420},81,[614,1422,1423],{"class":627},"    \"grade\"",[614,1425,631],{"class":620},[614,1427,1428],{"class":634},"\"B\"",[614,1430,638],{"class":620},[614,1432,1434,1437,1439,1442],{"class":616,"line":1433},82,[614,1435,1436],{"class":627},"    \"label\"",[614,1438,631],{"class":620},[614,1440,1441],{"class":634},"\"Healthy\"",[614,1443,638],{"class":620},[614,1445,1447,1450],{"class":616,"line":1446},83,[614,1448,1449],{"class":627},"    \"deductions\"",[614,1451,660],{"class":620},[614,1453,1455,1458,1460,1462],{"class":616,"line":1454},84,[614,1456,1457],{"class":627},"      \"error\"",[614,1459,631],{"class":620},[614,1461,273],{"class":627},[614,1463,638],{"class":620},[614,1465,1467,1470,1472,1475],{"class":616,"line":1466},85,[614,1468,1469],{"class":627},"      \"warning\"",[614,1471,631],{"class":620},[614,1473,1474],{"class":627},"8",[614,1476,638],{"class":620},[614,1478,1480,1483,1485,1488],{"class":616,"line":1479},86,[614,1481,1482],{"class":627},"      \"optimization\"",[614,1484,631],{"class":620},[614,1486,1487],{"class":627},"5",[614,1489,638],{"class":620},[614,1491,1493,1496,1498,1500],{"class":616,"line":1492},87,[614,1494,1495],{"class":627},"      \"info\"",[614,1497,631],{"class":620},[614,1499,273],{"class":627},[614,1501,638],{"class":620},[614,1503,1505,1508],{"class":616,"line":1504},88,[614,1506,1507],{"class":627},"      \"byCategory\"",[614,1509,660],{"class":620},[614,1511,1513,1516,1518,1520],{"class":616,"line":1512},89,[614,1514,1515],{"class":627},"        \"ga4\"",[614,1517,631],{"class":620},[614,1519,1089],{"class":627},[614,1521,638],{"class":620},[614,1523,1525,1528,1530],{"class":616,"line":1524},90,[614,1526,1527],{"class":627},"        \"consent\"",[614,1529,631],{"class":620},[614,1531,1356],{"class":627},[614,1533,1535],{"class":616,"line":1534},91,[614,1536,1537],{"class":620},"      }\n",[614,1539,1541],{"class":616,"line":1540},92,[614,1542,927],{"class":620},[614,1544,1546,1549],{"class":616,"line":1545},93,[614,1547,1548],{"class":627},"    \"caps\"",[614,1550,660],{"class":620},[614,1552,1554,1556,1558,1561],{"class":616,"line":1553},94,[614,1555,1457],{"class":627},[614,1557,631],{"class":620},[614,1559,1560],{"class":627},"35",[614,1562,638],{"class":620},[614,1564,1566,1568,1570,1573],{"class":616,"line":1565},95,[614,1567,1469],{"class":627},[614,1569,631],{"class":620},[614,1571,1572],{"class":627},"20",[614,1574,638],{"class":620},[614,1576,1578,1580,1582,1585],{"class":616,"line":1577},96,[614,1579,1482],{"class":627},[614,1581,631],{"class":620},[614,1583,1584],{"class":627},"25",[614,1586,638],{"class":620},[614,1588,1590,1592,1594],{"class":616,"line":1589},97,[614,1591,1495],{"class":627},[614,1593,631],{"class":620},[614,1595,1596],{"class":627},"0\n",[614,1598,1600],{"class":616,"line":1599},98,[614,1601,927],{"class":620},[614,1603,1605,1608,1610],{"class":616,"line":1604},99,[614,1606,1607],{"class":627},"    \"functionalIssueCount\"",[614,1609,631],{"class":620},[614,1611,1612],{"class":627},"3\n",[614,1614,1616],{"class":616,"line":1615},100,[614,1617,1618],{"class":620},"  }\n",[614,1620,1622],{"class":616,"line":1621},101,[614,1623,1624],{"class":620},"}\n",[73,1626,1628],{"id":1627},"response-headers","Response headers",[78,1630,1631,1639],{},[81,1632,1633],{},[84,1634,1635,1637],{},[87,1636,89],{},[87,1638,162],{},[97,1640,1641,1651,1661],{},[84,1642,1643,1648],{},[102,1644,1645],{},[27,1646,1647],{},"X-RateLimit-Limit",[102,1649,1650],{},"Daily call ceiling for this endpoint (200)",[84,1652,1653,1658],{},[102,1654,1655],{},[27,1656,1657],{},"X-RateLimit-Remaining",[102,1659,1660],{},"Calls remaining in the current bucket",[84,1662,1663,1668],{},[102,1664,1665],{},[27,1666,1667],{},"X-RateLimit-Reset",[102,1669,1670],{},"ISO timestamp when the bucket resets (UTC midnight)",[10,1672,1673,1674,125],{},"These headers are on every response to a request that was counted, including the 400 and 429 errors below. They are absent on 401, 403, 405, 503 and on a 413 for a declared oversize body. See ",[121,1675,1677],{"href":1676},"\u002Frate-limits\u002F","Rate limits",[68,1679,1681],{"id":1680},"errors","Errors",[78,1683,1684,1697],{},[81,1685,1686],{},[84,1687,1688,1691,1694],{},[87,1689,1690],{},"Status",[87,1692,1693],{},"Body",[87,1695,1696],{},"Cause",[97,1698,1699,1717,1733,1752,1777,1791,1807,1825,1839,1855,1879,1897,1915,1930,1947,1965],{},[84,1700,1701,1706,1711],{},[102,1702,1703],{},[27,1704,1705],{},"400",[102,1707,1708],{},[27,1709,1710],{},"{ \"error\": \"Missing required field: data (parsed container)\" }",[102,1712,1713,1714,1716],{},"The body has no ",[27,1715,171],{}," field, or the body is not valid JSON",[84,1718,1719,1723,1728],{},[102,1720,1721],{},[27,1722,1705],{},[102,1724,1725],{},[27,1726,1727],{},"{ \"error\": \"data must be a GTM container: a GTM JSON export or a parsed container object\" }",[102,1729,1730,1732],{},[27,1731,171],{}," is not an object",[84,1734,1735,1739,1744],{},[102,1736,1737],{},[27,1738,1705],{},[102,1740,1741],{},[27,1742,1743],{},"{ \"error\": \"data.containerVersion is not a GTM export: expected a container record with a publicId\" }",[102,1745,1746,1748,1749,1751],{},[27,1747,171],{}," has ",[27,1750,343],{}," but no container record with an ID",[84,1753,1754,1758,1763],{},[102,1755,1756],{},[27,1757,1705],{},[102,1759,1760],{},[27,1761,1762],{},"{ \"error\": \"data.containerVersion.tag must be an array of objects\" }",[102,1764,1765,200,1767,200,1769,225,1771,1773,1774,1776],{},[27,1766,370],{},[27,1768,373],{},[27,1770,376],{},[27,1772,379],{}," under ",[27,1775,343],{}," is not an array of objects. The message names the key.",[84,1778,1779,1783,1788],{},[102,1780,1781],{},[27,1782,1705],{},[102,1784,1785],{},[27,1786,1787],{},"{ \"error\": \"Could not parse GTM export: ...\" }",[102,1789,1790],{},"The export could not be parsed",[84,1792,1793,1797,1802],{},[102,1794,1795],{},[27,1796,1705],{},[102,1798,1799],{},[27,1800,1801],{},"{ \"error\": \"data is not a GTM container: expected a GTM JSON export (with containerVersion) or a parsed container (with tags, triggers and variables arrays of objects)\" }",[102,1803,1804,1806],{},[27,1805,171],{}," is an object but is neither accepted form",[84,1808,1809,1813,1818],{},[102,1810,1811],{},[27,1812,1705],{},[102,1814,1815],{},[27,1816,1817],{},"{ \"error\": \"Unknown category \\\"privacy\\\". Category must be one of: ...\" }",[102,1819,1820,225,1822,1824],{},[27,1821,187],{},[27,1823,235],{}," is not a real value. The message lists the accepted ones. An empty string is refused too: leave the field out.",[84,1826,1827,1831,1836],{},[102,1828,1829],{},[27,1830,1705],{},[102,1832,1833],{},[27,1834,1835],{},"{ \"error\": \"Unknown field: \\\"categories\\\" (did you mean \\\"category\\\"?). Accepted: ...\" }",[102,1837,1838],{},"The body has a field this endpoint does not take. It is refused so that a misspelt filter is never silently ignored.",[84,1840,1841,1845,1850],{},[102,1842,1843],{},[27,1844,1705],{},[102,1846,1847],{},[27,1848,1849],{},"{ \"error\": \"top_n must be a number of 0 or more (got -5).\" }",[102,1851,1852,1854],{},[27,1853,262],{}," is negative or not a number. A number sent as text is accepted; a fraction is rounded down.",[84,1856,1857,1861,1866],{},[102,1858,1859],{},[27,1860,1705],{},[102,1862,1863],{},[27,1864,1865],{},"{ \"error\": \"include_evidence must be true or false (got ...).\" }",[102,1867,1868,1870,1871,308,1873,1875,1876,1878],{},[27,1869,285],{}," is not a boolean (the text ",[27,1872,307],{},[27,1874,311],{}," are accepted, and ",[27,1877,479],{}," is treated as left out).",[84,1880,1881,1886,1891],{},[102,1882,1883],{},[27,1884,1885],{},"401",[102,1887,1888],{},[27,1889,1890],{},"{ \"error\": \"Invalid or expired token\" }",[102,1892,1893,1894,125],{},"Missing, malformed, expired or revoked bearer token. An API key failure reads ",[27,1895,1896],{},"Invalid or revoked API key",[84,1898,1899,1904,1909],{},[102,1900,1901],{},[27,1902,1903],{},"403",[102,1905,1906],{},[27,1907,1908],{},"{ \"error\": \"insufficient_scope\", \"message\": \"This token was not granted 'mcp:tools', which this endpoint requires.\" }",[102,1910,1911,1912,1914],{},"An MCP access token without the ",[27,1913,118],{}," scope. Not counted against the rate limit.",[84,1916,1917,1922,1927],{},[102,1918,1919],{},[27,1920,1921],{},"413",[102,1923,1924],{},[27,1925,1926],{},"{ \"error\": \"payload_too_large\", \"message\": \"Request body too large. The limit is 10 MB.\" }",[102,1928,1929],{},"Request body over 10 MB",[84,1931,1932,1937,1942],{},[102,1933,1934],{},[27,1935,1936],{},"429",[102,1938,1939],{},[27,1940,1941],{},"{ \"error\": \"rate_limit_exceeded\", \"message\": \"Daily limit reached for scan_container (201\u002F200)\", \"tool\": \"scan_container\", \"limit\": 200, \"count\": 201, \"reset_at\": \"...\" }",[102,1943,1944,1945],{},"Daily bucket exhausted; retry after ",[27,1946,1667],{},[84,1948,1949,1954,1959],{},[102,1950,1951],{},[27,1952,1953],{},"503",[102,1955,1956],{},[27,1957,1958],{},"{ \"error\": \"rate_limiter_unavailable\", \"message\": \"...\" }",[102,1960,1961,1962,125],{},"The rate limiter could not be reached, so the scan was not run. The response has ",[27,1963,1964],{},"Retry-After: 30",[84,1966,1967,1972,1977],{},[102,1968,1969],{},[27,1970,1971],{},"500",[102,1973,1974],{},[27,1975,1976],{},"{ \"error\": \"...\" }",[102,1978,1979],{},"Internal failure; retry once before reporting",[68,1981,1983],{"id":1982},"try-saying","Try saying",[10,1985,1986],{},"Useful when wiring this endpoint to an agent that will call it programmatically.",[10,1988,1989],{},"Tell the agent something like:",[605,1991,1996],{"className":1992,"code":1994,"language":1995},[1993],"language-text","You have access to TagManifest's REST API at https:\u002F\u002Fdeveloper.tagmanifest.com\u002Fv1.\nUse POST \u002Fscan to audit a GTM container export.\nPass the export JSON, unchanged, as the \"data\" field in the request body.\nAuthentication: include header \"Authorization: Bearer \u003Capi-key>\".\n","text",[27,1997,1994],{"__ignoreMap":610},[10,1999,2000],{},"Or, when the agent has direct HTTP capability:",[17,2002,2003,2006],{},[20,2004,2005],{},"\"Audit this GTM export using TagManifest's scan endpoint and return any consent findings\"",[20,2007,2008],{},"\"Run a TagManifest audit on the container export I just downloaded and show only warning-tier findings\"",[68,2010,2012],{"id":2011},"see-also","See also",[17,2014,2015,2024,2029],{},[20,2016,2017,2023],{},[121,2018,2020,2021],{"href":2019},"\u002Fmcp\u002Ftools\u002Fscan-container\u002F","MCP equivalent: ",[27,2022,42],{}," — same audit, MCP path",[20,2025,2026,2028],{},[121,2027,449],{"href":448}," — use this instead when you only have a URL or GTM ID",[20,2030,2031,2035],{},[121,2032,2034],{"href":2033},"\u002Fapi\u002Fevaluate-rule\u002F","POST \u002Fevaluate-rule"," — run a single rule and get full evidence",[2037,2038,2039],"style",{},"html pre.shiki code .sVt8B, html code.shiki .sVt8B{--shiki-default:#24292E;--shiki-dark:#E1E4E8}html pre.shiki code .sj4cs, html code.shiki .sj4cs{--shiki-default:#005CC5;--shiki-dark:#79B8FF}html pre.shiki code .sZZnC, html code.shiki .sZZnC{--shiki-default:#032F62;--shiki-dark:#9ECBFF}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}html.dark .shiki span {color: var(--shiki-dark);background: var(--shiki-dark-bg);font-style: var(--shiki-dark-font-style);font-weight: var(--shiki-dark-font-weight);text-decoration: var(--shiki-dark-text-decoration);}",{"title":610,"searchDepth":624,"depth":624,"links":2041},[2042,2048,2051,2052,2053],{"id":70,"depth":624,"text":71,"children":2043},[2044,2045,2046],{"id":75,"depth":641,"text":76},{"id":144,"depth":641,"text":145},{"id":318,"depth":641,"text":2047},"What data accepts",{"id":441,"depth":624,"text":442,"children":2049},[2050],{"id":1627,"depth":641,"text":1628},{"id":1680,"depth":624,"text":1681},{"id":1982,"depth":624,"text":1983},{"id":2011,"depth":624,"text":2012},[2055,2058,2060],{"label":2056,"href":2057},"API Reference","\u002F",{"label":2059},"REST endpoints",{"label":5},{"cards":2062,"onpage":2082},[2063,2077],{"title":71,"tabs":2064},[2065,2069,2073],{"label":2066,"language":2067,"code":2068},"cURL","bash","# container-export.json is the file from\n# GTM → Admin → Export container, unchanged.\ncurl https:\u002F\u002Fdeveloper.tagmanifest.com\u002Fv1\u002Fscan \\\n  -H \"Authorization: Bearer $TM_API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d \"{\\\"data\\\": $(cat container-export.json), \\\"top_n\\\": 25}\"\n",{"label":2070,"language":2071,"code":2072},"Node","javascript","import { readFile } from \"node:fs\u002Fpromises\";\n\n\u002F\u002F The GTM export file, unchanged.\nconst containerJson = JSON.parse(\n  await readFile(\"container-export.json\", \"utf8\")\n);\n\nconst r = await fetch(\"https:\u002F\u002Fdeveloper.tagmanifest.com\u002Fv1\u002Fscan\", {\n  method: \"POST\",\n  headers: {\n    Authorization: `Bearer ${process.env.TM_API_KEY}`,\n    \"Content-Type\": \"application\u002Fjson\"\n  },\n  body: JSON.stringify({\n    data: containerJson,\n    top_n: 25\n  })\n});\nconst result = await r.json();\n",{"label":2074,"language":2075,"code":2076},"Python","python","import httpx, json, os\n\n# The GTM export file, unchanged.\nwith open(\"container-export.json\") as f:\n    container_json = json.load(f)\n\nr = httpx.post(\n    \"https:\u002F\u002Fdeveloper.tagmanifest.com\u002Fv1\u002Fscan\",\n    headers={\"Authorization\": f\"Bearer {os.environ['TM_API_KEY']}\"},\n    json={\"data\": container_json, \"top_n\": 25},\n)\nresult = r.json()\n",{"title":2078,"variant":441,"tabs":2079},"200 — scan",[2080],{"label":2081,"language":609,"code":608},"JSON",[2083,2084,2085,2086],{"id":70,"label":71},{"id":441,"label":442},{"id":1680,"label":1681},{"id":1982,"label":1983},null,"Audit a GTM container you send as JSON, either the export file from GTM or an already parsed container. Returns findings most important first (by tier, then severity) plus a health score.","md",{},true,{"href":2033,"title":2034},"\u002Fapi\u002Fscan",{"href":448,"title":449},"APIReference",{"title":5,"description":2088},"api\u002Fscan",false,"YIfFUtwriv9a-jFgKThUmD6DLrPvqHRHQqgvXcJfI9c",1796069482848]