Save the draft as a model or revision
POST
/api/drafts/{id}/save
const url = 'https://forge.example.com/api/drafts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/save';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"note":"example","overwrite":false}'};
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://forge.example.com/api/drafts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/save \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "note": "example", "overwrite": false }'Deletes the draft once saved, and keeps what the assistant recorded of the conversation as the model’s context for the next draft. overwrite saves even though the model has a newer revision than the one the draft started from, or its context was changed after the assistant read it.
Authorizations
Section titled “Authorizations”Parameters
Section titled “Parameters”Path Parameters
Section titled “Path Parameters”id
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
note
null | string
overwrite
boolean
Responses
Section titled “Responses”The saved model or revision, as creating a model or adding a revision answers it.
Media typeapplication/json
string
Example generated
exampledefault
Section titled “default”A refusal or an error, as a problem document. A model or draft you may not see answers 404, as one that does not exist.
Media typeapplication/problem+json
object
type
string
title
string
status
integer
detail
string
instance
string
Example generated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example"}