---
title: "PATCH /v1/devices/{devicesId}/deviceUsers/{deviceUsersId}/clientStates/{clientStatesId}"
method: PATCH
path: "/v1/devices/{devicesId}/deviceUsers/{deviceUsersId}/clientStates/{clientStatesId}"
tags: ["devices"]
---

# PATCH /v1/devices/{devicesId}/deviceUsers/{deviceUsersId}/clientStates/{clientStatesId}

`PATCH /v1/devices/{devicesId}/deviceUsers/{deviceUsersId}/clientStates/{clientStatesId}`

## Request

- Base URL: `https://cloudidentity.googleapis.com`
- URL: `https://cloudidentity.googleapis.com/v1/devices/{devicesId}/deviceUsers/{deviceUsersId}/clientStates/{clientStatesId}`
- Auth: OAuth 2 and OAuth 2
  - Implicit: `https://accounts.google.com/o/oauth2/auth`
  - Scopes: `https://www.googleapis.com/auth/cloud-identity.devices`
  - Authorization code: `https://accounts.google.com/o/oauth2/auth`
  - Token URL: `https://accounts.google.com/o/oauth2/token` scopes: `https://www.googleapis.com/auth/cloud-identity.devices`

Updates the client state for the device user **Note**: This method is available only to customers who have one of the following SKUs: Enterprise Standard, Enterprise Plus, Enterprise for Education, and Cloud Identity Premium

## Path parameters

- `devicesId` string, required
- `deviceUsersId` string, required
- `clientStatesId` 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
- `customer` string
- `updateMask` string, google-fieldmask

## Request body

- GoogleAppsCloudidentityDevicesV1ClientState: Represents the state associated with an API client calling the Devices API. Resource representing ClientState and supports updates from API users
  - `assetTags` string[]: The caller can specify asset tags for this resource
  - `complianceState` 'COMPLIANCE_STATE_UNSPECIFIED' | 'COMPLIANT' | 'NON_COMPLIANT': The compliance state of the resource as specified by the API client.
  - `createTime` string, google-datetime: Output only. The time the client state data was created.
  - `customId` string: This field may be used to store a unique identifier for the API resource within which these CustomAttributes are a field.
  - `etag` string: The token that needs to be passed back for concurrency control in updates. Token needs to be passed back in UpdateRequest
  - `healthScore` 'HEALTH_SCORE_UNSPECIFIED' | 'VERY_POOR' | 'POOR' | 'NEUTRAL' | 'GOOD' | 'VERY_GOOD': The Health score of the resource. The Health score is the callers specification of the condition of the device from a usability point of view. For example, a third-party device management provider may specify a health score based on its compliance with organizational policies.
  - `keyValuePairs` object: The map of key-value attributes stored by callers specific to a device. The total serialized length of this map may not exceed 10KB. No limit is placed on the number of attributes in a map.
  - `lastUpdateTime` string, google-datetime: Output only. The time the client state data was last updated.
  - `managed` 'MANAGED_STATE_UNSPECIFIED' | 'MANAGED' | 'UNMANAGED': The management state of the resource as specified by the API client.
  - `name` string: Output only. [Resource name](https://cloud.google.com/apis/design/resource_names) of the ClientState in format: `devices/{device}/deviceUsers/{device_user}/clientState/{partner}`, where partner corresponds to the partner storing the data. For partners belonging to the "BeyondCorp Alliance", this is the partner ID specified to you by Google. For all other callers, this is a string of the form: `{customer}-suffix`, where `customer` is your customer ID. The *suffix* is any string the caller specifies. This string will be displayed verbatim in the administration console. This suffix is used in setting up Custom Access Levels in Context-Aware Access. Your organization's customer ID can be obtained from the URL: `GET https://www.googleapis.com/admin/directory/v1/customers/my_customer` The `id` field in the response contains the customer ID starting with the letter 'C'. The customer ID to be used in this API is the string after the letter 'C' (not including 'C')
  - `ownerType` 'OWNER_TYPE_UNSPECIFIED' | 'OWNER_TYPE_CUSTOMER' | 'OWNER_TYPE_PARTNER': Output only. The owner of the ClientState
  - `scoreReason` string: A descriptive cause of the health score.

## Response `200`

Successful response

- Operation: This resource represents a long-running operation that is the result of a network API call.
  - `done` boolean: If the value is `false`, it means the operation is still in progress. If `true`, the operation is completed, and either `error` or `response` is available.
  - `error` Status: The `Status` type defines a logical error model that is suitable for different programming environments, including REST APIs and RPC APIs. It is used by [gRPC](https://github.com/grpc). Each `Status` message contains three pieces of data: error code, error message, and error details. You can find out more about this error model and how to work with it in the [API Design Guide](https://cloud.google.com/apis/design/errors).
    - `code` integer: The status code, which should be an enum value of google.rpc.Code.
    - `details` object[]: A list of messages that carry the error details. There is a common set of message types for APIs to use.
    - `message` string: A developer-facing error message, which should be in English. Any user-facing error message should be localized and sent in the google.rpc.Status.details field, or localized by the client.
  - `metadata` object: Service-specific metadata associated with the operation. It typically contains progress information and common metadata such as create time. Some services might not provide such metadata. Any method that returns a long-running operation should document the metadata type, if any.
  - `name` string: The server-assigned name, which is only unique within the same service that originally returns it. If you use the default HTTP mapping, the `name` should be a resource name ending with `operations/{unique_id}`.
  - `response` object: The normal, successful response of the operation. If the original method returns no data on success, such as `Delete`, the response is `google.protobuf.Empty`. If the original method is standard `Get`/`Create`/`Update`, the response should be the resource. For other methods, the response should have the type `XxxResponse`, where `Xxx` is the original method name. For example, if the original method name is `TakeSnapshot()`, the inferred response type is `TakeSnapshotResponse`.

---

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