Skip to content

Place a library item in a model

POST
/api/models/{id}/library
curl --request POST \
--url https://forge.example.com/api/models/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 }'

Adds the item at its latest version as a new revision, linked and pinned. Give the zone for a service or an appliance, targets for a threat. A stencil brings its enterprise controls. Send the newest revision’s number as version. When the engine finds errors in the result, nothing is kept and the answer is 422 with findings.

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
revision
required
One of:
null
link
required
One of:
null

Example generated

{
"revision": {
"number": 1,
"isValid": true,
"errorCount": 1,
"warningCount": 1,
"createdAt": "2026-04-15T12:00:00Z",
"engineVersion": "example",
"engineSha256": "example",
"contentSha256": "example",
"note": "example",
"createdBy": {
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"displayName": "example"
},
"isCurrent": true,
"findings": "example"
},
"link": {
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"item": {
"id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"kind": "example",
"key": "example",
"name": "example",
"status": "example"
},
"elementKind": "example",
"elementRef": "example",
"tab": "example",
"pinnedVersion": 1,
"latestVersion": 1,
"altered": true,
"alteredOn": "2026-04-15",
"alteredReason": "example",
"stencilKind": "example",
"stencilReason": "example",
"deviation": {
"category": "example",
"owner": "example",
"approver": "example",
"approvedOn": "2026-04-15",
"due": "2026-04-15",
"planRef": "example",
"steps": [
{
"text": "example",
"due": "2026-04-15",
"done": true
}
],
"overdue": true
},
"version": 1,
"update": {
"linkId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"itemId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"itemName": "example",
"elementKind": "example",
"elementRef": "example",
"tab": "example",
"from": 1,
"to": 1,
"weight": "example",
"dueOn": "2026-04-15",
"overdue": true,
"dismissed": true,
"notes": [
{
"number": 1,
"weight": "example",
"notes": "example",
"dueOn": "2026-04-15"
}
]
}
}
}

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