refresh date: 2026-09-25
robots: noindex

<br />

> [!NOTE]
> **Important:** This API works **only on ChromeOS**.

<br />

<br />

## Description

Use the `chrome.enterprise.deviceAttributes` API to read device attributes. Note: This API is only available to extensions force-installed by enterprise policy.

<br />

<br />

## Permissions

`enterprise.deviceAttributes`  

<br />

<br />

## Availability

Chrome 46+ ChromeOS only [Requires policy](https://support.google.com/chrome/a/answer/9296680)

<br />

<br />

> [!NOTE]
> **Note:** This API is only for **[extensions pre-installed by a policy](https://support.google.com/chrome/a/answer/1375694)**.

<br />

## Methods

### getDeviceAnnotatedLocation()

Promise Chrome 66+

```typescript
chrome.enterprise.deviceAttributes.getDeviceAnnotatedLocation(
  callback?: function,
): Promise<string>
```

Fetches the administrator-annotated Location. If the current user is not affiliated or no Annotated Location has been set by the administrator, returns an empty string.

#### Parameters

- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (annotatedLocation: string) => void
  ```

  <br />

  - annotatedLocation string

#### Returns

- Promise\<string\>
  Chrome 96+

  Returns a Promise which resolves with the Annotated Location of the device.


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### getDeviceAssetId()

Promise Chrome 66+

```typescript
chrome.enterprise.deviceAttributes.getDeviceAssetId(
  callback?: function,
): Promise<string>
```

Fetches the administrator-annotated Asset Id. If the current user is not affiliated or no Asset Id has been set by the administrator, returns an empty string.

#### Parameters

- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (assetId: string) => void
  ```

  <br />

  - assetId string

#### Returns

- Promise\<string\>
  Chrome 96+

  Returns a Promise which resolves with the Asset ID of the device.


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### getDeviceHostname()

Promise Chrome 82+

```typescript
chrome.enterprise.deviceAttributes.getDeviceHostname(
  callback?: function,
): Promise<string>
```

Fetches the device's hostname as set by DeviceHostnameTemplate policy. If the current user is not affiliated or no hostname has been set by the enterprise policy, returns an empty string.

#### Parameters

- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (hostname: string) => void
  ```

  <br />

  - hostname string

#### Returns

- Promise\<string\>
  Chrome 96+

  Returns a Promise which resolves with the hostname of the device.


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### getDeviceSerialNumber()

Promise Chrome 66+

```typescript
chrome.enterprise.deviceAttributes.getDeviceSerialNumber(
  callback?: function,
): Promise<string>
```

Fetches the device's serial number. Please note the purpose of this API is to administrate the device (e.g. generating Certificate Sign Requests for device-wide certificates). This API may not be used for tracking devices without the consent of the device's administrator. If the current user is not affiliated, returns an empty string.

#### Parameters

- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (serialNumber: string) => void
  ```

  <br />

  - serialNumber string

#### Returns

- Promise\<string\>
  Chrome 96+

  Returns a Promise which resolves with the serial number of the device.


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

### getDirectoryDeviceId()

Promise

```typescript
chrome.enterprise.deviceAttributes.getDirectoryDeviceId(
  callback?: function,
): Promise<string>
```

Fetches the value of [the device identifier of the directory API](https://developers.google.com/admin-sdk/directory/v1/guides/manage-chrome-devices), that is generated by the server and identifies the cloud record of the device for querying in the cloud directory API. If the current user is not affiliated, returns an empty string.

#### Parameters

- callback function optional


  The `callback` parameter looks like:

  ```typescript
  (deviceId: string) => void
  ```

  <br />

  - deviceId string

#### Returns

- Promise\<string\>
  Chrome 96+

  Returns a Promise which resolves with the device identifier of the directory API.


  Promises are only supported for Manifest V3 and later, other platforms need to use callbacks.

<br />