Skip to content

Get a dataset commit's diff

GET
/datasets/{datasetId}/commits/{commitId}/diff
curl --request GET \
--url 'https://api.modeldesk.io/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/commits/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/diff?offset=0&limit=100' \
--header 'Authorization: Bearer <token>'

What one commit changed against its parent: the ids of the rows it added, changed and removed, and one page of those rows, each as it stood before and after with the columns that differ. A commit staged on a draft is read with that draft as ref, by its owner.

datasetId
required
string format: uuid
commitId
required
string format: uuid
ref
string format: uuid

A ref of the dataset to read at: the caller’s own draft, whose staged changes read as one commit each, or a branch. Without it, the main branch. Another user’s draft reads as not found.

offset
integer
0

How many touched rows to skip before the page.

limit
integer
default: 100 >= 1 <= 500

How many touched rows the page holds.

OK

Media typeapplication/json

What one commit changed against its parent, by row: the ids of every row it touched, and one page of those rows with both sides. The pages run over every touched row in row id order. A row that changed twice and came back to where it started shows in none of the three lists.

object
commitId
required
string format: uuid
parentCommitId

Absent for the first commit of a dataset.

string format: uuid
added
Array<string>
changed
Array<string>
removed
Array<string>
totals
DatasetDiffTotals

How many rows the diff added, changed and removed, over all its pages.

object
added
integer
changed
integer
removed
integer
offset

Where the page starts among all touched rows.

integer
rows
Array<object>

One row on both sides of a diff, whole: a reader names it by its naming column and shows the reason it gives beside a changed column, neither of which a change need touch.

object
rowId
required
string format: uuid
diffType
required
string
Allowed values: ADDED MODIFIED REMOVED
before

The row before; absent for a row the commit added.

object
rowId
required

The row’s stable identity, minted once and surviving every edit.

string format: uuid
values

Value-property source element id to the terms the row holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets it points at, for a property whose target type is represented by things the platform holds. Such a property holds these and never row references. Absent when the row holds none. A write that leaves platformRefs out keeps the ones the row holds, as a client that knows nothing of them writes every row; one that sends {} clears them. The two fields are told apart each on its own.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts the row holds inside itself, for a property whose target type has no identity of its own (a contact point, a period). Such a property holds parts and never row references. Absent when the row holds none. A write that leaves parts out keeps the parts the row holds, as a client that knows nothing of parts writes every row; one that sends it, empty included, leaves the row holding what it sent.

object
key
additional properties
Array<object>

One part a row holds inside itself: an occurrence of a containment property whose target type has no identity of its own. Its maps are keyed as a row’s are, and it holds parts of its own to whatever depth the model nests them.

object
partId

The part’s identity inside its row, so a change to one part is told from a change to another. Send it back unchanged on every write of the row; a part written without one gets a new one, and two parts of one row under one id are a 400.

string format: uuid
values

Value-property source element id to the terms the part holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets the part points at, for a property whose target type is represented by things the platform holds. A part is written whole, so a part sent without them holds none. Absent when the part holds none.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts this part holds.

object
key
additional properties
Array<object> recursive
after

The row after; absent for a row the commit removed.

object
rowId
required

The row’s stable identity, minted once and surviving every edit.

string format: uuid
values

Value-property source element id to the terms the row holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets it points at, for a property whose target type is represented by things the platform holds. Such a property holds these and never row references. Absent when the row holds none. A write that leaves platformRefs out keeps the ones the row holds, as a client that knows nothing of them writes every row; one that sends {} clears them. The two fields are told apart each on its own.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts the row holds inside itself, for a property whose target type has no identity of its own (a contact point, a period). Such a property holds parts and never row references. Absent when the row holds none. A write that leaves parts out keeps the parts the row holds, as a client that knows nothing of parts writes every row; one that sends it, empty included, leaves the row holding what it sent.

object
key
additional properties
Array<object>

One part a row holds inside itself: an occurrence of a containment property whose target type has no identity of its own. Its maps are keyed as a row’s are, and it holds parts of its own to whatever depth the model nests them.

object
partId

The part’s identity inside its row, so a change to one part is told from a change to another. Send it back unchanged on every write of the row; a part written without one gets a new one, and two parts of one row under one id are a 400.

string format: uuid
values

Value-property source element id to the terms the part holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets the part points at, for a property whose target type is represented by things the platform holds. A part is written whole, so a part sent without them holds none. Absent when the part holds none.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts this part holds.

object
key
additional properties
Array<object> recursive
changedColumns

The value, reference and part columns, by source element id, whose content differs, a part column where any of its parts differs at any depth; every column the row holds for an added or removed row. The parts of both sides are whole on before and after, to be paired by partId.

Array<string>
referenced

The rows of this dataset the page’s references point at, by row id, as the commit holds them, else as its parent did, so a reference is named without a second read.

object
key
additional properties

One entry of a dataset. Both maps are keyed by the data schema’s source element ids, never by a name: the element id is what survives a rename, and it is what lets a model mapping induce a dataset migration later.

object
rowId
required

The row’s stable identity, minted once and surviving every edit.

string format: uuid
values

Value-property source element id to the terms the row holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets it points at, for a property whose target type is represented by things the platform holds. Such a property holds these and never row references. Absent when the row holds none. A write that leaves platformRefs out keeps the ones the row holds, as a client that knows nothing of them writes every row; one that sends {} clears them. The two fields are told apart each on its own.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts the row holds inside itself, for a property whose target type has no identity of its own (a contact point, a period). Such a property holds parts and never row references. Absent when the row holds none. A write that leaves parts out keeps the parts the row holds, as a client that knows nothing of parts writes every row; one that sends it, empty included, leaves the row holding what it sent.

object
key
additional properties
Array<object>

One part a row holds inside itself: an occurrence of a containment property whose target type has no identity of its own. Its maps are keyed as a row’s are, and it holds parts of its own to whatever depth the model nests them.

object
partId

The part’s identity inside its row, so a change to one part is told from a change to another. Send it back unchanged on every write of the row; a part written without one gets a new one, and two parts of one row under one id are a 400.

string format: uuid
values

Value-property source element id to the terms the part holds for it.

object
key
additional properties
Array
refs

Reference-property source element id to the rows it points at.

object
key
additional properties
Array<object>

A pointer to a row, in this dataset or in one this dataset declares a dependency on.

object
datasetId
required
string format: uuid
rowId
required
string format: uuid
platformRefs

Reference-property source element id to the models, model elements and datasets the part points at, for a property whose target type is represented by things the platform holds. A part is written whole, so a part sent without them holds none. Absent when the part holds none.

object
key
additional properties
Array<object>

A pointer to a thing the platform holds: a model, an element of a model, or a dataset. A model or element is read at the state the dataset pins the model at; a dataset as it stands.

object
kind
required
string
Allowed values: MODEL ELEMENT DATASET
resourceId
required

The model, for a model or an element; the dataset, for a dataset.

string format: uuid
elementId

The element of the model; present exactly for an ELEMENT.

string format: uuid
parts

Containment-property source element id to the parts this part holds.

object
key
additional properties
Array<object> recursive

Example

{
"rows": [
{
"diffType": "ADDED",
"before": {
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
},
"parts": {
"additionalProperty": [
{
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
}
}
]
}
},
"after": {
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
},
"parts": {
"additionalProperty": [
{
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
}
}
]
}
}
}
],
"referenced": {
"additionalProperty": {
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
},
"parts": {
"additionalProperty": [
{
"platformRefs": {
"additionalProperty": [
{
"kind": "MODEL"
}
]
}
}
]
}
}
}
}

The commit belongs to another dataset

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}

Dataset or commit not found

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}

Error

Media typeapplication/problem+json

An RFC 9457 problem document, always sent as application/problem+json.

object
type

Present only on a typed refusal, whose own schema requires it and fixes its value. An untyped problem omits it, which RFC 9457 defines as about:blank: the status and title are all there is to branch on.

string format: uri
title
required
string
status
required
integer
detail
required
string
instance

The path of the request that was refused. Absent when the request was refused before it reached the application’s handlers: a 401 for a missing or unusable access token, and a 403 for a service account whose scopes do not reach the route.

string
violations

Present on a 400 raised by request-body validation, and on a 422 that refuses named fields (a malformed slug or namespace prefix). Each entry names the rejected property, so a client can attach the message to the field that caused it rather than showing one error for the whole form.

Array<object>
object
property
required
string
message
required
string

Example generated

{
"type": "https://example.com",
"title": "example",
"status": 1,
"detail": "example",
"instance": "example",
"violations": [
{
"property": "example",
"message": "example"
}
]
}