# ShareService

**Spinbox is experimental: APIs change and data may be lost.** What is built and what proves it is on [Status](https://spin-stack.github.io/website/reference/status.md); what Spinbox does not do is on [Limitations](https://spin-stack.github.io/website/overview/limitations.md).

> spin.v1.ShareService: each procedure, its request and its response.

<!-- Generated by tools/refgen from spin:internal/controlplane/apidocs/spin.v1.openapi.json. Edit the source, not this file. -->

ShareService manages snapshot sharing. Snapshots can be shared with specific users or made public. Users can create new workspaces from shared snapshots.

## ListSharedSnapshots

`POST /spin.v1.ShareService/ListSharedSnapshots`

List snapshots shared with the current user (or public)

**Request**

| Field | Type | What it is |
|---|---|---|
| `includePublic` | boolean | false: only what was shared with the caller |
| `page` | [PageRequest](https://spin-stack.github.io/website/reference/api/types.md#pagerequest) |  |

**Response**

| Field | Type | What it is |
|---|---|---|
| `snapshots` | list of [Snapshot](https://spin-stack.github.io/website/reference/api/types.md#snapshot) | Uses Snapshot from workspace.proto |
| `page` | [PageResponse](https://spin-stack.github.io/website/reference/api/types.md#pageresponse) |  |

## ListSnapshotShares

`POST /spin.v1.ShareService/ListSnapshotShares`

List users who have access to a snapshot

**Request**

| Field | Type | What it is |
|---|---|---|
| `snapshotId` | string |  |
| `page` | [PageRequest](https://spin-stack.github.io/website/reference/api/types.md#pagerequest) |  |

**Response**

| Field | Type | What it is |
|---|---|---|
| `shares` | list of [SnapshotShare](https://spin-stack.github.io/website/reference/api/types.md#snapshotshare) |  |
| `page` | [PageResponse](https://spin-stack.github.io/website/reference/api/types.md#pageresponse) |  |
| `outsideTeam` | [OutsideShareState](https://spin-stack.github.io/website/reference/api/types.md#outsidesharestate) | outside_team is the snapshot's share outside its team: what a clone by somebody of another team stands on, made when the snapshot is first shared outside the team or made public. A clone of it outside the team is refused until it is ready. |

## SetSnapshotVisibility

`POST /spin.v1.ShareService/SetSnapshotVisibility`

Set snapshot visibility (public/private)

**Request**

| Field | Type | What it is |
|---|---|---|
| `snapshotId` | string |  |
| `public` | boolean |  |
| `acknowledgeFindings` | boolean | As ShareSnapshotRequest's: making a snapshot public gives everybody a copy of its files. |

**Response**

| Field | Type | What it is |
|---|---|---|
| `public` | boolean |  |

## ShareSnapshot

`POST /spin.v1.ShareService/ShareSnapshot`

Share a snapshot with a specific user

**Request**

| Field | Type | What it is |
|---|---|---|
| `snapshotId` | string |  |
| `email` | string | Email of user to share with |
| `acknowledgeFindings` | boolean | acknowledge_findings shares a snapshot whose files hold what looks like credentials. Without it such a share is refused, FAILED_PRECONDITION with the SecretFindings as a detail: whoever it is shared with gets a copy of those files. |

**Response**

No fields: `{}`.

## UnshareSnapshot

`POST /spin.v1.ShareService/UnshareSnapshot`

Remove a user's access to a snapshot

**Request**

| Field | Type | What it is |
|---|---|---|
| `snapshotId` | string |  |
| `userId` | string |  |

**Response**

No fields: `{}`.
