Skip to content

Place a library item in your draft

POST
/api/drafts/{id}/library
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.

id
required
string format: uuid
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
/^-?(?:0|[1-9]\d*)$/

Example generated

{
"itemId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"tab": "example",
"zone": "example",
"targets": [
{
"kind": "example",
"ref": "example"
}
],
"note": "example",
"version": 1
}

OK

Media typeapplication/json
object
elementKind
required
string
elementRef
required
string
tab
required
null | string
isValid
required
boolean
errorCount
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
warningCount
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/

Example generated

{
"elementKind": "example",
"elementRef": "example",
"tab": "example",
"isValid": true,
"errorCount": 1,
"warningCount": 1
}

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"
}