# Update Knowledge Hub Document Share Settings

`PATCH /api/knowledge/documents/hub-documents/{document_id}/share`

### Overview
Updates collaborative sharing policy, permission levels, expiration, and user/group grantees. Returns warning if agent attachments are revoked.

### Authentication & Headers
- **Auth**: Bearer Token (Owner or Admin L1; rejected for Auditor)
- **Required Header**: `API-Version: 1`

## Parameters

| Name | In | Type | Required | Description |
| --- | --- | --- | --- | --- |
| `document_id` | path | string | yes | Unique UUID of the knowledge document stored in the vector database. |

## Request body

Content type: `application/json`

```json
{}
```

## Responses

### 200 — Updated document share configuration and affected agents

### 400 — Bad Request - The request parameters or headers are invalid (e.g. unsupported API-Version).

### 401 — Unauthorized - Missing, invalid, or expired JWT Bearer token.

### 403 — Forbidden (Auditor read-only or not owner/admin)

### 404 — Not Found - The requested resource ID was not found.

### 422 — Invalid expiration option or invalid recipient IDs

| Field | Type | Required | Description |
| --- | --- | --- | --- |
| `detail` | object[] | no |  |
| `detail[].loc` | string | integer[] | yes |  |
| `detail[].msg` | string | yes |  |
| `detail[].type` | string | yes |  |
| `detail[].input` | object | no |  |
| `detail[].ctx` | object | no |  |

```json
{
  "detail": [
    {
      "loc": [
        null
      ],
      "msg": "string",
      "type": "string",
      "input": null,
      "ctx": {}
    }
  ]
}
```

## Example

```bash
curl -X PATCH "$PINTER_URL/api/knowledge/documents/hub-documents/doc_it_guidelines_2026/share" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{}'
```
