Skip to content

Change your draft by hand

POST
/api/drafts/{id}/elements
curl --request POST \
--url https://forge.example.com/api/drafts/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/elements \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "confirmAll": false, "confirm": [ { "kind": "example", "name": "example" } ], "remove": [ { "kind": "example", "name": "example" } ], "retype": [ { "name": "example", "type": "example" } ], "add": [ { "kind": "example", "zone": "example", "values": {} } ], "change": [ { "kind": "example", "name": "example", "values": {} } ] }'

add adds elements: each with its kind, its values by the field names the vocabulary gives, and for an appliance the zone it sits on; a zone, appliance, node or flow may be given its name, or one is made from its label, and a threat or a control gets the next free id; added in the answer names them. change sets fields of an element by kind and name, or of the model’s own details with the kind model; a value of null or an empty text takes an optional field out. An element’s name is not changed: change its label. confirmAll, or confirm with elements by kind (zone, appliance, node, flow, threat, control) and name (a threat’s or a control’s id), takes the mark of a suggestion off them. remove takes elements out, with what depends on them: a node’s flows, and the threat targets that pointed at what was removed; a zone must be empty first. retype says what type a node is. No AI is used. The engine fills in what it computes (a threat’s rating and score, its list of controls, labels in Title Case), and the change is kept only if the engine still accepts the model: answers 409 with the engine’s first error when it would not.

id
required
string format: uuid
Media typeapplication/json
object
confirmAll
boolean
confirm
Array<object> | null
object
kind
required
string
name
required
string
remove
Array<object> | null
object
kind
required
string
name
required
string
retype
Array<object> | null
object
name
required
string
type
required
string
add
Array<object> | null
object
kind
required
string
zone
required
null | string
values
required
object
change
Array<object> | null
object
kind
required
string
name
required
null | string
values
required
object

OK

Media typeapplication/json
object
confirmed
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
removed
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
retyped
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
stillSuggested
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
isValid
required
boolean
errorCount
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
warningCount
required
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/
updatedAt
required
string format: date-time
added
Array<string>
changed
integer | string format: int32
/^-?(?:0|[1-9]\d*)$/

Example generated

{
"confirmed": 1,
"removed": 1,
"retyped": 1,
"stillSuggested": 1,
"isValid": true,
"errorCount": 1,
"warningCount": 1,
"updatedAt": "2026-04-15T12:00:00Z",
"added": [
"example"
],
"changed": 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"
}