API V2 reference (beta)
Mutings
A Muting represents a rule you've defined to automatically mute certain issues on your reports. Read more about Muting Rules.
Think of a Muting as a rule that defines a matching URL and issue message - when Rocket Validator finds issues on your web pages, they'll be automatically muted if there's a match.
Attributes
- ID
- Unique Muting ID.
- URL Match
- A string containing a match for a URL. It can be a full URL or any substring within it.
- Message
- A string defining a match for a Issue. It can be a full issue message, or part of it.
- Comment
- A brief comment to publicly explain why this muting is needed.
Example
Example: Muting structure
{ "data": { "attributes": { "comment": "Non standard but it's a Safari extension", "id": 868, "message": "Attribute \u201cautocorrect\u201d not allowed on element \u201cinput\u201d at this point.", "url_match": "https://dummy.rocketvalidator.com/" }, "id": "2513", "type": "muting" }, "jsonapi": { "version": "1.0" } }
Create a Muting
To create a Muting, send a POST request to /api/v2/mutings, with a JSON payload in the body including its attributes. There are two required attributes:
url_match. A string containing a match for a URL. It can be a full URL or any substring within it.message. A string defining a match for an Issue. It can be a full issue message, or part of it.
Optional attributes
comment. A brief comment to publicly explain why this muting is needed.
Example
The next example shows how to create a muting that will silence all issues mentioning image needs alt on all web pages where the URL contains example.com
Example: POST /api/v2/mutings
{ "data": { "attributes": { "url_match": "example.com", "message": "image needs alt", "comment": "a comment" } } }
Retrieve a Muting
To retrieve an individual Muting in your account, send a GET request to /api/v2/mutings/$MUTING_ID.
GET /api/v2/mutings/$MUTING_ID
List your Mutings
To list all your Mutings in your account, send a GET request to /api/v2/mutings.
GET /api/v2/mutings
List all mutings applied to a report
To list all the mutings that have been applied to a given report, send a GET request to /api/v2/reports/$REPORT_ID/mutings
GET /api/v2/reports/$REPORT_ID/mutings
Delete a Muting
To delete an individual Muting from your account, send a DELETE request to /api/v2/mutings/$MUTING_ID.
DELETE /api/v2/mutings/$MUTING_ID