---
title: "PATCH /v1beta/properties/{propertiesId}/dataRetentionSettings"
method: PATCH
path: "/v1beta/properties/{propertiesId}/dataRetentionSettings"
tags: ["properties"]
---

# PATCH /v1beta/properties/{propertiesId}/dataRetentionSettings

`PATCH /v1beta/properties/{propertiesId}/dataRetentionSettings`

## Request

- Base URL: `https://analyticsadmin.googleapis.com`
- URL: `https://analyticsadmin.googleapis.com/v1beta/properties/{propertiesId}/dataRetentionSettings`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/analytics.edit`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/analytics.edit`

Updates the singleton data retention settings for this property.

## Path parameters

- `propertiesId` string, required

## Query parameters

- `$.xgafv` '1' | '2'
- `access_token` string
- `alt` 'json' | 'media' | 'proto'
- `callback` string
- `fields` string
- `key` string
- `oauth_token` string
- `prettyPrint` boolean
- `quotaUser` string
- `uploadType` string
- `upload_protocol` string
- `updateMask` string, google-fieldmask

## Request body

- GoogleAnalyticsAdminV1betaDataRetentionSettings: Settings values for data retention. This is a singleton resource.
  - `eventDataRetention` 'RETENTION_DURATION_UNSPECIFIED' | 'TWO_MONTHS' | 'FOURTEEN_MONTHS' | 'TWENTY_SIX_MONTHS' | 'THIRTY_EIGHT_MONTHS' | 'FIFTY_MONTHS': Required. The length of time that event-level data is retained.
  - `name` string: Identifier. Resource name for this DataRetentionSetting resource. Format: properties/{property}/dataRetentionSettings
  - `resetUserDataOnNewActivity` boolean: If true, reset the retention period for the user identifier with every event from that user.
  - `userDataRetention` 'RETENTION_DURATION_UNSPECIFIED' | 'TWO_MONTHS' | 'FOURTEEN_MONTHS' | 'TWENTY_SIX_MONTHS' | 'THIRTY_EIGHT_MONTHS' | 'FIFTY_MONTHS': Required. The length of time that user-level data is retained.

## Response `200`

Successful response

- GoogleAnalyticsAdminV1betaDataRetentionSettings: Settings values for data retention. This is a singleton resource.
  - `eventDataRetention` 'RETENTION_DURATION_UNSPECIFIED' | 'TWO_MONTHS' | 'FOURTEEN_MONTHS' | 'TWENTY_SIX_MONTHS' | 'THIRTY_EIGHT_MONTHS' | 'FIFTY_MONTHS': Required. The length of time that event-level data is retained.
  - `name` string: Identifier. Resource name for this DataRetentionSetting resource. Format: properties/{property}/dataRetentionSettings
  - `resetUserDataOnNewActivity` boolean: If true, reset the retention period for the user identifier with every event from that user.
  - `userDataRetention` 'RETENTION_DURATION_UNSPECIFIED' | 'TWO_MONTHS' | 'FOURTEEN_MONTHS' | 'TWENTY_SIX_MONTHS' | 'THIRTY_EIGHT_MONTHS' | 'FIFTY_MONTHS': Required. The length of time that user-level data is retained.

---

[API](https://skmtc.dev/google/apis/analyticsadmin.md) - [All operations](https://skmtc.dev/google/apis/analyticsadmin/llms.txt) - [OpenAPI document](https://skmtc.dev/google/apis/analyticsadmin/revisions/2f06698abda1?raw)
