---
title: "Update Global Context Document"
method: PATCH
path: "/global-context/documents/{doc_id}"
tags: ["GTM Context"]
---

# Update Global Context Document

`PATCH /global-context/documents/{doc_id}`

## Request

- Base URL: `https://be.graph8.com/api/v1`
- URL: `https://be.graph8.com/api/v1/global-context/documents/{doc_id}`
- Auth: HTTP bearer

Update a Global Context (Studio) document's content and/or status.

Read-side counterpart already exists (``GET /global-context/documents``);
this closes the long-standing "read but can't update" gap for the Context
bucket. Each save creates a ``DocumentVersion`` snapshot, identical to the
internal Studio editor — so version history stays consistent regardless of
whether the edit came from the UI, the developer API, or MCP.

Partial update: send ``content``, ``status``, or both. Returns 400 if
neither is provided, 404 if the document does not exist in this org.

Note: the Intelligence bucket (``cb_intelligence_data``) is intentionally
read-only — it is machine-generated and has no manual-edit path.

## Path parameters

- `doc_id` string, required: Global context document ID (UUID)

## Headers

- `Authorization` string, nullable
- `X-Target-Org-Id` string, nullable

## Request body

- UpdateGlobalContextRequest: Body for PATCH /global-context/documents/{doc_id}. Partial update: send only the fields you want to change. At least one of ``content`` / ``status`` must be present.
  - `content` string, nullable: New document body. Stored at meta_data.content. Omit to leave unchanged.
  - `status` string, nullable: New document status (e.g. 'completed', 'draft'). Omit to leave unchanged.

## Response `200`

Successful Response

- ApiResponseDict
  - `data` object, required
  - `pagination` PaginationMeta
    - `page` integer, required: Current page number (1-indexed)
    - `limit` integer, required: Items per page
    - `total` integer, required: Total number of items
    - `has_next` boolean, required: Whether there are more pages
    - `next_cursor` string, nullable: Opaque cursor for the next page; null when there are no more items. Pass it back as the `cursor` query param to fetch the following page without computing page numbers.
    - `total_available` integer, nullable: Search endpoints only: how many records really match, when known. Can be larger than `total`, which is capped at the 10,000 results that can be paged. For company search this is a distinct-company estimate. Null when unknown; absent outside search.
    - `total_is_lower_bound` boolean, nullable: Search endpoints only: true when more records match than `total` shows (the result set is larger than the 10,000 results that can be paged). Absent outside search.
    - `notes` string[], nullable: Search endpoints only: plain-language notes about the result, e.g. that more records match than can be paged, or that a reversed `between` range was put in order.

## Other responses

- `422`: Validation Error

---

[API](https://skmtc.dev/graph8/apis/graph8-developer-api.md) · [All operations](https://skmtc.dev/graph8/apis/graph8-developer-api/llms.txt) · [OpenAPI document](https://skmtc.dev/graph8/apis/graph8-developer-api/revisions/2e7cfa0ca921?raw)
