Patch Dataset Schema
Merge a partial graph-model spec into the dataset’s stored graph schema.
Where PUT replaces the schema wholesale, PATCH upserts by name: each entity in entities is added if new, otherwise its fields are upserted by field name (a matching field is replaced whole, whatever its kind) and its scalars (description, primaryLabelField, indexFields, identityFields) overwritten only when sent. Removals apply after the upserts; options is shallow-merged. With no stored schema the patch is applied to an empty spec, so it behaves like PUT. Keys may be snake_case or camelCase.
Path Parameters
- dataset_id (UUID): UUID of the dataset (from GET /api/v1/datasets).
Request Parameters
- entities (List[EntitySpec]): Entities to add or update, keyed by name.
- removeEntities (List[str]): Entity names to drop after the upserts.
- removeFields (List[{entity, field}]): Fields to drop after the upserts.
- options (Optional[Dict]): Graph options to shallow-merge (e.g. autoTypeNodes).
- root (Optional[str]): Replace the root entity when sent.
Response
The merged document, in the shape GET /schema returns.
Error Codes
Error bodies are {"message": ...}.
- 404 Not Found: Dataset not found or no write permission.
- 422 Unprocessable Content: The merged schema is not a valid graph-model spec, a removed entity is still targeted by a relation, or a removal names an entity or field that is not in the schema. The message names the item.
Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
Body
Response
Successful Response
The response is of type Response Patch Dataset Schema Api V1 Datasets Dataset Id Schema Patch · object.