Diff Version
Versions
Diff Version
GET /v0/artifacts//versions//diff — Diff a version against the previous version
GET
Diff Version
Retrieve the difference between a version and the version immediately before it. Text artifacts (
Text payload (
Rows payload (
markdown, html, code, text, json) return a word-level diff; csv artifacts return a row-level diff. This endpoint is publicly accessible — no authentication required.
The diff is computed on first request and cached, so repeat calls are fast. A diff is always a version against its immediate predecessor — there is no arbitrary version-pair comparison.
Path Parameters
| Parameter | Type | Required | Description |
|---|---|---|---|
publicId | string | Yes | The public ID of the artifact |
vid | string | Yes | The version ID to diff against its predecessor |
Example Request
Example Response
Response Fields
| Field | Type | Description |
|---|---|---|
versionId | string | The version that was diffed |
baseVersionId | string | null | The previous version it was compared against. null for the earliest version. |
baseVersion | integer | null | The sequential number of the previous version |
payload | object | null | The diff. null for the earliest version or a non-diffable type (chart, file, table). |
Text payload (strategy: "text")
| Field | Type | Description |
|---|---|---|
segments | array | Ordered runs of text, each with an op of equal, insert, or delete |
stats.added | integer | Number of inserted words |
stats.removed | integer | Number of removed words |
Rows payload (strategy: "rows")
| Field | Type | Description |
|---|---|---|
rows | array | Ordered CSV rows, each with an op of equal, insert, or delete |
stats.added | integer | Number of inserted rows |
stats.removed | integer | Number of removed rows |
Error Codes
| Error | Description |
|---|---|
NOT_FOUND | No artifact exists with the given publicId, or no version exists with the given vid on this artifact |