POST /public/v1/rules
Starts an asynchronous rule creation job. Detail analyses the input you provide — a description, existing bugs, or commits — and generates the rule files. Returns aruleCreationRequestId you can use to poll for job status.
Request body
The repository ID the rule should be associated with. Must match the pattern
repo_*.The inputs Detail uses to generate the rule. All sub-fields are optional — if you omit all of them, Detail automatically proposes rules based on the repository’s existing bug history.
Response
The ID of the new rule creation request, prefixed with
rcr_. Use this to poll GET /public/v1/rules/requests/{rcr_id} for job status.Example response
GET /public/v1/rules
Returns all completed rules for a repository, ordered newest first. This endpoint only returns rules that have been successfully generated — use GET /public/v1/rules/requests to see rules that are still in progress.Query parameters
The repository ID to list rules for. Must match the pattern
repo_*.Response
Array of rule summary objects.
Example response
GET /public/v1/rules/{rule_id}
Returns full details for a completed rule, including the generated rule files. Use this after polling the request status endpoint and confirming that the job has acomplete status.
Path parameters
The rule ID to retrieve. Must match the pattern
rule_*.Response
Unique rule identifier, prefixed with
rule_.Human-readable name Detail assigned to the rule.
A map of filename to file content strings. Each key is a file path and each value is the text content of that rule file.
Unix timestamp (milliseconds) when the rule was created.
Example response
GET /public/v1/rules/requests
Returns all rule creation requests for a repository, ordered newest first. Each entry includes the original input, current status, and — once complete — a summary of the rules that were generated.Query parameters
The repository ID to list rule creation requests for. Must match the pattern
repo_*.Response
Array of rule creation request objects. See GET /public/v1/rules/requests/{rcr_id} for the full field reference.
GET /public/v1/rules/requests/{rcr_id}
Returns the current status and provenance of a rule creation job. Poll this endpoint after calling POST /public/v1/rules untilstatus is complete or failed.
Path parameters
The rule creation request ID to look up. Must match the pattern
rcr_*.Response
The rule creation request ID, prefixed with
rcr_.Current status of the job. One of:
pending— the job is queued and has not startedcomplete— the job finished and rules are availablefailed— the job encountered an error
The
CreateRuleInput submitted when the job was created — the description, bugIds, and commitShas you originally passed.Rules generated by this job. Empty until
status is complete.Unix timestamp (milliseconds) when the request was created.
Unix timestamp (milliseconds) when the job completed. Only present once the job has finished.
Example response
Full polling example
Rule generation typically completes within 30–60 seconds. We recommend polling every 5–10 seconds with a maximum of 20 attempts before surfacing an error to your users.

