Skip to content

Read a file you already have into a draft

POST
/api/drafts/import
curl --request POST \
--url https://forge.example.com/api/drafts/import \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '{ "systemId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "name": "example", "classificationKey": "example", "visibility": "example", "fileName": "example", "content": "example", "page": 1 }'

A Visio drawing (.vsdx), a draw.io diagram, a Microsoft Threat Modeling Tool model (.tm7), a Terraform plan as JSON (terraform show -json), a CloudFormation template, Kubernetes manifests or an Open Threat Model file (0.2.0, JSON or YAML). content is the file as base64, 10 MB at most; fileName is its name; page picks a page of a drawing with several. The other fields are those of a new draft. Every element of the draft is marked as a suggestion, with where in the file it came from, until you confirm it, and importReport says what was read, what was left out and what only a person can answer. No AI is used, so this works where the classification switches the assistant off. Answers 422 with a sentence when the file cannot be read, and 413 when it is too large.

Media typeapplication/json
object
systemId
null | string format: uuid
name
null | string
classificationKey
null | string
visibility
null | string
fileName
required
string
content
required
string
page
null | integer | string format: int32
/^-?(?:0|[1-9]\d*)$/

Example generated

{
"systemId": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0",
"name": "example",
"classificationKey": "example",
"visibility": "example",
"fileName": "example",
"content": "example",
"page": 1
}

The draft, as getting a draft answers it.

Media typeapplication/json
string

Example generated

example

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