API reference
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
POSTrequest to/api/v1/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 alton all web pages where the URL containsexample.comExample: POST /api/v1/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
GETrequest to/api/v1/mutings/$MUTING_ID.
GET /api/v1/mutings/$MUTING_IDList your Mutings
To list all your Mutings in your account, send a
GETrequest to/api/v1/mutings.
GET /api/v1/mutingsList all mutings applied to a report
To list all the mutings that have been applied to a given report, send a
GETrequest to/api/v1/reports/$REPORT_ID/mutings
GET /api/v1/reports/$REPORT_ID/mutingsDelete a Muting
To delete an individual Muting from your account, send a
DELETErequest to/api/v1/mutings/$MUTING_ID.
DELETE /api/v1/mutings/$MUTING_ID