- [HTTP request](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#body.HTTP_TEMPLATE)
- [Path parameters](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#body.PATH_PARAMETERS)
- [Request body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#body.request_body)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#body.request_body.SCHEMA_REPRESENTATION)
- [Response body](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#body.response_body)
- [Authorization scopes](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#body.aspect)
- [IAM Permissions](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#body.aspect_1)
- [AccountAndRole](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#AccountAndRole)
  - [JSON representation](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#AccountAndRole.SCHEMA_REPRESENTATION)
- [ProjectRole](https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#ProjectRole)

Shares a notebook to other accounts.

### HTTP request

Choose an endpoint:
global us   
`POST https://discoveryengine.googleapis.com/v1alpha/{name=projects/*/locations/*/notebooks/*}:share`

<br />

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

### Path parameters

| Parameters ||
|---|---|
| `name` | `string` Required. Full resource name of `https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks#Notebook`, such as `projects/{project}/locations/{location}/notebooks/{notebookId}`. |

### Request body

The request body contains data with the following structure:

| JSON representation |
|---|
| ``` { "accountAndRoles": [ { object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#AccountAndRole`) } ], "notifyViaEmail": boolean } ``` |

| Fields ||
|---|---|
| `accountAndRoles[]` | ``object (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#AccountAndRole`)`` Required. The list of accounts and roles to share the notebook with. |
| `notifyViaEmail` | `boolean` Required. Whether to notify the shared users via email. |

### Response body

If successful, the response body is empty.

### Authorization scopes

Requires one of the following OAuth scopes:

- `https://www.googleapis.com/auth/cloud-platform`
- `https://www.googleapis.com/auth/discoveryengine.readwrite`
- `https://www.googleapis.com/auth/discoveryengine.serving.readwrite`

For more information, see the [Authentication Overview](https://docs.cloud.google.com/docs/authentication#authorization-gcp).

### IAM Permissions

Requires the following [IAM](https://cloud.google.com/iam/docs) permissions on the `name` resource:

- `discoveryengine.notebooks.getIamPolicy`
- `discoveryengine.notebooks.setIamPolicy`

For more information, see the [IAM documentation](https://cloud.google.com/iam/docs).

## AccountAndRole

Account and role information.

| JSON representation |
|---|
| ``` { "email": string, "role": enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#ProjectRole`) } ``` |

| Fields ||
|---|---|
| `email` | `string` Required. The email address associated with the account. |
| `role` | ``enum (`https://docs.cloud.google.com/gemini/enterprise/docs/reference/rest/v1alpha/projects.locations.notebooks/share#ProjectRole`)`` Required. The role in the notebook. |

## ProjectRole

The role of the project.

| Enums ||
|---|---|
| `PROJECT_ROLE_UNKNOWN` | Unknown role. |
| `PROJECT_ROLE_OWNER` | The user owns the project. |
| `PROJECT_ROLE_WRITER` | The user has writer permissions on the project. |
| `PROJECT_ROLE_READER` | The user has reader permissions on the project. |
| `PROJECT_ROLE_NOT_SHARED` | The user has no access to the project. |