---
title: "Update a context's settings."
method: PATCH
path: "/api/contexts/{name}"
tags: ["Contexts"]
---

# Update a context's settings.

`PATCH /api/contexts/{name}`

## Request

- Base URL: `/` (relative, and the document was published on a file host, not at the API’s origin)
- URL: `/api/contexts/{name}`
- Auth: HTTP bearer

Changes a context's entityTypeDisambiguation, disambiguationScope, and ledger settings, given in the body. Only the settings given change; one left out keeps its current value. Recorded as a context_updated audit event naming each setting that changed. Requires the `contexts:write` scope.

## Path parameters

- `name` string, required

## Query parameters

- `owner` string

## Headers

- `Authorization` string, required

## Request body

- UpdateContextRequest
  - `disambiguationScope` 'document' | 'context': Whether span disambiguation learns within each document (document) or across every document redacted in the context (context).
  - `entityTypeDisambiguation` boolean: Whether to apply entity-type span disambiguation.
  - `ledger` boolean: Whether to record redactions in the ledger.

## Response `200`

The context was updated.

- GenericResponse
  - `field` string: For a request refused as invalid, the parameter or body field that was invalid, when one is.
  - `message` string: What happened, written for a person to read. It may change; use reason in code.
  - `reason` string: For an error, why the request was refused, as a stable code a client can act on. The codes are listed in the API documentation under Errors.

## Other responses

- `400`: No setting was given, disambiguationScope is not document or context, or a setting was given as a query parameter.
- `401`: Unauthorized
- `403`: Insufficient scope, disabled API, or access denied.
- `404`: Context not found.
- `406`: No representation matches Accept.
- `413`: Content Too Large
- `415`: Unsupported Media Type
- `500`: Internal Server Error
- `503`: Service Unavailable

## Changes

- **2026-10-17** `b74c9f3c33ee`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/philterd/apis/philter-api/changes/api/contexts/:name/patch.md)

---

[API](https://skmtc.dev/philterd/apis/philter-api.md) - [All operations](https://skmtc.dev/philterd/apis/philter-api/llms.txt) - [OpenAPI document](https://skmtc.dev/philterd/apis/philter-api/revisions/aa3d7ad1aab4?raw)
