Update datafile
update_datafileUpdate a datafile. This is a partial update at the FIELD level: only the arguments you provide change. Provide json to replace the WHOLE document (its property order is preserved verbatim); omit it to change only metadata. To change PART of an existing document, prefer patch_datafile — it sends just the edit and cannot lose a concurrent write. Use this tool when you are replacing the whole document anyway; both preserve property order. Sending json here means get_datafile, change the object you got back, then send it all — pass expected_content_sha256 with that round trip so a change you did not see is reported instead of overwritten. Republish to push the change to the CDN.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | No | Replacement JSON object for this datafile. Omit to leave the content unchanged. Property order is preserved verbatim. | |
| schema_id | No | Id of the schema this datafile's JSON is validated against. Omit to leave the current binding unchanged. | |
| datafile_id | Yes | The datafile id to update. | |
| description | No | What this datafile holds. Omit to leave unchanged. | |
| display_name | No | Human-readable name. Omit to leave unchanged. | |
| use_latest_schema | No | Validate against the latest (draft) schema version instead of the published one. Only applied when schema_id is also provided. | |
| expected_content_sha256 | No | The content_sha256 from the get/create/update that gave you the content you edited. When set, the update is rejected (FAILED_PRECONDITION) if the stored content changed since — do NOT retry the same json, because it was built from a document that no longer exists: get_datafile again, re-apply your change to the content you just read, and send that with the new content_sha256. Omit for a blind overwrite, which is fine when nothing else writes this datafile (e.g. content you just created). |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| json | No | ||
| slug | Yes | ||
| schema_id | No | ||
| datafile_id | Yes | ||
| description | Yes | ||
| display_name | Yes | ||
| content_sha256 | No | ||
| last_published_path | No |