Skip to content
Connect an agent

Organisations

Edit a revision with typed operations

Applies edit_diagram operations to the revision, on its current source, as the tab route does for main.

POST/orgs/{org}/boards/{board}/tabs/{tab}/revisions/{revision}/edits

TL;DR

QuestionAnswer
What does it do?Edit a revision with typed operations.
What does it take?A JSON body of type EditBoardRevisionBody.
What does it return?Status 200 with a body of type BoardRevisionResult.
What can go wrong?400 the body is not valid, or names someone who is not a member of the organisation; 401 not signed in; 403 boards are not turned on for this organisation (boards.not_enabled), the caller may look but not change it (boards.forbidden), or the request came from an origin that may not make changes; 404 no such organisation, board, tab or revision, or one not open to the caller (boards.revision_not_found): the cases look alike; 409 the revision changed since the version sent (diagram.version_conflict), it is merged or discarded (boards.revision_closed), the tab has as many open revisions as it may (boards.revision_limit), or main and the revision changed the same statement (boards.merge_conflict, details.conflicts and details.mainVersion); 413 the source is longer than a tab may be, or the board holds as much as it may; 422 the source has errors (diagram.invalid), an edit did not apply (boards.operation_failed), or it holds something that looks like a secret and the organisation blocks them (boards.secret_blocked); 429 too many requests; 503 organisations or boards are not set up on this server. Every failure uses the one error envelope.

What it does

Applies edit_diagram operations to the revision, on its current source, as the tab route does for main. Main does not change. The result parses and passes the secret scan, and everyone watching the revision gets it live.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.
boardstringyesThe board's id: 22 letters and digits.
tabstringyesThe tab's id: 12 letters and digits.
revisionstringyesThe revision's id: 12 letters and digits.

Request body

The body has the type EditBoardRevisionBody.

FieldTypeRequiredDescription
baseVersionintegeryes
operationsobject[]yes
operations[].op"rename" | "set" | "add_node" | "remove" | "add_edge" | "remove_edge" | "move" | "replace_text"yes
operations[].targetstringnoId, label, table.column, or "header". at most 2000 characters.
operations[].tostringnorename: the new name. Edges: the end. at most 2000 characters.
operations[].fromstringnoEdges: the start. at most 2000 characters.
operations[].optionstringnoat most 40 characters; pattern ^[a-z][A-Za-z0-9_-]*$.
operations[].valuestring | nullnoset: null removes the option. at most 2000 characters.
operations[].idstringnoat most 2000 characters.
operations[].labelstringnoadd_edge on sankey: the amount. at most 2000 characters.
operations[].typestringnoadd_node: node type, or statement word (c4 person, tree dir). at most 2000 characters.
operations[].optionsobjectno
operations[].statementstringnoadd_node: the whole line, for a kind with no plain node statement. at most 2000 characters.
operations[].intostring | nullnoA block; null is the top level. at most 2000 characters.
operations[].afterstringnoat most 2000 characters.
operations[].arrow"<-->" | "-->" | "<->" | "..>" | "->" | "--"no
operations[].findstringnoat most 2000 characters.
operations[].replacestringnoat most 2000 characters.
operations[].allbooleanno

Responses

StatusMeaningBody
200The revision, and what the action did.BoardRevisionResult
400The body is not valid, or names someone who is not a member of the organisation.ErrorResponse
401Not signed in.ErrorResponse
403Boards are not turned on for this organisation (boards.not_enabled), the caller may look but not change it (boards.forbidden), or the request came from an origin that may not make changes.ErrorResponse
404No such organisation, board, tab or revision, or one not open to the caller (boards.revision_not_found): the cases look alike.ErrorResponse
409The revision changed since the version sent (diagram.version_conflict), it is merged or discarded (boards.revision_closed), the tab has as many open revisions as it may (boards.revision_limit), or main and the revision changed the same statement (boards.merge_conflict, details.conflicts and details.mainVersion).ErrorResponse
413The source is longer than a tab may be, or the board holds as much as it may.ErrorResponse
422The source has errors (diagram.invalid), an edit did not apply (boards.operation_failed), or it holds something that looks like a secret and the organisation blocks them (boards.secret_blocked).ErrorResponse
429Too many requests.ErrorResponse
503Organisations or boards are not set up on this server.ErrorResponse

Response body

A 200 answer has the type BoardRevisionResult.

FieldTypeRequiredDescription
changedbooleanyes
revisionanyyes
revision.idstringyesat least 12 characters; at most 12 characters; pattern ^[0-9A-Za-z]+$.
revision.tabstringyes
revision.namestringyes
revision.authorRevisionPersonyes
revision.author.kind"person" | "agent" | "key"yes
revision.author.labelstringyes
revision.authorIdstring | nullyes
revision.visibility"private" | "board" | "people"yesprivate: the author only; board: everyone the board is open to; people: the author and the people named.
revision.peoplestring[]yesThe account ids it is shared with by name.
revision.status"open" | "pending" | "merged" | "discarded"yesopen, pending (a merge waits for approval), merged, or discarded.
revision.baseVersionintegeryesThe main version it forked from, or was last updated from.
revision.versionintegeryes
revision.behindintegeryesMain versions made since baseVersion.
revision.createdAtintegeryes
revision.updatedAtintegeryes
revision.updatedByRevisionPersonyes
revision.updatedBy.kind"person" | "agent" | "key"yes
revision.updatedBy.labelstringyes
revision.readablebooleanyesFalse for a private revision shown by its name only, to the people who manage the board.
revision.minebooleanyes
revision.requestobject | nullyes
revision.request.byRevisionPersonyes
revision.request.atintegeryes
revision.request.notestring | nullyes
revision.reviewobject | nullyes
revision.review.byRevisionPersonyes
revision.review.atintegeryes
revision.review.commentstring | nullyes
revision.mergedVersioninteger | nullyes
revision.mergedByanyyes
revision.mergedBy.kind"person" | "agent" | "key"yes
revision.mergedBy.labelstringyes
revision.closedAtinteger | nullyes
listBoardRevisionListno
list.mainVersionintegeryes
list.protectedbooleanyesTrue when a merge into main needs the approval of a person who manages the board.
list.revisionsBoardRevision[]yes
list.revisions[].idstringyesat least 12 characters; at most 12 characters; pattern ^[0-9A-Za-z]+$.
list.revisions[].tabstringyes
list.revisions[].namestringyes
list.revisions[].authorRevisionPersonyes
list.revisions[].authorIdstring | nullyes
list.revisions[].visibility"private" | "board" | "people"yesprivate: the author only; board: everyone the board is open to; people: the author and the people named.
list.revisions[].peoplestring[]yesThe account ids it is shared with by name.
list.revisions[].status"open" | "pending" | "merged" | "discarded"yesopen, pending (a merge waits for approval), merged, or discarded.
list.revisions[].baseVersionintegeryesThe main version it forked from, or was last updated from.
list.revisions[].versionintegeryes
list.revisions[].behindintegeryesMain versions made since baseVersion.
list.revisions[].createdAtintegeryes
list.revisions[].updatedAtintegeryes
list.revisions[].updatedByRevisionPersonyes
list.revisions[].readablebooleanyesFalse for a private revision shown by its name only, to the people who manage the board.
list.revisions[].minebooleanyes
list.revisions[].requestobject | nullyes
list.revisions[].reviewobject | nullyes
list.revisions[].mergedVersioninteger | nullyes
list.revisions[].mergedByanyyes
list.revisions[].closedAtinteger | nullyes
list.hiddenintegeryesOpen revisions the caller may not see.
list.limitintegeryesOpen revisions a tab may have.
sourcestringno
resultsobject[]no
results[].opstringyes
results[].appliedbooleanyes
results[].linesinteger[]yes
results[].messagestringyes
results[].hintstring | nullyes
changesobject[]no
changes[].changestringyes
changes[].subjectstringyes
changes[].namestringyes
changes[].lineinteger | nullyes
changes[].detailstringyes
countsobjectno
counts.addedintegeryes
counts.removedintegeryes
counts.renamedintegeryes
counts.movedintegeryes
counts.changedintegeryes
warningsDiagnostic[]no
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.
secretsobjectno
secrets.countintegeryes
secrets.kindsstring[]yes
entriesobject[]no
entries[].versionintegeryes
entries[].typestringyes
entries[].actorRevisionPersonyes
entries[].actor.kind"person" | "agent" | "key"yes
entries[].actor.labelstringyes
entries[].countsobjectyes
entries[].counts.addedintegeryes
entries[].counts.removedintegeryes
entries[].counts.renamedintegeryes
entries[].counts.movedintegeryes
entries[].counts.changedintegeryes
entries[].atintegeryes
compareBoardRevisionCompareno
compare.mainVersionintegeryes
compare.versionintegeryes
compare.behindintegeryes
compare.samebooleanyes
compare.countsobjectyes
compare.counts.addedintegeryes
compare.counts.removedintegeryes
compare.counts.renamedintegeryes
compare.counts.movedintegeryes
compare.counts.changedintegeryes
compare.changesobject[]yes
compare.changes[].changestringyes
compare.changes[].subjectstringyes
compare.changes[].namestringyes
compare.changes[].lineinteger | nullyes
compare.changes[].detailstringyes
compare.truncatedbooleanyes
compare.summarystringyes
compare.conflictsBoardMergeConflict[]yes
compare.conflicts[].keystringyesThe statement: its id, its label in quotes, or an edge by its ends. A resolution names it.
compare.conflicts[].subjectstringyes
compare.conflicts[].basestring | nullyes
compare.conflicts[].mainstring | nullyes
compare.conflicts[].revisionstring | nullyes
compare.mergeablebooleanyes
compare.mainstringyesMain's source now.
compare.mergedstring | nullyesMain as the merge would leave it; null while a conflict is open.
compare.revisionstringyes
mergeobjectno
merge.status"merged" | "pending"yes
merge.mainVersionintegeryes
merge.method"same" | "fast-forward" | "replay" | "statements" | nullyes
sentintegerno

See also

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