openapi: 3.1.0
info:
title: Google Analytics Admin API
description: 'Manage properties in Google Analytics. Warning: Creating multiple Customer Applications,
Accounts, or Projects to simulate or act as a single Customer Application, Account, or Project (respectively)
or to circumvent Service-specific usage limits or quotas is a direct violation of Google Cloud Platform
Terms of Service as well as Google APIs Terms of Service. These actions can result in immediate termination
of your GCP project(s) without any warning.'
version: v1beta
contact:
name: Google
url: http://code.google.com/apis/analytics/docs/mgmt/home.html
x-discovery-revision: '20260810'
servers:
- url: https://analyticsadmin.googleapis.com
description: Google Analytics Admin API
tags:
- name: accountSummaries
- name: accounts
- name: properties
security:
- BearerAuth: []
paths:
/v1beta/accountSummaries:
get:
operationId: accountSummaries_list
summary: Returns summaries of all accounts accessible by the caller
tags:
- accountSummaries
description: Returns summaries of all accounts accessible by the caller.
parameters:
- name: pageToken
in: query
required: false
schema:
type: string
description: Optional. A page token, received from a previous `ListAccountSummaries` call. Provide
this to retrieve the subsequent page. When paginating, all other parameters provided to `ListAccountSummaries`
must match the call that provided the page token.
- name: pageSize
in: query
required: false
schema:
type: integer
format: int32
description: Optional. The maximum number of AccountSummary resources to return. The service may
return fewer than this value, even if there are additional pages. If unspecified, at most 50
resources will be returned. The maximum value is 200; (higher values will be coerced to the
maximum)
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaListAccountSummariesResponse'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- analytics.readonly
- BearerAuth: []
/v1beta/accounts/{accountsId}:
delete:
operationId: accounts_delete
summary: 'Marks target Account as soft-deleted (ie: "trashed") and returns it'
tags:
- accounts
description: 'Marks target Account as soft-deleted (ie: "trashed") and returns it. This API does
not have a method to restore soft-deleted accounts. However, they can be restored using the Trash
Can UI. If the accounts are not restored before the expiration time, the account and all child
resources (eg: Properties, GoogleAdsLinks, Streams, AccessBindings) will be permanently purged.
https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found.'
parameters:
- name: name
in: query
required: true
schema:
type: string
pattern: ^accounts/[^/]+$
description: 'Required. The name of the Account to soft-delete. Format: accounts/{account} Example:
"accounts/100"'
- name: accountsId
in: path
required: true
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleProtobufEmpty'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- BearerAuth: []
get:
operationId: accounts_get
summary: Lookup for a single Account
tags:
- accounts
description: Lookup for a single Account.
parameters:
- name: name
in: query
required: true
schema:
type: string
pattern: ^accounts/[^/]+$
description: 'Required. The name of the account to lookup. Format: accounts/{account} Example:
"accounts/100"'
- name: accountsId
in: path
required: true
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaAccount'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- analytics.readonly
- BearerAuth: []
patch:
operationId: accounts_patch
summary: Updates an account
tags:
- accounts
description: Updates an account.
parameters:
- name: name
in: query
required: true
schema:
type: string
pattern: ^accounts/[^/]+$
description: 'Identifier. Resource name of this account. Format: accounts/{account} Example: "accounts/100"'
- name: updateMask
in: query
required: false
schema:
type: string
format: google-fieldmask
description: Required. The list of fields to be updated. Field names must be in snake case (for
example, "field_to_update"). Omitted fields will not be updated. To replace the entire entity,
use one path with the string "*" to match all fields.
- name: accountsId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaAccount'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaAccount'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- BearerAuth: []
/v1beta/accounts/{accountsId}/dataSharingSettings:
get:
operationId: accounts_getDataSharingSettings
summary: Get data sharing settings on an account
tags:
- accounts
description: Get data sharing settings on an account. Data sharing settings are singletons.
parameters:
- name: name
in: query
required: true
schema:
type: string
pattern: ^accounts/[^/]+/dataSharingSettings$
description: 'Required. The name of the settings to lookup. Format: accounts/{account}/dataSharingSettings
Example: `accounts/1000/dataSharingSettings`'
- name: accountsId
in: path
required: true
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaDataSharingSettings'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- analytics.readonly
- BearerAuth: []
/v1beta/accounts:
get:
operationId: accounts_list
summary: Returns all accounts accessible by the caller
tags:
- accounts
description: 'Returns all accounts accessible by the caller. Note that these accounts might not
currently have GA properties. Soft-deleted (ie: "trashed") accounts are excluded by default. Returns
an empty list if no relevant accounts are found. Note: The easiest way to retrieve a list of all
properties you have access to is by using `ListAccountSummaries`.'
parameters:
- name: pageToken
in: query
required: false
schema:
type: string
description: Optional. A page token, received from a previous `ListAccounts` call. Provide this
to retrieve the subsequent page. When paginating, all other parameters provided to `ListAccounts`
must match the call that provided the page token.
- name: showDeleted
in: query
required: false
schema:
type: boolean
description: 'Whether to include soft-deleted (ie: "trashed") Accounts in the results. Accounts
can be inspected to determine whether they are deleted or not.'
- name: pageSize
in: query
required: false
schema:
type: integer
format: int32
description: Optional. The maximum number of resources to return. The service may return fewer
than this value, even if there are additional pages. If unspecified, at most 50 resources will
be returned. The maximum value is 200; (higher values will be coerced to the maximum)
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaListAccountsResponse'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- analytics.readonly
- BearerAuth: []
/v1beta/accounts:provisionAccountTicket:
post:
operationId: accounts_provisionAccountTicket
summary: Requests a ticket for creating an account
tags:
- accounts
description: Requests a ticket for creating an account.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaProvisionAccountTicketRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaProvisionAccountTicketResponse'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- BearerAuth: []
/v1beta/accounts/{accountsId}:runAccessReport:
post:
operationId: accounts_runAccessReport
summary: Returns a customized report of data access records
tags:
- accounts
description: Returns a customized report of data access records. The report provides records of
each time a user reads Google Analytics reporting data. Access records are retained for up to
2 years. Data Access Reports can be requested for a property. Reports may be requested for any
property, but dimensions that aren't related to quota can only be requested on Google Analytics
360 properties. This method is only available to Administrators. These data access records include
GA UI Reporting, GA UI Explorations, GA Data API, and other products like Firebase & Admob that
can retrieve data from Google Analytics through a linkage. These records don't include property
configuration changes like adding a stream or changing a property's time zone. For configuration
change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).
To give your feedback on this API, complete the [Google Analytics Access Reports feedback](https://docs.google.com/forms/d/e/1FAIpQLSdmEBUrMzAEdiEKk5TV5dEHvDUZDRlgWYdQdAeSdtR4hVjEhw/viewform)
form.
parameters:
- name: entity
in: query
required: true
schema:
type: string
pattern: ^accounts/[^/]+$
description: The Data Access Report supports requesting at the property level or account level.
If requested at the account level, Data Access Reports include all access for all properties
under that account. To request at the property level, entity should be for example 'properties/123'
if "123" is your Google Analytics property ID. To request at the account level, entity should
be for example 'accounts/1234' if "1234" is your Google Analytics Account ID.
- name: accountsId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaRunAccessReportRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaRunAccessReportResponse'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- analytics.readonly
- BearerAuth: []
/v1beta/accounts/{accountsId}:searchChangeHistoryEvents:
post:
operationId: accounts_searchChangeHistoryEvents
summary: Searches through all changes to an account or its children given the specified set of filters
tags:
- accounts
description: Searches through all changes to an account or its children given the specified set
of filters. Only returns the subset of changes supported by the API. The UI may return additional
changes.
parameters:
- name: account
in: query
required: true
schema:
type: string
pattern: ^accounts/[^/]+$
description: 'Required. The account resource for which to return change history resources. Format:
accounts/{account} Example: `accounts/100`'
- name: accountsId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaSearchChangeHistoryEventsRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaSearchChangeHistoryEventsResponse'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- BearerAuth: []
/v1beta/properties/{propertiesId}:acknowledgeUserDataCollection:
post:
operationId: properties_acknowledgeUserDataCollection
summary: Acknowledges the terms of user data collection for the specified property
tags:
- properties
description: Acknowledges the terms of user data collection for the specified property. This acknowledgement
must be completed (either in the Google Analytics UI or through this API) before MeasurementProtocolSecret
resources may be created.
parameters:
- name: property
in: query
required: true
schema:
type: string
pattern: ^properties/[^/]+$
description: Required. The property for which to acknowledge user data collection.
- name: propertiesId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaAcknowledgeUserDataCollectionResponse'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- BearerAuth: []
/v1beta/properties:
post:
operationId: properties_create
summary: Creates a Google Analytics property with the specified location and attributes
tags:
- properties
description: Creates a Google Analytics property with the specified location and attributes.
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaProperty'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaProperty'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- BearerAuth: []
get:
operationId: properties_list
summary: Returns child Properties under the specified parent Account
tags:
- properties
description: 'Returns child Properties under the specified parent Account. Properties will be excluded
if the caller does not have access. Soft-deleted (ie: "trashed") properties are excluded by default.
Returns an empty list if no relevant properties are found.'
parameters:
- name: filter
in: query
required: false
schema:
type: string
description: 'Required. An expression for filtering the results of the request. Fields eligible
for filtering are: `parent:`(The resource name of the parent account/property) or `ancestor:`(The
resource name of the parent account) or `firebase_project:`(The id or number of the linked firebase
project). Some examples of filters: ``` | Filter | Description | |-----------------------------|-------------------------------------------|
| parent:accounts/123 | The account with account id: 123. | | parent:properties/123 | The property
with property id: 123. | | ancestor:accounts/123 | The account with account id: 123. | | firebase_project:project-id
| The firebase project with id: project-id. | | firebase_project:123 | The firebase project
with number: 123. | ```'
- name: pageSize
in: query
required: false
schema:
type: integer
format: int32
description: Optional. The maximum number of resources to return. The service may return fewer
than this value, even if there are additional pages. If unspecified, at most 50 resources will
be returned. The maximum value is 200; (higher values will be coerced to the maximum)
- name: showDeleted
in: query
required: false
schema:
type: boolean
description: 'Whether to include soft-deleted (ie: "trashed") Properties in the results. Properties
can be inspected to determine whether they are deleted or not.'
- name: pageToken
in: query
required: false
schema:
type: string
description: Optional. A page token, received from a previous `ListProperties` call. Provide this
to retrieve the subsequent page. When paginating, all other parameters provided to `ListProperties`
must match the call that provided the page token.
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaListPropertiesResponse'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- analytics.readonly
- BearerAuth: []
/v1beta/properties/{propertiesId}:
delete:
operationId: properties_delete
summary: 'Marks target Property as soft-deleted (ie: "trashed") and returns it'
tags:
- properties
description: 'Marks target Property as soft-deleted (ie: "trashed") and returns it. This API does
not have a method to restore soft-deleted properties. However, they can be restored using the
Trash Can UI. If the properties are not restored before the expiration time, the Property and
all child resources (eg: GoogleAdsLinks, Streams, AccessBindings) will be permanently purged.
https://support.google.com/analytics/answer/6154772 Returns an error if the target is not found.'
parameters:
- name: name
in: query
required: true
schema:
type: string
pattern: ^properties/[^/]+$
description: 'Required. The name of the Property to soft-delete. Format: properties/{property_id}
Example: "properties/1000"'
- name: propertiesId
in: path
required: true
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaProperty'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- BearerAuth: []
get:
operationId: properties_get
summary: Lookup for a single GA Property
tags:
- properties
description: Lookup for a single GA Property.
parameters:
- name: name
in: query
required: true
schema:
type: string
pattern: ^properties/[^/]+$
description: 'Required. The name of the property to lookup. Format: properties/{property_id} Example:
"properties/1000"'
- name: propertiesId
in: path
required: true
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaProperty'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- analytics.readonly
- BearerAuth: []
patch:
operationId: properties_patch
summary: Updates a property
tags:
- properties
description: Updates a property.
parameters:
- name: updateMask
in: query
required: false
schema:
type: string
format: google-fieldmask
description: Required. The list of fields to be updated. Field names must be in snake case (e.g.,
"field_to_update"). Omitted fields will not be updated. To replace the entire entity, use one
path with the string "*" to match all fields.
- name: name
in: query
required: true
schema:
type: string
pattern: ^properties/[^/]+$
description: 'Identifier. Resource name of this property. Format: properties/{property_id} Example:
"properties/1000"'
- name: propertiesId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaProperty'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaProperty'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- BearerAuth: []
/v1beta/properties/{propertiesId}/dataRetentionSettings:
get:
operationId: properties_getDataRetentionSettings
summary: Returns the singleton data retention settings for this property
tags:
- properties
description: Returns the singleton data retention settings for this property.
parameters:
- name: name
in: query
required: true
schema:
type: string
pattern: ^properties/[^/]+/dataRetentionSettings$
description: 'Required. The name of the settings to lookup. Format: properties/{property}/dataRetentionSettings
Example: "properties/1000/dataRetentionSettings"'
- name: propertiesId
in: path
required: true
schema:
type: string
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaDataRetentionSettings'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- analytics.readonly
- BearerAuth: []
patch:
operationId: properties_updateDataRetentionSettings
summary: Updates the singleton data retention settings for this property
tags:
- properties
description: Updates the singleton data retention settings for this property.
parameters:
- name: updateMask
in: query
required: false
schema:
type: string
format: google-fieldmask
description: Required. The list of fields to be updated. Field names must be in snake case (e.g.,
"field_to_update"). Omitted fields will not be updated. To replace the entire entity, use one
path with the string "*" to match all fields.
- name: name
in: query
required: true
schema:
type: string
pattern: ^properties/[^/]+/dataRetentionSettings$
description: 'Identifier. Resource name for this DataRetentionSetting resource. Format: properties/{property}/dataRetentionSettings'
- name: propertiesId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaDataRetentionSettings'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaDataRetentionSettings'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- BearerAuth: []
/v1beta/properties/{propertiesId}:runAccessReport:
post:
operationId: properties_runAccessReport
summary: Returns a customized report of data access records
tags:
- properties
description: Returns a customized report of data access records. The report provides records of
each time a user reads Google Analytics reporting data. Access records are retained for up to
2 years. Data Access Reports can be requested for a property. Reports may be requested for any
property, but dimensions that aren't related to quota can only be requested on Google Analytics
360 properties. This method is only available to Administrators. These data access records include
GA UI Reporting, GA UI Explorations, GA Data API, and other products like Firebase & Admob that
can retrieve data from Google Analytics through a linkage. These records don't include property
configuration changes like adding a stream or changing a property's time zone. For configuration
change history, see [searchChangeHistoryEvents](https://developers.google.com/analytics/devguides/config/admin/v1/rest/v1alpha/accounts/searchChangeHistoryEvents).
To give your feedback on this API, complete the [Google Analytics Access Reports feedback](https://docs.google.com/forms/d/e/1FAIpQLSdmEBUrMzAEdiEKk5TV5dEHvDUZDRlgWYdQdAeSdtR4hVjEhw/viewform)
form.
parameters:
- name: entity
in: query
required: true
schema:
type: string
pattern: ^properties/[^/]+$
description: The Data Access Report supports requesting at the property level or account level.
If requested at the account level, Data Access Reports include all access for all properties
under that account. To request at the property level, entity should be for example 'properties/123'
if "123" is your Google Analytics property ID. To request at the account level, entity should
be for example 'accounts/1234' if "1234" is your Google Analytics Account ID.
- name: propertiesId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaRunAccessReportRequest'
responses:
'200':
description: Successful response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleAnalyticsAdminV1betaRunAccessReportResponse'
default:
description: Error response
content:
application/json:
schema:
$ref: '#/components/schemas/GoogleRpcStatus'
security:
- OAuth2:
- analytics.edit
- analytics.readonly
- BearerAuth: []
/v1beta/properties/{propertiesId}/conversionEvents:
post:
operationId: properties_conversionEvents_create
summary: 'Deprecated: Use `CreateKeyEvent` instead'
tags:
- properties
description: 'Deprecated: Use `CreateKeyEvent` instead. Creates a conversion event with the specified
attributes.'
deprecated: true
parameters:
- name: parent
in: query
required: true
schema:
type: string
pattern: ^properties/[^/]+$
description: 'Required. The resource name of the parent property where this conversion event will
be created. Format: properties/123'
- name: propertiesId
in: path
required: true
schema:
type: string
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/Goog
# --- truncated at 32 KB (158 KB total) ---
# Full source: https://raw.githubusercontent.com/api-evangelist/google-analytics-4/refs/heads/main/openapi/google-analytics-4-admin-v1beta-openapi.yml