Skip to content
Connect an agent

Organisations

Approve a request

A new diagram is shown to the library, a new version takes the diagram's place, or the public link is made, with every check run again.

POST/orgs/{org}/approvals/{id}/approve

TL;DR

QuestionAnswer
What does it do?Approve a request.
What does it take?A JSON body of type DecideApprovalBody.
What does it return?Status 200 with a body of type ApprovalRequest.
What can go wrong?400 the body is not valid; 401 not signed in; 403 the caller does not approve, or asked for it themselves (orgs.forbidden); a share the plan has no room for (hosting.quota_exceeded); or the request came from an origin that may not make changes; 404 no such organisation or pending request, or the request is about a diagram in a folder the caller may not use; 409 another approver decided it a moment ago, or the label no longer allows a public link (orgs.share_classified); 429 too many requests; 503 organisations are not set up on this server. Every failure uses the one error envelope.

What it does

A new diagram is shown to the library, a new version takes the diagram's place, or the public link is made, with every check run again. An optional comment is emailed to the publisher. Another approver than the one who asked.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.
idstringyes

Request body

The body has the type DecideApprovalBody.

FieldTypeRequiredDescription
commentstring | nullnoAn optional comment for the publisher, at most 500 characters. It is emailed to them and kept in the organisation's audit log. at least 1 character; at most 500 characters.

Responses

StatusMeaningBody
200The request as decided.ApprovalRequest
400The body is not valid.ErrorResponse
401Not signed in.ErrorResponse
403The caller does not approve, or asked for it themselves (orgs.forbidden); a share the plan has no room for (hosting.quota_exceeded); or the request came from an origin that may not make changes.ErrorResponse
404No such organisation or pending request, or the request is about a diagram in a folder the caller may not use.ErrorResponse
409Another approver decided it a moment ago, or the label no longer allows a public link (orgs.share_classified).ErrorResponse
429Too many requests.ErrorResponse
503Organisations are not set up on this server.ErrorResponse

Response body

A 200 answer has the type ApprovalRequest.

FieldTypeRequiredDescription
idstringyes
kind"publish" | "change" | "share"yes
status"pending" | "approved" | "rejected" | "expired"yes
diagramobject | nullyesThe diagram as the library has it now, or null once it is gone (a rejected new diagram).
diagram.idstringyes
diagram.namestring | nullyes
diagram.folderstring | nullyes
diagram.classificationClassificationyesA diagram's classification label: public, internal (the default, and what a diagram published before labels reads as) or confidential. Confidential is never shared publicly; under "Share only diagrams labelled Public" only public is.
diagram.theme"light" | "dark" | "auto"yes
requestedByobject | nullyesWho asked, or null for an organisation key and once the account is gone.
requestedBy.userIdstringyes
requestedBy.emailstringyes
requestedAtintegeryes
expiresAtintegeryes
secretFindingsintegeryesHow many things that look like a secret the scan found when the request was made, under the organisation's scanning options. minimum 0.
reviewedByobject | nullyes
reviewedBy.userIdstringyes
reviewedBy.emailstringyes
reviewedAtinteger | nullyes
commentstring | nullyesThe approver's comment, when they gave one.

See also

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