Move a dataset to another release of its base
const url = 'https://api.modeldesk.io/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/base/move';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"version":"example","decisions":[{"conceptId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","columnId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","choice":"TAKE_BASE"}],"draftHeadId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","changeRequestId":"example","branchId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://api.modeldesk.io/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/base/move \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "version": "example", "decisions": [ { "conceptId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "columnId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "choice": "TAKE_BASE" } ], "draftHeadId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "changeRequestId": "example", "branchId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0" }'Works the move out again from the states as they stand, each item taking your decision where you made one and its default where you did not, and stages the rows it writes and removes as one change on your draft, together with the release the dataset is pinned to once the draft lands. Only onto a draft holding nothing else, opening one on the default branch if you hold none; a move that changes no row still stages. Until the draft lands, its rows are read and judged against the release it moves to. Landing the draft moves the pin and judges every row again; it is refused if the dataset was pinned elsewhere after the move was staged. Answered as a staged change is, with the draft’s id in the Draft-Ref header.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
The name of the release to move to.
The items you chose for; every other item takes its default, except a concept that is gone and sits only under gone rows that all go, which goes with them unless you decide to keep it.
object
The draft head you believe you are editing; before a draft exists, the default branch’s head.
Your own key for the change, as a staged change carries one.
The branch the move is meant for, which a draft opened by it targets; your draft’s, or main, when omitted.
Responses
Section titled “Responses”The draft as it stands after the move, and the rows it left not conforming
Where the draft stands after a change was staged or undone, and the rows that move left not conforming.
object
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
The draft’s ref id, which is also what ?ref= takes on the read routes.
The branch the draft lands on.
The target branch’s head the draft started from.
The draft’s own head, equal to the baseline while nothing is staged.
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.
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.
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
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.
The draft head when it was handed off. A headCommitId on the draft other than this one means the draft changed after the handoff.
When the draft was handed off.
Row id to what is wrong with it. For a staged change, the written rows that do not conform; they were staged all the same. For an undo, the rows moved back onto a revision whose recorded verdict flags them. Absent when there are none.
object
How a row stands against its dataset’s data schema. A row that does not conform is flagged and kept, never dropped: reference data arrives incomplete and is corrected in place.
object
Whether no violation is an error. A row whose violations are all warnings is valid and still carries them.
Absent when nothing is wrong with the row.
One way in which a row does not conform.
object
The schema property’s source element id — the same key the row’s own maps use, so a caller marks the offending cell without a lookup. Absent for a violation about the row itself. For a violation inside a part, the row’s column that holds the part, with path leading from there to the field.
Which value of the property; absent when the violation is the property’s as a whole. For a violation inside a part, which value of the field path ends at.
For a violation inside a part, the way from propertyId down to the field, outermost part first: contactpunt[2].email is one step, the part at index 1 and its property email. Absent for a violation of one of the row’s own fields.
One step of a violation’s way into a part: the part at a position among the parts of the property reached so far, and the property of that part the way goes on to.
object
The part’s position among that property’s parts, from 0.
The part’s property the way goes on to; absent where the violation is about the part.
How much the violation weighs; the row is kept and flagged either way. A value outside a code list is a WARNING unless the list is marked strict; everything else is an ERROR.
For a reference property, which of its lists the violation is about: true for its references to models, model elements and datasets (platformRefs), which valueIndex then counts in; false for its references to rows (refs) where that needs saying beside the other. Absent for its references to rows, as every violation from before the other list existed reads. Inside a part as at the row: beside path, it says which list of the field path ends at.
Example
{ "flagged": { "additionalProperty": { "violations": [ { "code": "TOO_FEW_VALUES", "severity": "WARNING" } ] } }}The dataset was made from no base, the release is not one it can move to, the draft holds staged changes, or a decision names an item the move offers no choice for
An RFC 9457 problem document, always sent as application/problem+json.
object
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.
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.
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.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}Dataset or release not found
An RFC 9457 problem document, always sent as application/problem+json.
object
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.
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.
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.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}default
Section titled “default”Error
An RFC 9457 problem document, always sent as application/problem+json.
object
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.
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.
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.
object
Example generated
{ "type": "https://example.com", "title": "example", "status": 1, "detail": "example", "instance": "example", "violations": [ { "property": "example", "message": "example" } ]}