# Method: devices.create

- [HTTP request](https://developers.google.com/photos/ambient/reference/rest/v1/devices/create#body.HTTP_TEMPLATE)
- [Query parameters](https://developers.google.com/photos/ambient/reference/rest/v1/devices/create#body.QUERY_PARAMETERS)
- [Request body](https://developers.google.com/photos/ambient/reference/rest/v1/devices/create#body.request_body)
- [Response body](https://developers.google.com/photos/ambient/reference/rest/v1/devices/create#body.response_body)
- [Authorization scopes](https://developers.google.com/photos/ambient/reference/rest/v1/devices/create#body.aspect)
- [Try it!](https://developers.google.com/photos/ambient/reference/rest/v1/devices/create#try-it)

Creates an ambient device in the user's Google Photos account.

If a device with the provided `requestId` already exists, an `ALREADY_EXISTS` error is returned. To help prevent duplicate devices, do the following:

- If you know the `deviceId` of the existing device, call `devices.get` to retrieve it.
- If you don't know the `deviceId`, call `devices.delete` with the `requestId` to remove the orphaned device before retrying this method.

You may create up to 100 devices per user of your app. If that limit is exceeded, a `RESOURCE_EXHAUSTED` error is returned.

### HTTP request

`POST https://photosambient.googleapis.com/v1/devices`

The URL uses [gRPC Transcoding](https://google.aip.dev/127) syntax.

### Query parameters

| Parameters ||
|---|---|
| `requestId` | `string` Optional. A client-provided unique identifier for this request. This is used to mitigate resource duplication in the event of a network failure. This ID must have the format of a UUID (version 4) string and follow these requirements: - Must not contain any sensitive identifying information about the user. - Must contain 32 hexadecimal characters divided into five groups separated by hyphens, in the format "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" (or 8-4-4-4-12). |

### Request body

The request body contains an instance of `https://developers.google.com/photos/ambient/reference/rest/v1/devices#AmbientDevice`.

### Response body

If successful, the response body contains a newly created instance of `https://developers.google.com/photos/ambient/reference/rest/v1/devices#AmbientDevice`.

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/photosambient.mediaitems`