Plan a batch of pull request reviews, and start it unless start is false. Local mode only: the pending reviews post with the local user's GitHub credential.
const url = 'https://example.com/api/v1/pr-batches';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"urls":["example"],"repo":"example","requested":true,"parallel":1,"again":true,"stages":["rubric"],"start":true,"levels":["must"],"attribution":"speccy"}'};
try { const response = await fetch(url, options); const data = await response.json(); console.log(data);} catch (error) { console.error(error);}curl --request POST \ --url https://example.com/api/v1/pr-batches \ --header 'Content-Type: application/json' \ --data '{ "urls": [ "example" ], "repo": "example", "requested": true, "parallel": 1, "again": true, "stages": [ "rubric" ], "start": true, "levels": [ "must" ], "attribution": "speccy" }'Request Bodyrequired
Section titled “Request Bodyrequired”object
Pull request URLs. Give these or repo.
A repo as owner/name. The batch takes each open pull request that is not a draft and changes a spec doc.
With repo, only the pull requests where someone asked for your review.
How many pull requests run at the same time. The default is 3.
Review a pull request again although it was reviewed at its head commit.
The model stages to run. Absent means all; empty means lint only.
False plans the batch and waits for startPrBatch. The default is true.
The finding levels that go inline as comments. Absent means pr.levels of the .speccy.yaml that each review uses.
None keeps the name of Speccy out of the pending reviews. Absent means pr.attribution of the .speccy.yaml that each review uses.
Responses
Section titled “ Responses ”The batch, with its pull requests and the cost estimate.
object
What the batch took, such as a repo or a count of URLs.
object
The pull requests the batch will review. A skipped one is not counted.
The model calls the cache cannot answer.
False when a role has no price, so cost_usd is not complete.
True when no reviewer model is assigned, or the stages are empty.
object
Why a pull request is skipped, or why it failed.
The comments Speccy added to the pending review.
Speccy’s comments that it removed from the pending review, because their finding is gone.
object
The spec doc, relative to the repo root.
Build_ready or not_build_ready, or empty when the review of the doc failed.
The .speccy.yaml that the review used.
object
Repo: the .speccy.yaml of the repo at the commit. local: the .speccy.yaml of the folder that this Speccy serves, because the repo has none at the commit. none: the repo and the folder have none.
With repo, the file in the repo. With local, the file on this machine. With none, empty.
The pr section of the .speccy.yaml that the review used.
object
The most inline comments per spec doc. 0 means the default of 15.
The finding levels that go inline as comments. Empty means the default: MUST findings, and SHOULD findings with a suggestion.
None keeps the name of Speccy out of a pending review.
Example
{ "status": "planned", "items": [ { "state": "waiting", "config": { "source": "repo", "pr": { "levels": [ "must" ], "attribution": "speccy" } } } ]}default
Section titled “default”An error.
RFC 9457 problem details with a stable code.
object
A stable machine-readable error code.
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": "example"}