# Method: sessions.create

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

Generates a new session during which the user can pick photos and videos for third-party access.

If the user doesn't have an active Google Photos account, a `FAILED_PRECONDITION` error is returned.

If the client application creates too many sessions per user, a `RESOURCE_EXHAUSTED` error is returned. Clients are unlikely to reach these limits under normal circumstances. However, clients are still recommended to call `sessions.delete` after each session, to proactively stay within resource limits.

Once [a user taps the **Done**](https://developers.google.com/photos/picker/guides/picking-experience#done_screen) button to complete a picking session, the `pickerUri` will no longer work. Create a new session to allow the user to pick more photos.

### HTTP request

`POST https://photospicker.googleapis.com/v1/sessions`

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 ID is used to enable the streamlined picking experience for applications using the OAuth 2.0 flow for limited-input devices. 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/picker/reference/rest/v1/sessions#PickingSession`.

### Response body

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

### Authorization scopes

Requires the following OAuth scope:

- `https://www.googleapis.com/auth/photospicker.mediaitems.readonly`