In your ObservePoint Audits, you may want to change the starting URLs for various reasons:
- Ensure high priority pages get audited
- Ensure landing pages get audited that are not linked from your home page or sitemap
- Validate new pages before they are linked publicly
- Validate QA environments with dynamic URLs (e.g., Vercel test environments)
- Create many audits automatically, one per website you want to govern
This recipe updates an existing audit, but you can adapt this recipe to create new audits as well.
Find your Audit ID manually from the ObservePoint application or query the API:
Manually (useful for one-time testing): You can find the Audit ID in the ObservePoint application under "Data Sources" or in Reports --> "Recent Audit Runs". Click on the Audit you want, note the Audit ID and Run ID in the address bar.
From the API: You can query the API at
GET https://api.observepoint.com/v3/web-audits
to get the list of Audits in your account. You can also use the grid API to get audits.
Make an authenticated GET request to this URL to get the full current configuration of your Audit, including the starting URLs:
GET https://api.observepoint.com/v2/web-audits/{auditId}
This will return a JSON object that describes the audit configuration, like the following:
{
"name": "My Audit Name",
"startingUrls": [
"https://example.com/page1",
"https://example.com/page2"
],
"id": 1390894,
...
}
Replace the startingUrls
attribute with an array of valid URL strings, while keeping all other attributes unchanged. Optionally, you can also update the limit
attribute to match the number of URLs in startingUrls
. This ensures the audit only scans those specified pages without crawling additional ones.
Make a PUT call with the Audit object created above to the following endpoint:
PUT https://api.observepoint.com/v2/web-audits/{auditId}
{
// Keep all other attributes as they are
"startingUrls": [
"https://example.com/page3",
"https://example.com/page4"
],
// (optiona) If you want ObservePoint to visit *only* the starting URLs, set the
// limit equal to the number of starting URLs:
//"limit": 2,
...
}
ObservePoint will validate all the starting URLs you specify, and if any are invalid, the PUT
request will return a 422
status code, and the audit will not be updated.
Make an authenticated POST request to this URL with an empty payload to start the Audit:
POST https://api.observepoint.com/v2/web-audits/{auditId}/runs