# Update the access level of a document share.

`PUT /api/plugins/docs/documents/{id}/shares/{shareId}`

Authentication: no security requirement declared for this operation.

Parameters:

- `id` (path, string, required)
  Type: string

- `shareId` (path, string, required)
  Type: string

Request body: application/json (required)

Type: object

Schema: [UpdateDocumentShareDTO](https://sourcey-gauzy.pages.dev/api-reference/models/updatedocumentsharedto/index.md)

- `access` (required)
  Type: string
  
  enum: ["VIEW","COMMENT","EDIT"]

Responses:

- 200: Share updated successfully.

Content type: application/json

Type: object

Schema: [DocumentShare](https://sourcey-gauzy.pages.dev/api-reference/models/documentshare/index.md)

- `deletedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `createdAt` (optional)
  Type: string, date-time
  
  The creation timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `updatedAt` (optional)
  Type: string, date-time
  
  The last update timestamp of the entity.
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `id` (optional)
  Type: string

- `isActive` (optional)
  Type: boolean
  
  default: true

- `isArchived` (optional)
  Type: boolean
  
  default: false

- `archivedAt` (optional)
  Type: string, date-time
  
  Example:
  
  ```json
  "2018-11-21T06:20:32.232Z"
  ```

- `tenantId` (optional)
  Type: string

- `organizationId` (optional)
  Type: string

- `access` (required)
  Type: string
  
  enum: ["VIEW","COMMENT","EDIT"]

- `documentId` (required)
  Type: string

- `employeeId` (optional)
  Type: string

- `teamId` (optional)
  Type: string

- 404: Share not found on this document.

## Examples

### cURL

```bash
curl -X PUT 'http://localhost:3000/api/plugins/docs/documents/string/shares/string' \
  -H 'Content-Type: application/json' \
  --data-raw '{
  "access": "VIEW"
}'
```

### JavaScript

```javascript
const body = `{
  "access": "VIEW"
}`;

const response = await fetch('http://localhost:3000/api/plugins/docs/documents/string/shares/string', {
  method: 'PUT',
  headers: {
    'Content-Type': 'application/json',
  },
  body,
});

const data = await response.text();
```

### Python

```python
import requests

body = '''{
  "access": "VIEW"
}'''

response = requests.put(
    'http://localhost:3000/api/plugins/docs/documents/string/shares/string',
    data=body.encode('utf-8'),
    headers={
        'Content-Type': 'application/json',
    },
)
print(response.text)
```
