Ask the AI to rewrite every reword finding of one check, with one call for each section. The doc does not change.
POST
/runs/{runId}/fixes
const url = 'https://example.com/api/v1/runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/fixes';const options = { method: 'POST', headers: {'Content-Type': 'application/json'}, body: '{"check_slug":"example"}'};
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/runs/2489E9AD-2EE2-8E00-8EC9-32D5F69181C0/fixes \ --header 'Content-Type: application/json' \ --data '{ "check_slug": "example" }'Parameters
Section titled “ Parameters ”Path Parameters
Section titled “Path Parameters”runId
required
string format: uuid
Request Bodyrequired
Section titled “Request Bodyrequired”Media typeapplication/json
object
check_slug
required
A reword check, such as lint.passive-voice.
string
Examplegenerated
{ "check_slug": "example"}Responses
Section titled “ Responses ”One rewrite for each section that passes the check after it, and the sections Speccy dropped.
Media typeapplication/json
object
check_slug
required
string
version_id
required
The version the rewrites were written for.
string format: uuid
sections
required
Array<object>
One section rewritten for every reword finding of one check in it.
object
finding_id
required
The finding that holds the rewrite. Send it to accept the rewrite.
string format: uuid
file
required
string
heading_path
required
Array<string>
old
required
string
new
required
string
line
required
integer
end_line
required
integer
findings
required
How many findings of the check the rewrite fixes.
integer
dropped
required
Array<object>
A section whose rewrite Speccy did not keep.
object
heading_path
required
Array<string>
reason
required
string
calls
required
The model calls made, one for each section with a reword finding of the check.
integer
Examplegenerated
{ "check_slug": "example", "version_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "sections": [ { "finding_id": "2489E9AD-2EE2-8E00-8EC9-32D5F69181C0", "file": "example", "heading_path": [ "example" ], "old": "example", "new": "example", "line": 1, "end_line": 1, "findings": 1 } ], "dropped": [ { "heading_path": [ "example" ], "reason": "example" } ], "calls": 1}default
Section titled “default”An error.
Media typeapplication/problem+json
RFC 9457 problem details with a stable code.
object
type
required
string
title
required
string
status
required
integer
detail
string
instance
string
code
required
A stable machine-readable error code.
string
Examplegenerated
{ "type": "example", "title": "example", "status": 1, "detail": "example", "instance": "example", "code": "example"}