Skip to content

Google

9 operations in the WP Waterfall API.

List the company's connected Google accounts

get/integrations/googlePermalink to List the company's connected Google accounts

  • Scope: sites:read
  • Permission: sites.read

One connection at most for each tool (Search Console and Google Analytics). Each shows the Google account that connected, the scopes granted, and whether it works or needs the person to connect again. A token is never in the answer. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.

Responses

StatusBodyDescription
200GoogleIntegrationsThe connections
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
connections requiredarray of objectAt most one connection for each tool.
connections[].id requiredstring (uuid)UUIDv7
connections[].tool requiredstringOne of: search_console, google_analytics.
connections[].google_email requiredstringThe Google account that connected, for example name@example.com.
connections[].scopes requiredarray of stringThe scopes Google granted.
connections[].status requiredstringOne of: connected, needs_reconnect.
connections[].status_reason requiredstring or nullWhy the connection needs the person: access_revoked or access_denied. Null while it works.
connections[].connected_by requiredstring or nullThe name or email of the person who connected it.
connections[].connected_at requiredstring (date-time)
connections[].updated_at requiredstring (date-time)
redirect_uri requiredstringThe address Google sends the person back to. It must be an authorized redirect URI.

Start connecting a Google account for a tool

post/integrations/google/connectPermalink to Start connecting a Google account for a tool

  • Permission: sites.update
  • Dashboard session only, no API key

Returns the Google address to send the browser to. Google asks the person to allow read only access, then sends them back to WP Waterfall, which keeps the grant and returns them to the site's Tools tab. The link works once, for 10 minutes, and only in the browser session that asked for it, so this route needs a signed-in session and refuses API keys. Connecting again replaces the account of that tool for the whole company. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.

Parameters

NameInTypeDescription
Idempotency-Key requiredheaderstringSend a fresh unique value on every POST: a POST without it answers 422. The answer is stored for 24 hours, so a retry with the same key and body returns the first answer, and the same key with a different body returns 422.

Request body application/json, required, ConnectGoogleRequest

Fields

NameTypeDescription
tool requiredstringOne of: search_console, google_analytics.
site_id requiredstring (uuid)The site the person is setting up. They come back to its Tools tab.

Responses

StatusBodyDescription
200GoogleAuthorizationThe Google address
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
409ProblemThe current state does not allow this: the same change is already running, or another change got there first.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
authorization_url requiredstring (uri)Send the browser here. Google asks the person to allow read only access.
expires_at requiredstring (date-time)

Disconnect a Google account

delete/integrations/google/{id}Permalink to Disconnect a Google account

  • Scope: sites:write
  • Permission: sites.update
  • Needs a confirmation

Tells Google to end the grant, deletes the stored tokens, and clears the property every site had chosen from this account. The tool stays on for those sites and asks for a new connection. Needs a role that manages every site in the company. Audited.

Parameters

NameInTypeDescription
id requiredpathstring (uuid)The id of the Google connection.
confirmquerystringAn API key must say yes to this change: confirm=true here, or confirm: true in the JSON body. Without it the call answers 422 and changes nothing. One of: true.

Responses

StatusBodyDescription
200GoogleDisconnectedDisconnected
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
409ProblemThe current state does not allow this: the same change is already running, or another change got there first.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
id requiredstring (uuid)UUIDv7
tool requiredstringOne of: search_console, google_analytics.
disconnected requiredboolean
sites_cleared requiredintegerSites that had a property of this account chosen. Their choice is cleared. Range: 0 to any.

Read a site's Google Analytics tool

get/sites/{id}/google-analyticsPermalink to Read a site's Google Analytics tool

  • Scope: sites:read
  • Permission: sites.read

Whether the tool is on, the company's connection, and the Google Analytics 4 property this site reads. With list_properties=true it also lists the properties the connected account can read. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.

Parameters

NameInTypeDescription
id requiredpathstring (uuid)The id of the site.
list_propertiesquerystringOne of: true, false.

Responses

StatusBodyDescription
200GoogleToolSettingsThe tool settings
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
site_id requiredstring (uuid)UUIDv7
tool requiredstringOne of: search_console, google_analytics.
enabled requiredbooleanOn when the person turned the tool on for this site. Off is the default.
connection requiredobject or nullThe company's connection for this tool, or null when none is connected.
connection.id requiredstring (uuid)UUIDv7
connection.google_email requiredstring
connection.status requiredstringOne of: connected, needs_reconnect.
connection.status_reason requiredstring or null
connection.connected_at requiredstring (date-time)
property requiredobject or nullThe property this site reads. Null until one is chosen.
property.id requiredstring
property.name requiredstring
properties requiredarray or nullThe properties the connected account can read. Present only when the call asks for them with list_properties=true, and only while the connection works.
properties_limited requiredbooleanTrue when this caller may choose only some of the account's properties: a person limited to some sites (a Site Admin) gets the Search Console properties of this site's proven domains, and the property a person with a company wide role chose for the site. The list holds only those. False for a person with a company wide role, who may choose any.
properties_error requiredstring or nullOne plain sentence when the property list could not be read.

Turn Google Analytics on for a site and choose its property

put/sites/{id}/google-analyticsPermalink to Turn Google Analytics on for a site and choose its property

  • Scope: sites:write
  • Permission: sites.update

enabled true turns the tool on, and property_id picks the Google Analytics 4 property to read, such as properties/123456789. The property must be one the connected account can read. enabled false turns the tool off and forgets the property. A change is audited and starts no job. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.

Parameters

NameInTypeDescription
id requiredpathstring (uuid)The id of the site.
Idempotency-KeyheaderstringOptional on PUT and PATCH. When the call starts a job, a retry with the same key, path, and body within 24 hours returns that job instead of starting another. A different path or body starts a new job.

Request body application/json, required, PutGoogleToolRequest

Fields

NameTypeDescription
enabled requiredbooleanTrue turns the tool on for the site, false turns it off and forgets the chosen property.
property_idstring or nullThe property to read, as the list gives it. Send null to clear the choice. Leave it out to keep the one the site has. A person limited to some sites may send only a property the list gave them (properties_limited); any other answers 403 google_property_not_allowed.

Responses

StatusBodyDescription
200GoogleToolSettingsThe tool settings
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
409ProblemThe current state does not allow this: the same change is already running, or another change got there first.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
site_id requiredstring (uuid)UUIDv7
tool requiredstringOne of: search_console, google_analytics.
enabled requiredbooleanOn when the person turned the tool on for this site. Off is the default.
connection requiredobject or nullThe company's connection for this tool, or null when none is connected.
connection.id requiredstring (uuid)UUIDv7
connection.google_email requiredstring
connection.status requiredstringOne of: connected, needs_reconnect.
connection.status_reason requiredstring or null
connection.connected_at requiredstring (date-time)
property requiredobject or nullThe property this site reads. Null until one is chosen.
property.id requiredstring
property.name requiredstring
properties requiredarray or nullThe properties the connected account can read. Present only when the call asks for them with list_properties=true, and only while the connection works.
properties_limited requiredbooleanTrue when this caller may choose only some of the account's properties: a person limited to some sites (a Site Admin) gets the Search Console properties of this site's proven domains, and the property a person with a company wide role chose for the site. The list holds only those. False for a person with a company wide role, who may choose any.
properties_error requiredstring or nullOne plain sentence when the property list could not be read.

Read a site's Google Analytics traffic

get/sites/{id}/google-analytics/reportPermalink to Read a site's Google Analytics traffic

  • Scope: sites:read
  • Permission: sites.read

kind overview gives users, sessions, page views, and engagement rate for the range, with one entry for each day. pages gives the top 25 pages by views, and sources the top 25 sources by sessions. The range is the last 28 days unless from and to are given, and it is at most 400 days. Answers are kept 15 minutes. Answers 409 with code google_reconnect_needed when the Google access ended, and 503 with code google_unavailable when Google is busy. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.

Parameters

NameInTypeDescription
id requiredpathstring (uuid)The id of the site.
fromquerystringFirst day, inclusive. Default: 28 days before to.
toquerystringLast day, inclusive. Default: today.
kindquerystringOne of: overview, pages, sources.

Responses

StatusBodyDescription
200GoogleAnalyticsReportThe report
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
site_id requiredstring (uuid)UUIDv7
property requiredstring
kind requiredstringOne of: overview, pages, sources.
from requiredstring
to requiredstring
totals requiredobject or null
totals.users requirednumber
totals.sessions requirednumber
totals.views requirednumber
totals.engagement_rate requirednumber
series requiredarray of object
series[].date requiredstring
series[].users requirednumber
series[].sessions requirednumber
series[].views requirednumber
series[].engagement_rate requirednumber
rows requiredarray of objectThe pages kind has page paths as keys, the sources kind has source and medium.
rows[].key requiredstring
rows[].users requirednumber
rows[].sessions requirednumber
rows[].views requirednumber
rows[].engagement_rate requirednumber
cached requiredboolean
fetched_at requiredstring (date-time)

Read a site's Google Search Console tool

get/sites/{id}/search-consolePermalink to Read a site's Google Search Console tool

  • Scope: sites:read
  • Permission: sites.read

Whether the tool is on, the company's connection, and the property this site reads. With list_properties=true it also lists the properties the connected account can read. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.

Parameters

NameInTypeDescription
id requiredpathstring (uuid)The id of the site.
list_propertiesquerystringOne of: true, false.

Responses

StatusBodyDescription
200GoogleToolSettingsThe tool settings
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
site_id requiredstring (uuid)UUIDv7
tool requiredstringOne of: search_console, google_analytics.
enabled requiredbooleanOn when the person turned the tool on for this site. Off is the default.
connection requiredobject or nullThe company's connection for this tool, or null when none is connected.
connection.id requiredstring (uuid)UUIDv7
connection.google_email requiredstring
connection.status requiredstringOne of: connected, needs_reconnect.
connection.status_reason requiredstring or null
connection.connected_at requiredstring (date-time)
property requiredobject or nullThe property this site reads. Null until one is chosen.
property.id requiredstring
property.name requiredstring
properties requiredarray or nullThe properties the connected account can read. Present only when the call asks for them with list_properties=true, and only while the connection works.
properties_limited requiredbooleanTrue when this caller may choose only some of the account's properties: a person limited to some sites (a Site Admin) gets the Search Console properties of this site's proven domains, and the property a person with a company wide role chose for the site. The list holds only those. False for a person with a company wide role, who may choose any.
properties_error requiredstring or nullOne plain sentence when the property list could not be read.

Turn Google Search Console on for a site and choose its property

put/sites/{id}/search-consolePermalink to Turn Google Search Console on for a site and choose its property

  • Scope: sites:write
  • Permission: sites.update

enabled true turns the tool on, and property_id picks the property to read (a URL prefix such as https://example.com/ or a domain property such as sc-domain:example.com). The property must be one the connected account can read. enabled false turns the tool off and forgets the property. A change is audited and starts no job. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.

Parameters

NameInTypeDescription
id requiredpathstring (uuid)The id of the site.
Idempotency-KeyheaderstringOptional on PUT and PATCH. When the call starts a job, a retry with the same key, path, and body within 24 hours returns that job instead of starting another. A different path or body starts a new job.

Request body application/json, required, PutGoogleToolRequest

Fields

NameTypeDescription
enabled requiredbooleanTrue turns the tool on for the site, false turns it off and forgets the chosen property.
property_idstring or nullThe property to read, as the list gives it. Send null to clear the choice. Leave it out to keep the one the site has. A person limited to some sites may send only a property the list gave them (properties_limited); any other answers 403 google_property_not_allowed.

Responses

StatusBodyDescription
200GoogleToolSettingsThe tool settings
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
409ProblemThe current state does not allow this: the same change is already running, or another change got there first.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
site_id requiredstring (uuid)UUIDv7
tool requiredstringOne of: search_console, google_analytics.
enabled requiredbooleanOn when the person turned the tool on for this site. Off is the default.
connection requiredobject or nullThe company's connection for this tool, or null when none is connected.
connection.id requiredstring (uuid)UUIDv7
connection.google_email requiredstring
connection.status requiredstringOne of: connected, needs_reconnect.
connection.status_reason requiredstring or null
connection.connected_at requiredstring (date-time)
property requiredobject or nullThe property this site reads. Null until one is chosen.
property.id requiredstring
property.name requiredstring
properties requiredarray or nullThe properties the connected account can read. Present only when the call asks for them with list_properties=true, and only while the connection works.
properties_limited requiredbooleanTrue when this caller may choose only some of the account's properties: a person limited to some sites (a Site Admin) gets the Search Console properties of this site's proven domains, and the property a person with a company wide role chose for the site. The list holds only those. False for a person with a company wide role, who may choose any.
properties_error requiredstring or nullOne plain sentence when the property list could not be read.

Read how a site does in Google search

get/sites/{id}/search-console/reportPermalink to Read how a site does in Google search

  • Scope: sites:read
  • Permission: sites.read

kind overview gives clicks, impressions, click through rate, and average position for the range, with one entry for each day. queries, pages, countries, and devices give the top 25 rows by clicks. The range is the last 28 days unless from and to are given, and it is at most 400 days. Search Console reports a few days late, so the newest days can be empty. Answers are kept 15 minutes. Answers 409 with code google_reconnect_needed when the Google access ended, and 503 with code google_unavailable when Google is busy. Answers 503 with code provider_not_configured while this WP Waterfall install has no Google client id and secret.

Parameters

NameInTypeDescription
id requiredpathstring (uuid)The id of the site.
fromquerystringFirst day, inclusive. Default: 28 days before to.
toquerystringLast day, inclusive. Default: today.
kindquerystringOne of: overview, queries, pages, countries, devices.

Responses

StatusBodyDescription
200SearchConsoleReportThe report
400ProblemThe request could not be read: bad JSON, a bad header, or a malformed value.
401ProblemThe credentials are missing, expired, or revoked. The WWW-Authenticate header names the Bearer scheme.
403ProblemThe credentials are valid but may not do this: the role, the API key scope, or a required confirmation is missing.
404ProblemThe thing in the path does not exist, or it belongs to another company. The answer is the same for both.
422ProblemThe request was read but a value is not valid, or a required confirmation or Idempotency-Key is missing. The errors list names each field.
429ProblemA rate limit was reached. Wait Retry-After seconds. Limits are per caller, per company, and per address.
4XXProblemProblem Details (RFC 9457)

200 response fields

NameTypeDescription
site_id requiredstring (uuid)UUIDv7
property requiredstring
kind requiredstringOne of: overview, queries, pages, countries, devices.
from requiredstring
to requiredstring
totals requiredobject or nullOverview only: the totals of the range. Null for the other kinds.
totals.clicks requirednumber
totals.impressions requirednumber
totals.ctr requirednumber
totals.position requirednumber
series requiredarray of objectOverview only: one entry for each day with data.
series[].date requiredstring
series[].clicks requirednumber
series[].impressions requirednumber
series[].ctr requirednumber
series[].position requirednumber
rows requiredarray of objectThe other kinds: the top 25 rows by clicks.
rows[].key requiredstring
rows[].clicks requirednumber
rows[].impressions requirednumber
rows[].ctr requirednumber
rows[].position requirednumber
cached requiredbooleanTrue when this answer came from the 15 minute memory and not from Google.
fetched_at requiredstring (date-time)