{"openapi":"3.1.0","info":{"title":"DGTL Sunrise Connector API","version":"0.1.0","summary":"Free Google GA4, Search Console, and Tag Manager reads for Muse, plus confirm-gated GA4 and GTM writes. A grant missing the scope a route needs must reconnect.","description":"HTTPS API for the DGTL Sunrise Muse connector. Open /connect to get a Bearer token. /connect requests openid, https://www.googleapis.com/auth/userinfo.email, https://www.googleapis.com/auth/analytics.readonly, https://www.googleapis.com/auth/webmasters.readonly, https://www.googleapis.com/auth/tagmanager.readonly, https://www.googleapis.com/auth/analytics.edit, https://www.googleapis.com/auth/tagmanager.edit.containers, https://www.googleapis.com/auth/tagmanager.edit.containerversions, https://www.googleapis.com/auth/tagmanager.publish, https://www.googleapis.com/auth/webmasters. It does not request https://www.googleapis.com/auth/adwords, https://www.googleapis.com/auth/content, https://www.googleapis.com/auth/business.manage. GA4 reads need https://www.googleapis.com/auth/analytics.readonly. Search Console reads need https://www.googleapis.com/auth/webmasters.readonly. Tag Manager reads need https://www.googleapis.com/auth/tagmanager.readonly. A linked grant missing that scope returns google_reconnect_required and does not call Google. An older grant that only has analytics.readonly can still read GA4. GA4 custom dimension create requires https://www.googleapis.com/auth/analytics.edit. GTM variable create requires https://www.googleapis.com/auth/tagmanager.edit.containers. A missing manage scope returns google_reconnect_required and does not mutate. POST /v1/writes/confirm creates one GA4 custom dimension or one GTM workspace variable. It does not publish a container or submit a sitemap. Privacy policy: https://www.dgtlsunrise.com/privacy","termsOfService":"https://www.dgtlsunrise.com/terms","contact":{"name":"DGTL Sunrise","email":"support@dgtlsunrise.com","url":"https://www.dgtlsunrise.com"},"license":{"name":"Apache-2.0","url":"https://www.apache.org/licenses/LICENSE-2.0"}},"externalDocs":{"description":"Privacy policy","url":"https://www.dgtlsunrise.com/privacy"},"servers":[{"url":"https://muse-api.dgtlsunrise.com"}],"tags":[{"name":"ga4","description":"Free Google Analytics 4 reads. Requires https://www.googleapis.com/auth/analytics.readonly. Does not mutate."},{"name":"gsc","description":"Free Google Search Console reads. Requires https://www.googleapis.com/auth/webmasters.readonly. Does not submit or delete sitemaps."},{"name":"gtm","description":"Free Google Tag Manager reads. Requires https://www.googleapis.com/auth/tagmanager.readonly. Workspace lists are drafts. versions/live is the published container and does not publish."},{"name":"writes","description":"Confirm-gated writes. Kinds: ga4_custom_dimension_create and gtm_variable_create. Preview stores a one-shot proposal and does not mutate. Confirm posts to Google only when confirm_phrase contains every resource id. GA4 manage requires https://www.googleapis.com/auth/analytics.edit. GTM variable create requires https://www.googleapis.com/auth/tagmanager.edit.containers. A grant missing that scope returns google_reconnect_required and does not store or delete a preview."}],"paths":{"/healthz":{"get":{"operationId":"healthz","summary":"Liveness","security":[],"responses":{"200":{"description":"Process is up.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Health"}}}}}}},"/openapi.json":{"get":{"operationId":"getOpenApi","summary":"OpenAPI document","security":[],"responses":{"200":{"description":"This OpenAPI document.","content":{"application/json":{"schema":{"type":"object","additionalProperties":true}}}}}}},"/v1/ga4/properties/{property_id}/sessions":{"get":{"operationId":"getGa4SessionsReport","tags":["ga4"],"summary":"Read GA4 sessions for a property","description":"Free Google read of the sessions metric for one GA4 property and date range.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/propertyId"},{"name":"start_date","in":"query","required":false,"description":"YYYY-MM-DD, or a GA4 relative date. Defaults to 28daysAgo.","schema":{"type":"string","default":"28daysAgo"}},{"name":"end_date","in":"query","required":false,"description":"YYYY-MM-DD, or a GA4 relative date. Defaults to yesterday.","schema":{"type":"string","default":"yesterday"}}],"responses":{"200":{"description":"Sessions for the property and date range.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4SessionsReport"}}}},"400":{"description":"property_id is not digits.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidPropertyId"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, is missing https://www.googleapis.com/auth/analytics.readonly, or Google refused the read. A missing scope does not call Google.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Ga4SessionsError"},{"$ref":"#/components/schemas/GoogleReconnectRequired"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Data API report call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4Unavailable"}}}}}}},"/v1/ga4/accounts":{"get":{"operationId":"listGa4Accounts","tags":["ga4"],"summary":"List GA4 accounts","description":"Tip tool ga4_list_accounts. Analytics Admin accounts.list. Requires https://www.googleapis.com/auth/analytics.readonly. page_token is Google's nextPageToken. Does not pick an account.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Accounts visible to the linked Google user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4AccountList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/analytics.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/Ga4Forbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4Unavailable"}}}}}}},"/v1/ga4/account-summaries":{"get":{"operationId":"listGa4AccountSummaries","tags":["ga4"],"summary":"List GA4 account summaries","description":"Tip tool ga4_list_account_summaries. Analytics Admin accountSummaries.list, including nested property summaries. Requires https://www.googleapis.com/auth/analytics.readonly. Does not pick a property.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Account summaries for the linked Google user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4AccountSummaryList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/analytics.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/Ga4Forbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4Unavailable"}}}}}}},"/v1/ga4/accounts/{account_id}/properties":{"get":{"operationId":"listGa4Properties","tags":["ga4"],"summary":"List GA4 properties","description":"Tip tool ga4_list_properties. Analytics Admin properties.list filtered to parent:accounts/{account_id}. Requires https://www.googleapis.com/auth/analytics.readonly. The path is the numeric id; tip also accepts an accounts/{id} prefix.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/accountId"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Properties under the account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4PropertyList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/analytics.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/Ga4Forbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4Unavailable"}}}}}}},"/v1/ga4/properties/{property_id}":{"get":{"operationId":"getGa4Property","tags":["ga4"],"summary":"Read a GA4 property","description":"Tip tool ga4_get_property. Analytics Admin properties.get. Requires https://www.googleapis.com/auth/analytics.readonly. resource is the Admin property (displayName, timeZone, currencyCode, and the other fields Google returns).","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/propertyId"}],"responses":{"200":{"description":"The Admin property resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4PropertyRead"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/analytics.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/Ga4Forbidden"}]}}}},"404":{"description":"Google has no resource at this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4Unavailable"}}}}}}},"/v1/ga4/properties/{property_id}/data-streams":{"get":{"operationId":"listGa4DataStreams","tags":["ga4"],"summary":"List GA4 data streams","description":"Tip tool ga4_list_data_streams. Analytics Admin properties.dataStreams.list. Requires https://www.googleapis.com/auth/analytics.readonly.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/propertyId"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Data streams on the property.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4DataStreamList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/analytics.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/Ga4Forbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4Unavailable"}}}}}}},"/v1/ga4/properties/{property_id}/key-events":{"get":{"operationId":"listGa4KeyEvents","tags":["ga4"],"summary":"List GA4 key events","description":"Tip tool ga4_list_key_events. Analytics Admin properties.keyEvents.list. Requires https://www.googleapis.com/auth/analytics.readonly.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/propertyId"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Key events on the property.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4KeyEventList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/analytics.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/Ga4Forbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4Unavailable"}}}}}}},"/v1/ga4/properties/{property_id}/metadata":{"get":{"operationId":"getGa4Metadata","tags":["ga4"],"summary":"Read GA4 metadata","description":"Tip tool ga4_get_metadata. GA4 Data API properties.getMetadata. Requires https://www.googleapis.com/auth/analytics.readonly. Optional query, kind, and custom_only filter the catalog. This Worker does not cache metadata. Cite apiName values from the response.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/propertyId"},{"name":"query","in":"query","required":false,"description":"Case-insensitive substring of apiName, uiName, or description.","schema":{"type":"string","minLength":1,"maxLength":120}},{"name":"kind","in":"query","required":false,"schema":{"type":"string","enum":["dimension","metric","all"],"default":"all"}},{"name":"custom_only","in":"query","required":false,"schema":{"type":"string","enum":["true","false"]}}],"responses":{"200":{"description":"Dimensions and metrics for the property.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4Metadata"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/analytics.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/Ga4Forbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4Unavailable"}}}}}}},"/v1/ga4/properties/{property_id}/reports":{"post":{"operationId":"runGa4Report","tags":["ga4"],"summary":"Run a GA4 report","description":"Tip tool ga4_run_report, subset. GA4 Data API properties.runReport. Requires https://www.googleapis.com/auth/analytics.readonly. date_ranges is 1 or 2 ranges. metrics and key_event_names together must name 1–10 metrics. dimensions max 9. limit max 1000. Search-query names (query, searchQuery, searchTerm, keyword) and gclid names are rejected locally and are not sent to Google. This path does not accept recipe, dimension_filter, metric_filter, or order_bys. It does not query Search Console. The response is the Data API JSON plus property_id and cited.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4ReportRequest"}}}},"responses":{"200":{"description":"Data API runReport payload plus cited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4Report"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReportRejected"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/analytics.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/Ga4Forbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Ga4Unavailable"}}}}}}},"/v1/gsc/schema":{"get":{"operationId":"describeGscSchema","tags":["gsc"],"summary":"Describe the Search Console schema","description":"Tip tool gsc_describe_schema. Local dimension and metric catalog. No Google call. Requires https://www.googleapis.com/auth/webmasters.readonly so a grant without Search Console is not shown an empty success. Use these api_name values in POST /v1/gsc/search-analytics.","security":[{"bearerAuth":[]}],"parameters":[],"responses":{"200":{"description":"Local catalog. Google was not called.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscSchema"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/webmasters.readonly. This route does not call Google. Reopen /connect and reconnect.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"}]}}}}}}},"/v1/gsc/sites":{"get":{"operationId":"listGscSites","tags":["gsc"],"summary":"List Search Console sites","description":"Tip tool gsc_list_sites. Search Console sites.list. Requires https://www.googleapis.com/auth/webmasters.readonly. Copy siteUrl exactly. page_token is a numeric offset into that list, not a Google page token.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Sites for the linked Google user.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscSiteList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/webmasters.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GscForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscUnavailable"}}}}}}},"/v1/gsc/site":{"get":{"operationId":"getGscSite","tags":["gsc"],"summary":"Read a Search Console site","description":"Tip tool gsc_get_site. Search Console sites.get. Requires https://www.googleapis.com/auth/webmasters.readonly. site_url is a query parameter because the property string contains slashes or a sc-domain: prefix.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/siteUrl"}],"responses":{"200":{"description":"The site resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscSite"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/webmasters.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GscForbidden"}]}}}},"404":{"description":"Google has no resource at this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscUnavailable"}}}}}}},"/v1/gsc/search-analytics":{"post":{"operationId":"queryGscSearchAnalytics","tags":["gsc"],"summary":"Query Search Console analytics","description":"Tip tool gsc_query_search_analytics. Search Console searchAnalytics.query. Requires https://www.googleapis.com/auth/webmasters.readonly. This is the route for search queries. data_state defaults to final. Dimensions are the closed set from GET /v1/gsc/schema.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscSearchAnalyticsRequest"}}}},"responses":{"200":{"description":"Search Analytics rows plus cited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscSearchAnalytics"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscRejected"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/webmasters.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GscForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscUnavailable"}}}}}}},"/v1/gsc/url-inspection":{"post":{"operationId":"inspectGscUrl","tags":["gsc"],"summary":"Inspect a URL","description":"Tip tool gsc_inspect_url. Search Console URL Inspection index.inspect. Requires https://www.googleapis.com/auth/webmasters.readonly. There is no request-indexing route.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscUrlInspectionRequest"}}}},"responses":{"200":{"description":"URL Inspection result plus cited.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscUrlInspection"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscRejected"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/webmasters.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GscForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscUnavailable"}}}}}}},"/v1/gsc/sitemaps":{"get":{"operationId":"listGscSitemaps","tags":["gsc"],"summary":"List sitemaps","description":"Tip tool gsc_list_sitemaps. Search Console sitemaps.list. Requires https://www.googleapis.com/auth/webmasters.readonly. page_token is a numeric offset.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/siteUrl"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"},{"$ref":"#/components/parameters/sitemapIndex"}],"responses":{"200":{"description":"Sitemaps for the site.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscSitemapList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/webmasters.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GscForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscUnavailable"}}}}}}},"/v1/gsc/sitemap":{"get":{"operationId":"getGscSitemap","tags":["gsc"],"summary":"Read a sitemap","description":"Tip tool gsc_get_sitemap. Search Console sitemaps.get. Requires https://www.googleapis.com/auth/webmasters.readonly. feedpath is the sitemap path or URL from the list route, passed as a query parameter.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/siteUrl"},{"$ref":"#/components/parameters/feedpath"}],"responses":{"200":{"description":"The sitemap resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscSitemap"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/webmasters.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GscForbidden"}]}}}},"404":{"description":"Google has no resource at this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GscUnavailable"}}}}}}},"/v1/gtm/accounts":{"get":{"operationId":"listGtmAccounts","tags":["gtm"],"summary":"List Tag Manager accounts","description":"Tip tool gtm_list_accounts. Tag Manager accounts.list. Requires https://www.googleapis.com/auth/tagmanager.readonly. page_token is a numeric offset. A Google 403 can mean the Tag Manager API is not enabled.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Tag Manager accounts.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmAccountList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/tagmanager.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmUnavailable"}}}}}}},"/v1/gtm/accounts/{account_id}/containers":{"get":{"operationId":"listGtmContainers","tags":["gtm"],"summary":"List Tag Manager containers","description":"Tip tool gtm_list_containers. Tag Manager accounts.containers.list. Requires https://www.googleapis.com/auth/tagmanager.readonly. publicId (GTM-XXXX) is a field on each container, not the path id.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/accountId"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Containers in the account.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmContainerList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/tagmanager.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmUnavailable"}}}}}}},"/v1/gtm/accounts/{account_id}/containers/{container_id}":{"get":{"operationId":"getGtmContainer","tags":["gtm"],"summary":"Read a Tag Manager container","description":"Tip tool gtm_get_container. Tag Manager accounts.containers.get. Requires https://www.googleapis.com/auth/tagmanager.readonly.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/accountId"},{"$ref":"#/components/parameters/containerId"}],"responses":{"200":{"description":"The container resource.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmContainer"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/tagmanager.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"404":{"description":"Google has no resource at this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmUnavailable"}}}}}}},"/v1/gtm/accounts/{account_id}/containers/{container_id}/workspaces":{"get":{"operationId":"listGtmWorkspaces","tags":["gtm"],"summary":"List Tag Manager workspaces","description":"Tip tool gtm_list_workspaces. Tag Manager workspaces.list. Requires https://www.googleapis.com/auth/tagmanager.readonly. If more than one workspace is returned, do not assume a default. Drafts are not the live container.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/accountId"},{"$ref":"#/components/parameters/containerId"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Workspaces in the container.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmWorkspaceList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/tagmanager.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmUnavailable"}}}}}}},"/v1/gtm/accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/tags":{"get":{"operationId":"listGtmTags","tags":["gtm"],"summary":"List workspace tags","description":"Tip tool gtm_list_tags. Workspace tags.list. Requires https://www.googleapis.com/auth/tagmanager.readonly. source=workspace means drafts, not the published container.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/accountId"},{"$ref":"#/components/parameters/containerId"},{"$ref":"#/components/parameters/workspaceId"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Draft tags in the workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmTagList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/tagmanager.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmUnavailable"}}}}}}},"/v1/gtm/accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/triggers":{"get":{"operationId":"listGtmTriggers","tags":["gtm"],"summary":"List workspace triggers","description":"Tip tool gtm_list_triggers. Workspace triggers.list. Requires https://www.googleapis.com/auth/tagmanager.readonly. source=workspace means drafts.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/accountId"},{"$ref":"#/components/parameters/containerId"},{"$ref":"#/components/parameters/workspaceId"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Draft triggers in the workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmTriggerList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/tagmanager.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmUnavailable"}}}}}}},"/v1/gtm/accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/variables":{"get":{"operationId":"listGtmVariables","tags":["gtm"],"summary":"List workspace variables","description":"Tip tool gtm_list_variables. Workspace variables.list. Requires https://www.googleapis.com/auth/tagmanager.readonly. source=workspace means drafts.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/accountId"},{"$ref":"#/components/parameters/containerId"},{"$ref":"#/components/parameters/workspaceId"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Draft variables in the workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmVariableList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/tagmanager.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmUnavailable"}}}}}}},"/v1/gtm/accounts/{account_id}/containers/{container_id}/versions/live":{"get":{"operationId":"getGtmLiveContainerVersion","tags":["gtm"],"summary":"Read the live container version","description":"Tip tool gtm_get_live_container_version. Tag Manager versions.live (the Google path is versions:live). Requires https://www.googleapis.com/auth/tagmanager.readonly. This is the published container. This route does not publish.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/accountId"},{"$ref":"#/components/parameters/containerId"}],"responses":{"200":{"description":"The published container version.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmLiveVersion"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/tagmanager.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"404":{"description":"Google has no resource at this id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmUnavailable"}}}}}}},"/v1/gtm/accounts/{account_id}/containers/{container_id}/workspaces/{workspace_id}/clients":{"get":{"operationId":"listGtmClients","tags":["gtm"],"summary":"List workspace clients","description":"Tip tool gtm_list_clients. Workspace clients.list. Requires https://www.googleapis.com/auth/tagmanager.readonly. Server containers expose clients; web containers are often empty. This is not stamp ingest.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/accountId"},{"$ref":"#/components/parameters/containerId"},{"$ref":"#/components/parameters/workspaceId"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Draft clients in the workspace.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmClientList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/tagmanager.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmUnavailable"}}}}}}},"/v1/gtm/accounts/{account_id}/containers/{container_id}/environments":{"get":{"operationId":"listGtmEnvironments","tags":["gtm"],"summary":"List container environments","description":"Tip tool gtm_list_environments. Tag Manager environments.list. Requires https://www.googleapis.com/auth/tagmanager.readonly. Environments are container-level, not workspace-level.","security":[{"bearerAuth":[]}],"parameters":[{"$ref":"#/components/parameters/accountId"},{"$ref":"#/components/parameters/containerId"},{"$ref":"#/components/parameters/pageSize"},{"$ref":"#/components/parameters/pageToken"}],"responses":{"200":{"description":"Environments on the container.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmEnvironmentList"}}}},"400":{"description":"The path, query, or body is not valid for this route.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InvalidRequest"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing https://www.googleapis.com/auth/tagmanager.readonly. A missing scope does not call Google. Reopen /connect and reconnect. Google can also refuse the read.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"500":{"description":"The stored refresh token could not be opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the Google API call failed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmUnavailable"}}}}}}},"/v1/writes/preview":{"post":{"operationId":"previewWrite","tags":["writes"],"summary":"Preview a confirm-gated write","description":"Stores a one-shot preview for ga4_custom_dimension_create or gtm_variable_create. GA4 preview does not call Google. GTM preview GETs the container to resolve publicId and does not create a variable. A grant missing the manage scope for that kind is refused and nothing is stored. The caller then posts a confirm_phrase that contains every resource id to /v1/writes/confirm. GA4 resource id is properties/{property_id}. GTM resource id is the container publicId.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WritePreviewRequest"}}}},"responses":{"200":{"description":"Preview only. No mutate has run.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WritePreview"}}}},"400":{"description":"The kind is unknown, or the preview body does not match that kind.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WritePreviewError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The grant has no Google link, or it is missing the manage scope for this kind (analytics.edit or tagmanager.edit.containers). A missing manage scope does not store a preview. Reopen /connect and reconnect Google.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"404":{"description":"Tag Manager has no container at the given account and container id. Nothing is stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"The stored refresh token could not be opened while resolving a GTM container. Nothing is stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the container lookup did not return a GTM publicId. Nothing is stored.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GtmUnavailable"}}}}}}},"/v1/writes/confirm":{"post":{"operationId":"confirmWrite","tags":["writes"],"summary":"Confirm a previewed write","description":"Posts the previewed mutate when the grant still has the manage scope for that kind and confirm_phrase contains every resource id. GA4 posts customDimensions on the Analytics Admin API. GTM posts a workspace variable on the Tag Manager API. A missing manage scope or a refused phrase leaves the preview in place and does not mutate. A Google error also leaves the preview in place. On success the preview is deleted, executed is true, and resource_name is the Google resource.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteConfirmRequest"}}}},"responses":{"200":{"description":"Google accepted the mutate. executed is true. resource_name is the GA4 custom dimension name or the GTM variable path.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteConfirmResult"}}}},"400":{"description":"The preview is missing, expired, or already used, the body is invalid, or confirm_phrase does not include every resource id.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/WriteConfirmError"}}}},"401":{"$ref":"#/components/responses/Unauthorized"},"403":{"description":"The preview belongs to a different grant, the grant has no Google link, the grant is missing the manage scope, or Google refused the mutate. A missing manage scope or a Google refusal does not delete the preview. Reopen /connect when the error is google_reconnect_required.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/PreviewForbidden"},{"$ref":"#/components/schemas/GoogleNotLinked"},{"$ref":"#/components/schemas/GoogleReconnectRequired"},{"$ref":"#/components/schemas/Ga4Forbidden"},{"$ref":"#/components/schemas/GtmForbidden"}]}}}},"404":{"description":"Google has no resource at the previewed id. The preview stays in place.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotFound"}}}},"500":{"description":"The stored refresh token could not be opened. The preview stays in place.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/GrantUnreadable"}}}},"502":{"description":"Refreshing the Google access token failed, or the mutate response had no resource name. The preview stays in place.","content":{"application/json":{"schema":{"oneOf":[{"$ref":"#/components/schemas/Ga4Unavailable"},{"$ref":"#/components/schemas/GtmUnavailable"}]}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","bearerFormat":"dgtl_muse token"}},"responses":{"Unauthorized":{"description":"Missing, malformed, unknown, or revoked bearer token.","headers":{"WWW-Authenticate":{"schema":{"type":"string","const":"Bearer"}}},"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"parameters":{"accountId":{"name":"account_id","in":"path","required":true,"description":"Numeric account id. Tip tools also accept an accounts/{id} prefix; this path uses the digits only.","schema":{"type":"string","pattern":"^[0-9]{1,20}$"}},"containerId":{"name":"container_id","in":"path","required":true,"description":"Numeric Tag Manager container id. GTM-XXXX is publicId on the container, not this id.","schema":{"type":"string","pattern":"^[0-9]{1,20}$"}},"workspaceId":{"name":"workspace_id","in":"path","required":true,"description":"Numeric Tag Manager workspace id.","schema":{"type":"string","pattern":"^[0-9]{1,20}$"}},"pageSize":{"name":"page_size","in":"query","required":false,"description":"Page size from 1 to 200. Defaults to 50.","schema":{"type":"integer","minimum":1,"maximum":200,"default":50}},"pageToken":{"name":"page_token","in":"query","required":false,"description":"GA4 Admin lists: the next_page_token from the previous response (Google nextPageToken). Search Console and Tag Manager lists: a numeric offset into the full Google list.","schema":{"type":"string"}},"siteUrl":{"name":"site_url","in":"query","required":true,"description":"Exact Search Console siteUrl. URL-prefix properties include the trailing slash. sc-domain:example.com is a different property from https://example.com/.","schema":{"type":"string","minLength":1,"maxLength":2048}},"feedpath":{"name":"feedpath","in":"query","required":true,"description":"Sitemap path or URL copied from the list route.","schema":{"type":"string","minLength":1,"maxLength":2048}},"sitemapIndex":{"name":"sitemap_index","in":"query","required":false,"description":"Optional sitemap index URL passed to Search Console as sitemapIndex.","schema":{"type":"string","minLength":1,"maxLength":2048}},"propertyId":{"name":"property_id","in":"path","required":true,"description":"GA4 property id, digits only.","schema":{"type":"string","pattern":"^[0-9]+$"}}},"schemas":{"InvalidRequest":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","enum":["invalid_request"]},"message":{"type":"string"}}},"ReportRejected":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","enum":["invalid_request","unsupported_dimension","unsupported_field"]},"message":{"type":"string"}}},"GscRejected":{"type":"object","required":["error","message"],"properties":{"error":{"type":"string","enum":["invalid_request","unsupported_field"]},"message":{"type":"string"}}},"NotFound":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["not_found"]}}},"GrantUnreadable":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["grant_unreadable"]}}},"Ga4Forbidden":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["ga4_forbidden"]}}},"GscForbidden":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["gsc_forbidden"]}}},"GtmForbidden":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["gtm_forbidden"]}}},"Ga4Unavailable":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["ga4_unavailable","google_token_failed"]}}},"GscUnavailable":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["gsc_unavailable","google_token_failed"]}}},"GtmUnavailable":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["gtm_unavailable","google_token_failed"]}}},"Ga4AccountList":{"type":"object","description":"Analytics Admin account resources.","required":["accounts"],"properties":{"accounts":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"Ga4AccountSummaryList":{"type":"object","description":"Analytics Admin account summary resources.","required":["account_summaries"],"properties":{"account_summaries":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"Ga4PropertyList":{"type":"object","description":"Analytics Admin property resources for one account.","required":["properties"],"properties":{"properties":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"Ga4PropertyRead":{"type":"object","required":["property_id","resource"],"properties":{"property_id":{"type":"string"},"resource":{"type":"object","description":"Analytics Admin Property resource. displayName, timeZone, and currencyCode use Google's camelCase.","additionalProperties":true}}},"Ga4DataStreamList":{"type":"object","description":"Analytics Admin data stream resources.","required":["data_streams"],"properties":{"data_streams":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"Ga4KeyEventList":{"type":"object","description":"Analytics Admin key event resources.","required":["key_events"],"properties":{"key_events":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"Ga4Metadata":{"type":"object","required":["property_id","name","kind","query","custom_only","dimension_count","metric_count","dimensions","metrics"],"properties":{"property_id":{"type":"string"},"name":{"type":"string"},"kind":{"type":"string","enum":["dimension","metric","all"]},"query":{"type":["string","null"]},"custom_only":{"type":"boolean"},"dimension_count":{"type":"integer"},"metric_count":{"type":"integer"},"dimensions":{"type":"array","items":{"type":"object","additionalProperties":true}},"metrics":{"type":"array","items":{"type":"object","additionalProperties":true}}}},"Ga4ReportRequest":{"type":"object","required":["date_ranges"],"additionalProperties":false,"properties":{"date_ranges":{"type":"array","minItems":1,"maxItems":2,"items":{"type":"object","required":["start_date","end_date"],"additionalProperties":false,"properties":{"start_date":{"type":"string"},"end_date":{"type":"string"}}}},"metrics":{"type":"array","maxItems":10,"items":{"type":"string"}},"dimensions":{"type":"array","maxItems":9,"items":{"type":"string"}},"key_event_names":{"type":"array","maxItems":10,"items":{"type":"string"}},"limit":{"type":"integer","minimum":1,"maximum":1000},"offset":{"type":"integer","minimum":0},"keep_empty_rows":{"type":"boolean"},"currency_code":{"type":"string","pattern":"^[A-Z]{3}$"},"allow_long_range":{"type":"boolean"}}},"Ga4Report":{"type":"object","required":["property_id","cited"],"description":"GA4 Data API runReport JSON, plus property_id and cited. Report fields keep Google's camelCase.","properties":{"property_id":{"type":"string"},"cited":{"type":"object","additionalProperties":true},"rows":{"type":"array","items":{"type":"object","additionalProperties":true}},"rowCount":{"type":"integer"},"propertyQuota":{"type":"object","additionalProperties":true}},"additionalProperties":true},"GscSchema":{"type":"object","required":["dimensions","metrics","site_url_notes","data_state_notes"],"properties":{"dimensions":{"type":"array","items":{"type":"object","required":["api_name","description"],"properties":{"api_name":{"type":"string"},"description":{"type":"string"}}}},"metrics":{"type":"array","items":{"type":"object","required":["api_name","description"],"properties":{"api_name":{"type":"string"},"description":{"type":"string"}}}},"site_url_notes":{"type":"array","items":{"type":"string"}},"data_state_notes":{"type":"array","items":{"type":"string"}}}},"GscSiteList":{"type":"object","description":"Search Console site entries. Use siteUrl exactly.","required":["site_entry"],"properties":{"site_entry":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"GscSite":{"type":"object","required":["site_url","resource"],"properties":{"site_url":{"type":"string"},"resource":{"type":"object","additionalProperties":true}}},"GscSearchAnalyticsRequest":{"type":"object","required":["site_url","start_date","end_date"],"additionalProperties":false,"properties":{"site_url":{"type":"string"},"start_date":{"type":"string"},"end_date":{"type":"string"},"dimensions":{"type":"array","items":{"type":"string","enum":["query","page","country","device","searchAppearance","date","hour"]}},"row_limit":{"type":"integer","minimum":1,"maximum":1000},"start_row":{"type":"integer","minimum":0},"search_type":{"type":"string","enum":["web","image","video","news","discover","googleNews"]},"data_state":{"type":"string","enum":["final","all"]},"aggregation_type":{"type":"string"},"dimension_filter_groups":{"type":"array","maxItems":8,"items":{"type":"object","additionalProperties":true}}}},"GscSearchAnalytics":{"type":"object","required":["site_url","cited"],"description":"Search Analytics query JSON, plus site_url and cited.","properties":{"site_url":{"type":"string"},"cited":{"type":"object","additionalProperties":true},"rows":{"type":"array","items":{"type":"object","additionalProperties":true}}},"additionalProperties":true},"GscUrlInspectionRequest":{"type":"object","required":["site_url","inspection_url"],"additionalProperties":false,"properties":{"site_url":{"type":"string"},"inspection_url":{"type":"string"},"language_code":{"type":"string"}}},"GscUrlInspection":{"type":"object","required":["cited"],"description":"URL Inspection JSON plus cited. There is no request-indexing field.","properties":{"cited":{"type":"object","additionalProperties":true},"inspectionResult":{"type":"object","additionalProperties":true}},"additionalProperties":true},"GscSitemapList":{"type":"object","description":"Search Console sitemap resources for one site.","required":["sitemap"],"properties":{"sitemap":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"GscSitemap":{"type":"object","required":["site_url","feedpath","resource"],"properties":{"site_url":{"type":"string"},"feedpath":{"type":"string"},"resource":{"type":"object","additionalProperties":true}}},"GtmAccountList":{"type":"object","description":"Tag Manager account resources.","required":["account"],"properties":{"account":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"GtmContainerList":{"type":"object","description":"Tag Manager container resources.","required":["container"],"properties":{"container":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"GtmContainer":{"type":"object","required":["account_id","container_id","resource"],"properties":{"account_id":{"type":"string"},"container_id":{"type":"string"},"resource":{"type":"object","additionalProperties":true}}},"GtmWorkspaceList":{"type":"object","description":"Tag Manager workspace resources.","required":["workspace"],"properties":{"workspace":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"GtmTagList":{"type":"object","description":"Workspace draft tags. Each item has source=workspace.","required":["tag"],"properties":{"tag":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"GtmTriggerList":{"type":"object","description":"Workspace draft triggers. Each item has source=workspace.","required":["trigger"],"properties":{"trigger":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"GtmVariableList":{"type":"object","description":"Workspace draft variables. Each item has source=workspace.","required":["variable"],"properties":{"variable":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"GtmClientList":{"type":"object","description":"Workspace draft clients. Each item has source=workspace.","required":["client"],"properties":{"client":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"GtmLiveVersion":{"type":"object","required":["source","cited","hint"],"description":"Tag Manager versions.live JSON plus source=live and cited. This route does not publish.","properties":{"source":{"type":"string","enum":["live"]},"cited":{"type":"object","additionalProperties":true},"hint":{"type":"string"},"containerVersion":{"type":"object","additionalProperties":true}},"additionalProperties":true},"GtmEnvironmentList":{"type":"object","description":"Tag Manager environment resources.","required":["environment"],"properties":{"environment":{"type":"array","items":{"type":"object","additionalProperties":true}},"next_page_token":{"type":"string"},"hint":{"type":"string"}},"additionalProperties":true},"Health":{"type":"object","required":["ok"],"properties":{"ok":{"type":"boolean"}}},"ErrorBody":{"type":"object","required":["error"],"properties":{"error":{"type":"string"},"message":{"type":"string"},"path":{"type":"string"},"method":{"type":"string"}}},"Ga4SessionsReport":{"type":"object","required":["property_id","start_date","end_date","sessions"],"properties":{"property_id":{"type":"string"},"start_date":{"type":"string"},"end_date":{"type":"string"},"sessions":{"type":"number"}}},"Ga4SessionsError":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["google_not_linked","ga4_forbidden"]}}},"InvalidPropertyId":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_property_id"]}}},"GoogleNotLinked":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["google_not_linked"]}}},"GoogleReconnectRequired":{"type":"object","required":["error","message","missing_scopes"],"properties":{"error":{"type":"string","enum":["google_reconnect_required"]},"message":{"type":"string"},"missing_scopes":{"type":"array","items":{"type":"string"}}}},"PreviewForbidden":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["preview_forbidden"]}}},"WritePreviewError":{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_request","unknown_kind"]}}},"WriteConfirmError":{"oneOf":[{"type":"object","required":["error"],"properties":{"error":{"type":"string","enum":["invalid_request","preview_invalid"]}}},{"type":"object","required":["error","confirm_required"],"properties":{"error":{"type":"string","enum":["confirm_refused"]},"confirm_required":{"type":"boolean","enum":[true]}}}]},"Ga4CustomDimensionDraft":{"type":"object","required":["parameter_name","display_name","scope"],"properties":{"parameter_name":{"type":"string","description":"GA4 custom dimension parameter name.","pattern":"^[A-Za-z][A-Za-z0-9_]{0,39}$"},"display_name":{"type":"string","minLength":1,"maxLength":82},"scope":{"type":"string","enum":["EVENT","USER","ITEM"]},"description":{"type":"string","minLength":1,"maxLength":150}}},"WriteKind":{"type":"string","enum":["ga4_custom_dimension_create","gtm_variable_create"]},"Ga4CustomDimensionCreate":{"type":"object","required":["kind","property_id","dimension"],"properties":{"kind":{"type":"string","enum":["ga4_custom_dimension_create"]},"property_id":{"type":"string","description":"GA4 property id, digits only. Disposable smoke property: 554200375.","pattern":"^[0-9]{1,20}$"},"dimension":{"$ref":"#/components/schemas/Ga4CustomDimensionDraft"}}},"GtmParameter":{"type":"object","required":["type"],"properties":{"type":{"type":"string","minLength":1,"maxLength":64},"key":{"type":"string","minLength":1,"maxLength":200},"value":{"type":"string","minLength":1,"maxLength":1024}}},"GtmVariableDraft":{"type":"object","required":["name","type"],"properties":{"name":{"type":"string","minLength":1,"maxLength":200},"type":{"type":"string","description":"Tag Manager variable type, such as c for a constant. Matches tip gtm_create_variable.","pattern":"^[A-Za-z0-9_]{1,64}$"},"parameter":{"type":"array","maxItems":20,"description":"Optional Tag Manager parameters, same shape as tip gtm_create_variable. Constant type c with no parameter is posted as a template value of muse.","items":{"$ref":"#/components/schemas/GtmParameter"}}}},"GtmVariableCreate":{"type":"object","required":["kind","account_id","container_id","workspace_id","variable"],"properties":{"kind":{"type":"string","enum":["gtm_variable_create"]},"account_id":{"type":"string","description":"Numeric Tag Manager account id. No disposable account id is recorded in this repo.","pattern":"^[0-9]{1,20}$"},"container_id":{"type":"string","description":"Numeric Tag Manager container id. publicId is resolved from this id.","pattern":"^[0-9]{1,20}$"},"workspace_id":{"type":"string","description":"Numeric workspace id. The variable is created in this workspace and is not published.","pattern":"^[0-9]{1,20}$"},"variable":{"$ref":"#/components/schemas/GtmVariableDraft"}}},"WritePreviewRequest":{"oneOf":[{"$ref":"#/components/schemas/Ga4CustomDimensionCreate"},{"$ref":"#/components/schemas/GtmVariableCreate"}]},"WritePreview":{"type":"object","required":["status","preview_id","confirm_required","kind","resource_ids","summary","expires_at"],"properties":{"status":{"type":"string","enum":["preview"]},"preview_id":{"type":"string"},"confirm_required":{"type":"boolean","enum":[true]},"kind":{"$ref":"#/components/schemas/WriteKind"},"resource_ids":{"type":"array","minItems":1,"items":{"type":"string"}},"summary":{"type":"string"},"expires_at":{"type":"string","format":"date-time"}}},"WriteConfirmRequest":{"type":"object","required":["preview_id","confirm_phrase"],"properties":{"preview_id":{"type":"string","description":"Identifier returned by the preview call."},"confirm_phrase":{"type":"string","description":"Caller-supplied phrase that contains every resource id from the preview. Not a credential."}}},"WriteConfirmResult":{"type":"object","required":["status","preview_id","kind","executed","resource_name"],"properties":{"status":{"type":"string","enum":["confirmed"]},"preview_id":{"type":"string"},"kind":{"$ref":"#/components/schemas/WriteKind"},"executed":{"type":"boolean","enum":[true]},"resource_name":{"type":"string","description":"GA4 custom dimension resource name, or the Tag Manager variable path returned by Google."}}}}}}