---
title: "Update external sharing"
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.sureshake.com/llms.txt
> Use this file to discover all available pages before exploring further.

Path: Sureshake API › entities

`PATCH /v2/entities/{entityId}/collections/{id}/external-sharing`

## Path parameters

- `entityId` (`collection-update-external-sharing.path.entityId`; string, required)
  - format `uuid`
- `id` (`collection-update-external-sharing.path.id`; string, required)
  - format `uuid`

## Request body

_Required._

- `enabled` (`collection-update-external-sharing.enabled`; boolean, required)
- `confirmed` (`collection-update-external-sharing.confirmed`; boolean, required)
  - one of `true`
- `reason` (`collection-update-external-sharing.reason`; string, optional)
  - minLength 1; maxLength 500

## Example request

```json
{
  "enabled": true,
  "confirmed": true,
  "reason": "string"
}
```

## Code samples

### cURL

```bash
curl --request PATCH \
  --url 'https://api.sureshake.com/v2/entities/<entityId>/collections/<id>/external-sharing' \
  --header 'Content-Type: application/json' \
  --data '
{
  "enabled": true,
  "confirmed": true,
  "reason": "string"
}
'
```

### TypeScript

```typescript
const url = 'https://api.sureshake.com/v2/entities/<entityId>/collections/<id>/external-sharing';
const options = {
  method: 'PATCH',
  headers: {'Content-Type': 'application/json'},
  body: JSON.stringify({enabled: true, confirmed: true, reason: 'string'})
};

fetch(url, options)
  .then(res => res.json())
  .then(json => console.log(json))
  .catch(err => console.error(err));
```

### Python

```python
import requests

url = "https://api.sureshake.com/v2/entities/<entityId>/collections/<id>/external-sharing"

payload = {
    "enabled": True,
    "confirmed": True,
    "reason": "string"
}
headers = {"Content-Type": "application/json"}

response = requests.patch(url, json=payload, headers=headers)

print(response.text)
```

## Responses

### 200

Default Response

#### Example

```json
{
  "data": {
    "collectionId": "0ffe69e2-b7af-4b1e-835c-867376165f50",
    "enabled": true,
    "changed": true,
    "effect": "external_access_enabled",
    "updatedAt": "2019-08-24T14:15:22Z"
  },
  "meta": {
    "timestamp": "2019-08-24T14:15:22Z"
  }
}
```

- `data` (`collection-update-external-sharing.response.200.data`; object, required)
  - `collectionId` (`collection-update-external-sharing.response.200.data.collectionId`; string, required)
    - format `uuid`
  - `enabled` (`collection-update-external-sharing.response.200.data.enabled`; boolean, required)
  - `changed` (`collection-update-external-sharing.response.200.data.changed`; boolean, required)
  - `effect` (`collection-update-external-sharing.response.200.data.effect`; string, required)
    - one of `"external_access_enabled"`, `"external_access_suspended_tokens_not_revoked"`, `"unchanged"`
  - `updatedAt` (`collection-update-external-sharing.response.200.data.updatedAt`; string, required)
    - format `date-time`
- `meta` (`collection-update-external-sharing.response.200.meta`; object, optional)
  - `timestamp` (`collection-update-external-sharing.response.200.meta.timestamp`; string, required)
    - format `date-time`

### 400

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`collection-update-external-sharing.response.400.error`; object, required)
  - `code` (`collection-update-external-sharing.response.400.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`collection-update-external-sharing.response.400.error.message`; string, required) — Human-readable error message
  - `details` (`collection-update-external-sharing.response.400.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`collection-update-external-sharing.response.400.error.traceId`; string, optional) — Unique ID for log correlation

### 401

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`collection-update-external-sharing.response.401.error`; object, required)
  - `code` (`collection-update-external-sharing.response.401.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`collection-update-external-sharing.response.401.error.message`; string, required) — Human-readable error message
  - `details` (`collection-update-external-sharing.response.401.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`collection-update-external-sharing.response.401.error.traceId`; string, optional) — Unique ID for log correlation

### 403

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`collection-update-external-sharing.response.403.error`; object, required)
  - `code` (`collection-update-external-sharing.response.403.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`collection-update-external-sharing.response.403.error.message`; string, required) — Human-readable error message
  - `details` (`collection-update-external-sharing.response.403.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`collection-update-external-sharing.response.403.error.traceId`; string, optional) — Unique ID for log correlation

### 404

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`collection-update-external-sharing.response.404.error`; object, required)
  - `code` (`collection-update-external-sharing.response.404.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`collection-update-external-sharing.response.404.error.message`; string, required) — Human-readable error message
  - `details` (`collection-update-external-sharing.response.404.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`collection-update-external-sharing.response.404.error.traceId`; string, optional) — Unique ID for log correlation

### 409

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`collection-update-external-sharing.response.409.error`; object, required)
  - `code` (`collection-update-external-sharing.response.409.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`collection-update-external-sharing.response.409.error.message`; string, required) — Human-readable error message
  - `details` (`collection-update-external-sharing.response.409.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`collection-update-external-sharing.response.409.error.traceId`; string, optional) — Unique ID for log correlation

### 500

Default Response

#### Example

```json
{
  "error": {
    "code": "string",
    "message": "string",
    "details": null,
    "traceId": "string"
  }
}
```

- `error` (`collection-update-external-sharing.response.500.error`; object, required)
  - `code` (`collection-update-external-sharing.response.500.error.code`; string, required) — Machine-readable error code (e.g., NOT_FOUND)
  - `message` (`collection-update-external-sharing.response.500.error.message`; string, required) — Human-readable error message
  - `details` (`collection-update-external-sharing.response.500.error.details`; unknown, optional) — Optional structured error details
  - `traceId` (`collection-update-external-sharing.response.500.error.traceId`; string, optional) — Unique ID for log correlation


Source: https://docs.sureshake.com/reference/collection-update-external-sharing/index.md
