Place a library item in your draft
POST
/api/drafts/{id}/library
const url = 'https://forge.example.com/api/drafts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/library';const options = { method: 'POST', headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}, body: '{"itemId":"2489E9AD-2EE2-8E00-8EC9-32D5F69181C0","tab":"example","zone":"example","targets":[{"kind":"example","ref":"example"}],"note":"example","version":1}'};
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/library \ --header 'Authorization: Bearer <token>' \ --header 'Content-Type: application/json' \ --data '{ "itemId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "tab": "example", "zone": "example", "targets": [ { "kind": "example", "ref": "example" } ], "note": "example", "version": 1 }'The draft’s model takes the item at its latest version and the engine looks at it again. It becomes a link of the model when the draft is saved.
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
itemId
required
null | string format: uuid
tab
required
null | string
zone
required
null | string
targets
required
Array<object> | null
object
kind
required
string
ref
required
string
note
required
null | string
version
required
null | integer | string format: int32
Example generated
{ "itemId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "tab": "example", "zone": "example", "targets": [ { "kind": "example", "ref": "example" } ], "note": "example", "version": 1}Responses
Section titled “Responses”OK
Media typeapplication/json
object
elementKind
required
string
elementRef
required
string
tab
required
null | string
isValid
required
boolean
errorCount
required
integer | string format: int32
warningCount
required
integer | string format: int32
Example generated
{ "elementKind": "example", "elementRef": "example", "tab": "example", "isValid": true, "errorCount": 1, "warningCount": 1}default
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"}