Hand off your draft for review
const url = 'https://api.modeldesk.io/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/draft/handoff';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"summary":"example"}'};
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/models/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/draft/handoff \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "summary": "example" }'Mark the caller’s own draft as ready for review, with a summary of what it holds. The summary is stored on the draft as handoff, with the draft head at this moment and the time, and a second handoff replaces the first. Nothing is staged and nothing is committed: the chain, changeCount and history are what they were.
The caller’s open model hears of it as a draft-handoff event on GET /models/{modelId}/events, and GET /models marks the draft with handedOffAt. Models only: a dataset draft has no handoff.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”Request Bodyrequired
Section titled “Request Bodyrequired”object
What the draft does, in the author’s own words. Required and not blank, and held to the cap of a commit message. Shown to the reviewer as plain text, and offered as the starting message of the commit that lands the draft.
Example generated
{ "summary": "example"}Responses
Section titled “Responses”The draft, carrying the handoff just stored
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.
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 summary is missing, blank or over 2,000 characters
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" } ]}The model is theirs to read but not to change. Checked again here, because access can be lost between staging a change and handing the draft off. Or the caller is an agent acting for a person, and the organization that owns the model has not enabled the agent’s AI platform, answered as AgentPlatformNotEnabledProblem. Or the caller is an agent acting for a person, and the request reaches further than the maximum level the organization that owns the model lets agents reach, answered as AgentLevelNotAllowedProblem with nothing written, whatever the agent was granted.
A Problem answered when an agent acting for a person made a request that reaches further than the maximum level the organization that owns the model lets agents reach, set in the organization’s AI agent platforms setting: staging into a draft or working on a branch where the maximum is read, a merge, a landing on a branch that is not an agent’s own, or taking back or landing another’s staged change where it is propose, and anything that reaches people outside the organization where it is below publish. The person’s grant does not lift it, since a grant spans the person’s organizations and the maximum is each organization’s own; an organization admin can raise it. Nothing was written. A change of the setting applies to new requests within a minute.
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
Stable constant a client branches on, which is what tells this 403 from the plain one the same routes answer for a model the caller may not change, and from the refusals a permission the person grants lifts.
A Problem answered when an agent acting for a person reached a model whose owning organization has not enabled the AI platform the agent runs on, which its token names. Model content reaches the platform an agent runs on, so the organization decides: until an organization admin turns the platform on in the organization’s AI agent platforms setting, every route on the model refuses the agent, conditional reads and the events stream included, and the model list and every page that names other models leave the organization’s models out. A change of the setting applies to new requests within a minute; an events stream that is already open ends at its token’s expiry, at most ten minutes later.
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
Stable constant a client branches on, which is what tells this 403 from the plain one the same routes answer for a model the caller may not 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
{ "type": "https://modeldesk.io/problems/agent-level-not-allowed"}The model does not exist, answered with the plain problem, or the caller holds no draft on it, answered as RefNotFoundProblem, as the other draft routes answer it.
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
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
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.
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
{ "type": "https://modeldesk.io/problems/ref-not-found"}One of two, told apart by type. The draft has staged nothing, so there is nothing to review, carrying the code nothing-to-hand-off; or a change was staged, undone or rebased between the read of the draft and the write of the handoff, carrying the code draft-moved, in which case nothing was stored and the caller hands off again. A draft committed or discarded in that same window answers draft-moved too; reading the draft again then answers 404.
A Problem answered when a handoff is asked for on a draft whose head is still the baseline it was started from. A conflict rather than bad input: the request is well formed and names a draft that really exists, and what refuses it is the state that draft is in. The draft is left exactly where it was, any earlier handoff included.
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
Stable constant a client branches on, which is what tells this 409 from the other one the same route answers with.
Stable constant a client branches on, beside the problem’s own type.
The draft that was asked to hand off: the caller’s own draft ref, never the branch it targets. It is the id of the Draft that staged nothing.
The draft’s baseline, which on a draft that staged nothing is also its head.
A Problem answered when a change was staged between the read a landing was built from and the delete that would have ended the draft. Nothing was written, and nothing was lost: the draft still holds everything, the new change included. The caller reads it again and commits once more, which lands the longer chain.
A head-gated discard answers it when the draft moved past draftHeadId, and a handoff when the draft moved between the read of it and the write of the handoff; neither deletes or stores anything, and the caller reads the draft again and asks once more.
Distinct from DraftHeadConflictProblem, which reports being behind the branch and carries the commits to catch up on. Here there is nothing to catch up on, so there is no gap.
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
Stable constant a client branches on, which is what tells this 409 from the other two the same route answers with.
Stable constant a client branches on, beside the problem’s own type.
The draft that moved: the caller’s own draft ref, never the branch it targets. It is the id of the Draft this request was built from.
The head the request was built from (the landing’s, the discard’s draftHeadId or the head the handoff read), which is no longer the draft’s.
Example
{ "type": "https://modeldesk.io/problems/nothing-to-hand-off", "code": "nothing-to-hand-off"}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" } ]}