List dataset branches
const url = 'https://api.modeldesk.io/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/branches';const options = {method: 'GET', headers: {Authorization: 'Bearer <token>'}};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request GET \ --url https://api.modeldesk.io/datasets/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/branches \ --header 'Authorization: Bearer <token>'List the dataset’s branches: main first, then the others in the order they were created, each with the commit it points at. Drafts are never listed. Open to every reader of the dataset.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Responses
Section titled “Responses”OK
One branch of a model: its name, when it was created, whether it is the model’s main branch, the commit it points at and who made that commit, how many drafts target it and how many of its commits main does not reach.
object
The branch’s ref id, which is what ?ref= takes on the read routes and branchId on a staged change.
The name the branch was created with. A branch is never renamed.
True for the model’s main branch only: the one every read without a ref reads, the one releases are cut from, and the one that cannot be deleted.
The commit the branch points at, in the shape a walked commit is listed in.
object
Absent on the initial commit.
The author’s description of the change. Absent on a commit made without one. For a staged change it is the message that was sent, absent when it was blank or left out.
The key of the request that produced the commit, absent on a commit made without one. For a staged change it is the changeRequestId that was sent.
The deduped, sorted type values of the commit’s actions. Empty rather than absent on a commit that records none.
Present, and true, on a merge commit whose actionTypes include a dependency or metamodel-pin type for every change it made to the model’s dependencies and metamodel pin. A merge commit names the elements it changed as element actions whatever they are, so one without it says nothing about those: a client has to assume they may have moved. Absent on every other commit, whose actionTypes always tell.
Who made the head commit, named as the commit log names the author of the same commit in createdBy: a person by the name on their account, a service account by the name it had when it committed, and the platform (SYSTEM) without a name.
object
USER is a person, MACHINE a service account, and SYSTEM the platform itself, whose commits (metamodel seeding and re-pins) the commit log hides unless asked for them.
The display name, where one is known: a person’s from their account, a service account’s as stored with what it wrote. Left out for the platform and for a person whose account holds no name.
How many drafts target the branch, whoever owns them. Deleting the branch deletes every one of them, so a client can say how many go before it asks.
How many commits on the branch main does not reach, every parent of a merge followed. Zero for main and for a branch main has merged. Deleting the branch leaves them to garbage collection and is refused without force while there are any, so a client can say how many go before it asks.
Example
[ { "headAuthor": { "type": "USER" } }]The dataset does not exist or is not the caller’s to read
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" } ]}