# Shares SDK Methods

> The soat.shares methods of the SOAT TypeScript SDK for the Shares module, each linked to its REST operation.

# Shares

SDK methods for the Shares module, accessed via `soat.shares`. See the [Shares module docs](/docs/modules/shares) for permissions and data model, and each method's REST page for the full request/response schema.

### `soat.shares.createShare()`

Create a share

- Method: `POST`
- Path: `/api/v1/shares`

```ts
await soat.shares.createShare({
  body: { resource, actions, grantee, /* + optional */ },
});
```

→ [Request & response schema](/docs/api/shares/create-share)

### `soat.shares.listShares()`

List shares

- Method: `GET`
- Path: `/api/v1/shares`

```ts
await soat.shares.listShares({
  query: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/shares/list-shares)

### `soat.shares.getShare()`

Get a share

- Method: `GET`
- Path: `/api/v1/shares/{share_id}`

```ts
await soat.shares.getShare({
  path: { share_id },
  query: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/shares/get-share)

### `soat.shares.updateShare()`

Update a share

- Method: `PATCH`
- Path: `/api/v1/shares/{share_id}`

```ts
await soat.shares.updateShare({
  path: { share_id },
  body: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/shares/update-share)

### `soat.shares.deleteShare()`

Delete a share

- Method: `DELETE`
- Path: `/api/v1/shares/{share_id}`

```ts
await soat.shares.deleteShare({
  path: { share_id },
});
```

→ [Request & response schema](/docs/api/shares/delete-share)

### `soat.shares.acceptShare()`

Accept a share

- Method: `POST`
- Path: `/api/v1/shares/{share_id}/accept`

```ts
await soat.shares.acceptShare({
  path: { share_id },
  body: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/shares/accept-share)

### `soat.shares.suspendShare()`

Suspend a share

- Method: `POST`
- Path: `/api/v1/shares/{share_id}/suspend`

```ts
await soat.shares.suspendShare({
  path: { share_id },
});
```

→ [Request & response schema](/docs/api/shares/suspend-share)

### `soat.shares.resumeShare()`

Resume a share

- Method: `POST`
- Path: `/api/v1/shares/{share_id}/resume`

```ts
await soat.shares.resumeShare({
  path: { share_id },
});
```

→ [Request & response schema](/docs/api/shares/resume-share)

### `soat.shares.revokeShare()`

Revoke a share

- Method: `POST`
- Path: `/api/v1/shares/{share_id}/revoke`

```ts
await soat.shares.revokeShare({
  path: { share_id },
  query: { /* + optional */ },
  body: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/shares/revoke-share)

### `soat.shares.listShareReferences()`

List a grantee's references to a shared resource

- Method: `GET`
- Path: `/api/v1/shares/{share_id}/references`

```ts
await soat.shares.listShareReferences({
  path: { share_id },
  query: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/shares/list-share-references)

### `soat.shares.listShareAcceptances()`

List a share's acceptances

- Method: `GET`
- Path: `/api/v1/shares/{share_id}/acceptances`

```ts
await soat.shares.listShareAcceptances({
  path: { share_id },
  query: { /* + optional */ },
});
```

→ [Request & response schema](/docs/api/shares/list-share-acceptances)

### `soat.shares.revokeShareAcceptance()`

Revoke an acceptance

- Method: `POST`
- Path: `/api/v1/shares/{share_id}/acceptances/{acceptance_id}/revoke`

```ts
await soat.shares.revokeShareAcceptance({
  path: { share_id, acceptance_id },
});
```

→ [Request & response schema](/docs/api/shares/revoke-share-acceptance)

### `soat.shares.deleteShareAcceptance()`

Delete an acceptance

- Method: `DELETE`
- Path: `/api/v1/shares/{share_id}/acceptances/{acceptance_id}`

```ts
await soat.shares.deleteShareAcceptance({
  path: { share_id, acceptance_id },
});
```

→ [Request & response schema](/docs/api/shares/delete-share-acceptance)
