Skip to main content
PATCH
/
documents
/
{document_id}
/
access
/
metadata
Update Document Access Metadata
import requests

url = "https://app.ubik-agent.com/api/v1/documents/{document_id}/access/metadata"

payload = {
    "api_metadata": {},
    "external_user_id": "<string>"
}
headers = {
    "X-API-KEY": "<api-key>",
    "Content-Type": "application/json"
}

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

print(response.text)
{
  "detail": [
    {
      "loc": [
        "<string>"
      ],
      "msg": "<string>",
      "type": "<string>"
    }
  ]
}

Authorizations

X-API-KEY
string
header
required

Headers

X-End-User-ID
string | null

Path Parameters

document_id
string<uuid>
required

Body

application/json
api_metadata
Api Metadata · object
required

Custom JSON metadata. Useful for storing external system references (e.g., {'internal_app_ref': 'REF-123'}). This metadata is scoped: updates here apply only to the specified external_user_id (or globally if omitted). When fetching, specific user metadata overrides global metadata.

external_user_id
string | null

The external user ID to update. If omitted, updates the global access rule. Note: If the document was uploaded/scoped to a specific user, you must provide that ID here to update their specific metadata.

Response

Successful Response