Skip to content
Connect an agent

Organisations

Scan a repository for hand-drawn Mermaid

Reads the Markdown, Mermaid and detected source files of the default branch in memory, lists each Mermaid diagram as unverified, and compares its names with the code as hints.

POST/orgs/{org}/evidence/repositories/{repositoryId}/scan

TL;DR

QuestionAnswer
What does it do?Scan a repository for hand-drawn Mermaid.
What does it take?org, repositoryId in the path.
What does it return?Status 200 with a body of type EvidenceScan.
What can go wrong?401 not signed in; 403 a member or a reader (orgs.forbidden), a plan without compliance evidence (plan.compliance_evidence_not_included), or an origin that may not make changes; 404 no such organisation or repository (github.repository_not_found), or the caller is not a member; 409 the installation is suspended (github.suspended); 422 the repository is empty (github.nothing_to_draw); 429 too many requests, or GitHub asked to wait (github.rate_limited); 502 GitHub did not answer as expected (github.unavailable); 503 the GitHub App or the Engine is not set up here. Every failure uses the one error envelope.

What it does

Reads the Markdown, Mermaid and detected source files of the default branch in memory, lists each Mermaid diagram as unverified, and compares its names with the code as hints. Stores paths, lines, names and counts only. The owner and admins, on Enterprise. Audited.

Path parameters

FieldTypeRequiredDescription
orgstringyesThe organisation's id or its slug.
repositoryIdstringyesGitHub's id of the repository.

Responses

StatusMeaningBody
200The repository's findings.EvidenceScan
401Not signed in.ErrorResponse
403A member or a reader (orgs.forbidden), a plan without compliance evidence (plan.compliance_evidence_not_included), or an origin that may not make changes.ErrorResponse
404No such organisation or repository (github.repository_not_found), or the caller is not a member.ErrorResponse
409The installation is suspended (github.suspended).ErrorResponse
422The repository is empty (github.nothing_to_draw).ErrorResponse
429Too many requests, or GitHub asked to wait (github.rate_limited).ErrorResponse
502GitHub did not answer as expected (github.unavailable).ErrorResponse
503The GitHub App or the Engine is not set up here.ErrorResponse

Response body

A 200 answer has the type EvidenceScan.

FieldTypeRequiredDescription
repositorystringyes
documentsintegeryesminimum 0.
truncatedbooleanyes
archivedbooleanyes
findingsEvidenceFinding[]yes
findings[].idstringyes
findings[].repositorystringyes
findings[].pathstringyes
findings[].lineintegeryes
findings[].mermaidTypestring | nullyes
findings[].kindstring | nullyes
findings[].nodesintegeryesminimum 0.
findings[].matchedintegeryesminimum 0.
findings[].sourceobject | nullyesThe detected source that shares the most names with it.
findings[].source.namestringyes
findings[].source.formatstringyes
findings[].mentionsMissingstring[]yesHints: names it draws that no source declares. Hints, not verification.
findings[].codeMissingstring[]yesHints: names the matching source declares that it does not draw.
findings[].pullRequestNumberinteger | nullyes
findings[].supersededbooleanyesTrue once the source its pull request added has a check.
findings[].controlsstring[]yes
findings[].suggestedstring[]yes
findings[].scannedAtintegeryes

See also

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