REST API
All routes are under the stacko-a11y/v1 namespace, for example /wp-json/stacko-a11y/v1/settings. They use normal WordPress REST authentication. From wp-admin scripts, @wordpress/api-fetch adds the nonce for you.
These routes exist mainly for the plugin’s own screens. They are documented so you can read results from your own code, but the API is not stable yet and may change before launch.
| Method | Route | Purpose | Permission |
|---|---|---|---|
GET |
/settings |
Read settings | manage_options |
POST, PUT, PATCH |
/settings |
Update settings | manage_options |
POST |
/scans |
Save a scan | May scan the post (or URL) |
GET |
/scans/latest |
Latest scan of a post or URL | May scan the post (or URL) |
POST |
/ignores |
Ignore an issue | May ignore the issue |
DELETE |
/ignores |
Reopen an issue | May ignore the issue |
GET |
/overview |
Site summary | May use the checker |
GET |
/issues |
Open issues, filtered and paginated | May use the checker |
GET |
/queue |
Pages for the site check | manage_options and may use the checker |
The permission rules are described in Architecture.
Settings
Section titled “Settings”GET /settings
Section titled “GET /settings”Returns the full settings object. See the settings schema.
POST /settings
Section titled “POST /settings”Send only the keys you want to change. Unknown keys are ignored. Returns the full, saved settings object.
{ "standard": "wcag21aa", "best_practices": false}POST /scans
Section titled “POST /scans”Saves one scan with all its issues. Reports use the newest scan of each page. Only the last 5 scans per post or URL are kept. For a post, the scan also updates the stacko_a11y_summary post meta.
| Field | Type | Notes |
|---|---|---|
object_id |
integer | Post id, or 0 for a page that is not a post (an archive, for example). Default 0. |
url |
string (URI) | Required. Up to 2,000 characters. |
context |
string | Required. editor, frontend or queue. |
score |
integer | Required. 0–100. |
counts |
object | Required. { "must": n, "should": n, "review": n } |
rules_version |
string | Up to 20 characters |
issues |
array | Up to 2,000 issues. See below. |
Each issue:
| Field | Type | Notes |
|---|---|---|
fingerprint |
string | Required. 32 lowercase hex characters. |
rule_id |
string | Required. Lowercase letters, digits and hyphens, up to 64 characters. |
level |
string | Required. must, should or review. |
scope |
string | Required. content or site. |
viewport |
string | all, desktop or mobile. Default all. |
selector |
string | Required. Stored up to 1,000 characters. |
block_path |
string or null | Format index:blockName, for example 3:core/image |
snippet |
string | Required. Stored up to 300 characters, as plain text. |
Response (201):
{ "scan_id": 42, "ignored": { "3f2a…": { "reason": "false_positive", "note": "", "object_id": 0 } }}ignored lists the ignores that apply to this post, including site-wide ignores (object_id 0), keyed by fingerprint.
Returns 404 with code stacko_a11y_no_post if object_id is not an existing post.
GET /scans/latest
Section titled “GET /scans/latest”| Parameter | Type | Notes |
|---|---|---|
object_id |
integer | Post id. Default 0. |
url |
string (URI) | Used when object_id is 0 |
Response:
{ "scan": { "id": 42, "object_type": "post", "object_id": 12, "url": "https://example.com/about/", "context": "editor", "score": 87, "counts": { "must": 1, "should": 3, "review": 0 }, "rules_version": "1", "created_at": "2026-11-20T10:15:00" }, "issues": [], "ignored": {}, "trend": [72, 80, 87]}scan is null if the page has not been checked. trend holds the scores of up to the last 5 scans of a post, oldest first. It is empty for URLs that are not posts.
Ignores
Section titled “Ignores”POST /ignores
Section titled “POST /ignores”| Field | Type | Notes |
|---|---|---|
fingerprint |
string | Required. 32 lowercase hex characters. |
rule_id |
string | Required |
reason |
string | Required. false_positive, fixed_elsewhere or accepted. |
note |
string | Up to 255 characters |
object_id |
integer | Post id. Default 0. |
scope |
string | content (default) or site |
Site-wide ignores are always stored with object_id 0, so they apply to every page. They need edit_theme_options. Content ignores need edit_post on the post.
Response (201): { "ignored": true }
DELETE /ignores
Section titled “DELETE /ignores”Takes fingerprint, object_id and scope as above. Response: { "reopened": true }, or false if there was nothing to remove.
Reports
Section titled “Reports”These routes read the latest scan of every checked page and leave out ignored issues.
GET /overview
Section titled “GET /overview”{ "pages": 24, "score": 91, "last_scan": "2026-11-20T10:15:00", "counts": { "must": 3, "should": 11, "review": 2 }, "site_wide": 2, "top_rules": [ { "rule_id": "image-alt", "level": "must", "issues": 3, "pages": 2 } ], "worst": [ { "score": 64, "must": 2, "should": 4, "scanned_at": "2026-11-20T10:15:00", "object_id": 12, "title": "About", "url": "https://example.com/about/", "edit_url": "https://example.com/wp-admin/post.php?post=12&action=edit" } ]}scoreis the average of the latest score of every checked page, ornullif nothing has been checked.- In
counts, content issues count once per page and site-wide issues count once in total. top_ruleslists up to 5 rules from page content, most serious first.worstlists up to 5 pages that score below 100, lowest first.
GET /issues
Section titled “GET /issues”| Parameter | Type | Notes |
|---|---|---|
level |
string | must, should or review |
scope |
string | content or site |
rule |
string | Rule id |
post_type |
string | Post type slug |
page |
integer | Default 1 |
per_page |
integer | 1–100, default 50 |
Returns an array of issues, most serious first. Totals are in the X-WP-Total and X-WP-TotalPages headers. A site-wide issue is returned once, with pages set to the number of pages it appears on.
[ { "id": 301, "fingerprint": "3f2a…", "rule_id": "color-contrast", "level": "must", "scope": "content", "viewport": "all", "selector": ".wp-block-button__link", "snippet": "<a class=\"wp-block-button__link\" …>", "block_path": "4:core/button", "pages": 1, "object_id": 12, "title": "About", "url": "https://example.com/about/", "edit_url": "https://example.com/wp-admin/post.php?post=12&action=edit" }]snippet is untrusted HTML from the scanned page. Always escape it before you display it.
Site scan queue
Section titled “Site scan queue”GET /queue
Section titled “GET /queue”Returns published items of the queued post types, most recently modified first, up to 2,000. The post types can be changed with the stacko_a11y_queue_post_types filter.
[ { "post_id": 12, "title": "About", "url": "https://example.com/about/", "scan_url": "https://example.com/about/?preview=true&stacko_a11y_scan=…", "scanned_at": "2026-11-20T10:15:00", "score": 87 }]scan_url is a signed preview URL. It only works for the user who requested it, while their nonce is valid. scanned_at and score are null for pages that have not been checked.