# Update shared documents for a contact

URL: /en/docs/api/v1/contacts/id/documents/patch
Last Updated: 2026-07-30T21:15:30.511Z

## Description
No description available.

## Available Actions
- Execute PATCH request
- View request parameters
- View response schema
- Get code examples
- Navigate to related topics
- View step-by-step instructions
- Get best practices

## Content
### PATCH /api/v1/contacts/{id}/documents

**Update shared documents for a contact**

Update which documents are shared with a contact. This endpoint will:
- Add new document-contact relationships
- Remove existing relationships not in the provided list
- Automatically approve any pending access requests when all requested documents are shared
- Only allows sharing documents that belong to your tenant

**Authentication:** Bearer token (`Authorization: Bearer <token>`)

**Path parameters:**

| Name | Type | Required | Description |
|---|---|---|---|
| `id` | string | Yes | Contact ID |

**Request body** (`application/json`) - required:

- `ids` (array of string, required): Array of document IDs to share with the contact. Documents not in this list will be unshared.

Example (Share multiple documents with contact):

```json
{
  "ids": [
    "550e8400-e29b-41d4-a716-446655440001",
    "550e8400-e29b-41d4-a716-446655440002",
    "550e8400-e29b-41d4-a716-446655440003"
  ]
}
```

Example (Share compliance documentation):

```json
{
  "ids": [
    "550e8400-e29b-41d4-a716-446655440001",
    "550e8400-e29b-41d4-a716-446655440004"
  ]
}
```

Example (Remove all document access):

```json
{
  "ids": []
}
```

**Responses:**

- `200` - Documents updated successfully
  - `ok` (boolean)
- `400` - Bad Request - Contact ID is required
- `401` - Unauthorized - Tenant context missing
- `403` - Forbidden - Contact or documents do not belong to your tenant
- `405` - Method not allowed
- `500` - Internal server error

**Code samples:**

cURL:

```bash
curl -X PATCH "https://app.orbiqhq.com/api/v1/contacts/550e8400-e29b-41d4-a716-446655440000/documents" \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "ids": ["doc-123", "doc-456", "doc-789"]
  }'

```

