# IRPCSharedLinks.AddSharedLinkRecipients

Location: [gRPC API](https://developer.m-files.com/APIs/gRPC-API/index.md) > [Vault API](https://developer.m-files.com/APIs/gRPC-API/vault/index.md) > [Shared links](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinks/index.md)

HTML version: https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinks/AddSharedLinkRecipients/

Badges: `Vault API / standard` `write` `session or assertion` `returns metadata structure version`

Adds visitors (email recipients) to an external or visitor link and returns all its recipients.

- **Service:** [Shared links](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinks/index.md) `MFiles.IRPCSharedLinks`
- **gRPC method:** `/MFiles.IRPCSharedLinks/AddSharedLinkRecipients`
- **HTTP (mf-http-grpc):** `POST /grpc/v1/add-shared-link-recipients`
- **Request:** [`AddSharedLinkRecipientsRequest`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinks/AddSharedLinkRecipients/index.md#request)
- **Response:** [`AddSharedLinkRecipientsResponse`](https://developer.m-files.com/APIs/gRPC-API/Reference/MFiles.IRPCSharedLinks/AddSharedLinkRecipients/index.md#response)
- **Book and level:** Vault API, standard
- **Kind:** write
- **Session:** Required: a session (mfiles-session-id-bin metadata) or a session assertion (x-mf-session-assertion metadata).
- **Idempotent:** no
- **Returns metadata structure version:** yes (in the mfiles-metadata-version-bin trailer)
- **Streaming:** none (unary)

<a id="remarks"></a>

## Remarks

- The link must be an external or visitor link; other types fail with "The parameter is
  incorrect.". `emails` must not be empty.
- Each entry is an email address, optionally in mailbox form (`Name <address@example.com>`). An
  invalid address fails the call with the invalid email address error (0x80040811), which has no
  description text.
- Recipients that the caller has already added are skipped. This call does not email the
  recipients.
- The creator of the link must still have read access to the object.
- Side effect: the expiration time of the link itself is set to 23:59 UTC on the Sunday about 12
  weeks ahead. Recipients keep their own expiration times.
- The response lists all recipients that the caller can see, not just the added ones.

<a id="request"></a>

## Request: AddSharedLinkRecipientsRequest

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `access_key` | `string` | The access key of an external or visitor link. |
| `emails[]` | repeated `string` | The recipient addresses, optionally as `Name <address>`. |
| `expires_at_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The expiration time for the added recipients. Unset for no expiration. |
| `external_shared_link_access_type` | [`ExternalSharedLinkAccessType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ExternalSharedLinkAccessType/index.md) | What the added recipients may do with the file. Values: `EXTERNAL_SHARED_LINK_ACCESS_TYPE_UNINITIALIZED` (0), `EXTERNAL_SHARED_LINK_ACCESS_TYPE_DOWNLOAD` (1), `EXTERNAL_SHARED_LINK_ACCESS_TYPE_PREVIEW` (2), `EXTERNAL_SHARED_LINK_ACCESS_TYPE_EDIT` (3). |

<a id="response"></a>

## Response: AddSharedLinkRecipientsResponse

> Nested message fields are expanded to depth 3; follow a type link for deeper levels and for the type's own page.

| Field | Type | Description |
|---|---|---|
| `recipients[]` | repeated [`SharedLinkRecipient`](https://developer.m-files.com/APIs/gRPC-API/Reference/Messages/MFiles.SharedLinkRecipient/index.md) | All recipients of the link that the caller can see. |
| `recipients[].email` | `string` | The recipient email. |
| `recipients[].access_time` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The access time for the shared link. Is set by the server. |
| `recipients[].created_by_user` | `int32` | The creator of this shared Link. |
| `recipients[].shared_link_notification` | [`SharedLinkNotification`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.SharedLinkNotification/index.md) | Shared link notification type. Values: `SHARED_LINK_NOTIFICATION_NONE` (0), `SHARED_LINK_NOTIFICATION_ALWAYS` (1). |
| `recipients[].expires_at_utc` | [`google.protobuf.Timestamp`](https://protobuf.dev/reference/protobuf/google.protobuf/#timestamp) | The expiration time for the shared link. Use FILETIME_ZERO to indicate no expiration time. |
| `recipients[].external_shared_link_access_type` | [`ExternalSharedLinkAccessType`](https://developer.m-files.com/APIs/gRPC-API/Reference/Enums/MFiles.ExternalSharedLinkAccessType/index.md) | The access type of the recipient. Values: `EXTERNAL_SHARED_LINK_ACCESS_TYPE_UNINITIALIZED` (0), `EXTERNAL_SHARED_LINK_ACCESS_TYPE_DOWNLOAD` (1), `EXTERNAL_SHARED_LINK_ACCESS_TYPE_PREVIEW` (2), `EXTERNAL_SHARED_LINK_ACCESS_TYPE_EDIT` (3). |
| `recipients[].created_by_user_name` | `string` | The user who created the shared link. |
