Skip to content

Get your dataset draft

GET
/datasets/{datasetId}/draft
curl --request GET \
--url https://api.modeldesk.io/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/draft \
--header 'Authorization: Bearer <token>'

Get the caller’s own draft of the dataset: the branch it targets, the commit it started from, its current head, and when it was last touched. Metadata only; the staged rows are read through the dataset’s row routes at the draft. A draft belongs to one user, so a caller who has none is answered 404.

datasetId
required
string format: uuid

OK

Media typeapplication/json

One user’s private staging ref on a branch of the model. updatedAt is derived rather than stored: the newer of the draft’s creation and its head commit, so it moves with every staged change.

object
id
required

The draft’s ref id, which is also what ?ref= takes on the read routes.

string format: uuid
targetRefId
required

The branch the draft lands on.

string format: uuid
baselineCommitId
required

The target branch’s head the draft started from.

string format: uuid
headCommitId
required

The draft’s own head, equal to the baseline while nothing is staged.

string format: uuid
changeCount
required

How many changes are staged: the length of the draft’s chain from its head down to its baseline. Computed per read rather than stored, and 0 on a draft nothing has been staged into. A change is the undo grain, so five edits to one element count as five.

integer
createdAt
required
string format: date-time
updatedAt
required
string format: date-time
movesBaseTo

For a dataset draft that moves the dataset to another release of its base, that release’s name; the dataset is pinned to it once the draft lands.

string
handoff

A draft’s most recent handoff for review, set by POST /models/{modelId}/draft/handoff. Absent on a draft never handed off. Neither a commit nor a staged change: it goes with the draft when the draft is committed or discarded, and a staged change, an undo or a rebase leaves it in place.

object
summary
required

The author’s own words about the draft. Written by whoever handed it off, often an agent, so a client renders it as plain text and never as markup.

string
<= 2000 characters
headCommitId
required

The draft head when it was handed off. A headCommitId on the draft other than this one means the draft changed after the handoff.

string format: uuid
at
required

When the draft was handed off.

string format: date-time

Example generated

{
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"targetRefId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"baselineCommitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"headCommitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"changeCount": 1,
"createdAt": "2026-04-15T12:00:00Z",
"updatedAt": "2026-04-15T12:00:00Z",
"movesBaseTo": "example",
"handoff": {
"summary": "example",
"headCommitId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"at": "2026-04-15T12:00:00Z"
}
}

The dataset does not exist, answered with the plain problem, or the caller holds no draft on it, answered as RefNotFoundProblem: to a client that is the news a read at a gone ref brings, that the draft it was working in, perhaps committed or discarded in another session, is no longer there.

Media typeapplication/problem+json
Any of:

A Problem answered when a ref the request reads at is not there for the caller, on a resource they may read: a ref id that names nothing, a ref of another resource, and another user’s draft, which reads exactly as a ref that does not exist. The draft routes answer it too when the caller holds no draft.

A 404, as a missing resource is, and told apart from one by its type. A resource the caller cannot read keeps the plain answer it always had, whatever ref was named, so this one never says anything about a resource the caller could not see. To a client it means that the ref it was reading, typically a draft committed or discarded in another session, is gone while the resource stays: it goes back to the branch. The problem names no ref, so the answer for an id that names nothing and for another user’s draft is the same, byte for byte.

object
type
required

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
type
required

Stable constant a client branches on, which is what tells this 404 from a resource that is missing or not the caller’s to read.

string format: uri
Allowed values: https://modeldesk.io/problems/ref-not-found

Example

{
"type": "https://modeldesk.io/problems/ref-not-found"
}

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"
}
]
}