Skip to content
Connect an agent

Organisations

Import a diagram into a live whiteboard

A new tab from a library diagram (linked, so a later save is a new version of it), the agent's member's own diagram, pasted source, a hosted Plotwork link or SVG, Mermaid, a file in one of import_source's formats, or a pattern.

POST/v1/boards/{board}/imports

TL;DR

QuestionAnswer
What does it do?Import a diagram into a live whiteboard.
What does it take?A JSON body of type AgentImportToBoardBody.
What does it return?Status 201 with a body of type AgentImportToBoardResult.
What can go wrong?400 the body is not valid; 401 the API key is missing or not valid; 403 the account's plan does not include the REST API (plan.rest_not_included), the key is a person's own or a person's own agent (boards.org_key_required), a trusted publisher (boards.publisher_not_allowed), an organisation key without the boards scope (key.scope_missing), boards are not on for the organisation (boards.not_enabled), or the caller may look but not change the board (boards.forbidden); 404 no such board or tab, or the board is not open to the caller: the cases look alike; 409 the tab changed since baseVersion and the edit no longer applies (diagram.version_conflict, with details.currentVersion and each operation's result), the board has as many tabs as it may (boards.tab_limit), or the organisation is on legal hold; 413 the source is longer than a tab may be (boards.source_too_long), or the board holds as much as it may (boards.storage_full); 422 the result has errors (diagram.invalid, the diagnostics in details), an edit did not apply to the current version (boards.operation_failed, details.results), or it holds something that looks like a secret and the organisation blocks them (boards.secret_blocked); 429 too many requests, or a daily limit is spent; 503 live whiteboards are not set up on this server. Every failure uses the one error envelope.

What it does

A new tab from a library diagram (linked, so a later save is a new version of it), the agent's member's own diagram, pasted source, a hosted Plotwork link or SVG, Mermaid, a file in one of import_source's formats, or a pattern. The file, picture or text is read in memory and only the diagram made from it is kept. What the converter left out comes back as diagnostics; one that read nothing is 422 boards.import_failed. The REST twin of import_to_board.

Path parameters

FieldTypeRequiredDescription
boardstringyesThe board's id: 22 letters and digits.

Request body

The body has the type AgentImportToBoardBody.

FieldTypeRequiredDescription
namestringnoat least 1 character; at most 60 characters.
afterstring | nullnoat least 12 characters; at most 12 characters; pattern ^[0-9A-Za-z]+$.
fromobject | object | object | object | object | object | object | objectyesThe file, picture or text is read in memory; only the diagram made from it is kept, in the new tab.

Responses

StatusMeaningBody
201The new tab, and what the converter left out.AgentImportToBoardResult
400The body is not valid.ErrorResponse
401The API key is missing or not valid.ErrorResponse
403The account's plan does not include the REST API (plan.rest_not_included), the key is a person's own or a person's own agent (boards.org_key_required), a trusted publisher (boards.publisher_not_allowed), an organisation key without the boards scope (key.scope_missing), boards are not on for the organisation (boards.not_enabled), or the caller may look but not change the board (boards.forbidden).ErrorResponse
404No such board or tab, or the board is not open to the caller: the cases look alike.ErrorResponse
409The tab changed since baseVersion and the edit no longer applies (diagram.version_conflict, with details.currentVersion and each operation's result), the board has as many tabs as it may (boards.tab_limit), or the organisation is on legal hold.ErrorResponse
413The source is longer than a tab may be (boards.source_too_long), or the board holds as much as it may (boards.storage_full).ErrorResponse
422The result has errors (diagram.invalid, the diagnostics in details), an edit did not apply to the current version (boards.operation_failed, details.results), or it holds something that looks like a secret and the organisation blocks them (boards.secret_blocked).ErrorResponse
429Too many requests, or a daily limit is spent.ErrorResponse
503Live whiteboards are not set up on this server.ErrorResponse

Response body

A 201 answer has the type AgentImportToBoardResult.

FieldTypeRequiredDescription
changedbooleanyesFalse when the write changed nothing; nothing was stored.
versionintegeryesThe tab's version now: the baseVersion of the next edit.
tabanyyes
tab.idstringyesat least 12 characters; at most 12 characters; pattern ^[0-9A-Za-z]+$.
tab.namestringyes
tab.kindstringyes
tab.positionnumberyes
tab.versionintegeryesSend it as baseVersion with the next edit, and as sinceVersion to learn what changed after it.
tab.updatedAtintegeryes
tab.updatedBystringyes
resultsobject[]yes
results[].opstringyes
results[].appliedbooleanyes
results[].linesinteger[]yes
results[].messagestringyes
results[].hintstring | nullyes
changesobject[]yes
changes[].changestringyes
changes[].subjectstringyes
changes[].namestringyes
changes[].lineinteger | nullyes
changes[].detailstringyes
warningsDiagnostic[]yes
warnings[].code"E100" | "E101" | "E110" | "E111" | "E120" | "E121" | "E123" | "E124" | "E125" | "E130" | "E131" | "E132" | "E133" | "E134" | "E135" | "E136" | "E137" | "E138" | "E139" | "E140" | "W200" | "W201" | "W202" | "W203" | "W204" | "W205" | "W206" | "W207" | "W208" | "W500" | "W600" | "W601" | "W700" | "W701" | "W702" | "W703" | "W704" | "W705" | "W706" | "W707" | "W708" | "W709" | "W710" | "M100" | "M101" | "M102" | "M103" | "M104" | "M110" | "M200" | "M201" | "M202" | "M203" | "M204" | "M205" | "M206" | "M207" | "M208" | "M209" | "M210" | "M211" | "M212" | "M213" | "M214" | "M215" | "M216" | "M217" | "M218" | "E300" | "E301" | "E302" | "E303" | "E304" | "W300" | "W301" | "W302" | "W303" | "M120" | "M220" | "M221" | "M222" | "E340" | "E341" | "E342" | "E343" | "E344" | "E345" | "W320" | "W321" | "W322" | "W323" | "M240" | "M241" | "M242" | "E360" | "E361" | "E362" | "E363" | "E364" | "E365" | "E366" | "E367" | "W330" | "W331" | "W332" | "W333" | "W334" | "M250" | "M251" | "E400" | "E401" | "E402" | "E403" | "W350" | "W351" | "W352" | "W353" | "M270" | "M271" | "E420" | "E421" | "E422" | "E423" | "E424" | "W360" | "W361" | "W362" | "W363" | "W364" | "M180" | "M280" | "M281" | "M282" | "E320" | "E321" | "E322" | "E323" | "E324" | "E325" | "E326" | "E327" | "E328" | "E329" | "E330" | "W310" | "W311" | "W312" | "W313" | "W314" | "M130" | "M131" | "M132" | "M230" | "M231" | "M232" | "M233" | "M234" | "M235" | "M236" | "M237" | "M238" | "E380" | "E381" | "E382" | "E383" | "W340" | "W341" | "W342" | "W343" | "M260" | "I100" | "I101" | "I102" | "I103" | "I104" | "I105" | "I200" | "I201" | "I202" | "I203" | "I204" | "I206" | "R100" | "R101" | "R200" | "R201" | "R202" | "R203" | "R204" | "R205" | "R206" | "R207" | "S100" | "S200" | "S101" | "S102" | "S103" | "S104" | "S201" | "S202" | "S203" | "S204"yesStable code to branch on; E-codes are errors, W-codes are warnings.
warnings[].severity"error" | "warning"yesErrors stop rendering; warnings never do.
warnings[].messagestringyesWhat is wrong, in one sentence.
warnings[].lineintegeryes1-based line in the submitted source. minimum 1.
warnings[].columnintegeryes1-based column in that line. minimum 1.
warnings[].lengthintegeryesNumber of characters the problem covers. minimum 1.
warnings[].hintstring | nullyesA concrete suggestion for fixing it, or null.
secretsobjectyes
secrets.countintegeryes
secrets.kindsstring[]yes
diagnosticsobject[]yesWhat the reader or converter left out or could not read, each with a hint.
diagnostics[].codestringyes
diagnostics[].messagestringyes
diagnostics[].hintstring | nullno

See also

DocWhy
API referenceEvery endpoint, and the error envelope
SchemasEvery request and response type
Tool referenceThe operations as callable tools