Validate site ownership
Triggers an ownership check for a site. CacheBoost makes an HTTP request to the site and looks for the validation token.
POST
/v1/sites/{id}/validate
Requires scope: sites:write
The check is synchronous — the result is returned immediately. CacheBoost tries two methods, in order, over HTTPS then HTTP:
- HTML file — a file named
{validation_token}.htmlmust be accessible at the root of the site and return HTTP 200. - Meta tag — the homepage must contain
<meta name="cacheboost-token" content="{validation_token}">in its<head>.
The validation_token is returned when creating a site (POST /v1/sites) and also via GET /v1/sites/{id}.
Path parameters
| Parameter | Type | Description |
|---|---|---|
id | integer | Site ID. |
Example request
curl -X POST https://api.cache-boost.com/v1/sites/42/validate \
-H "Authorization: Bearer cb_live_YOUR_KEY"
Responses
200 — Validation succeeded
{ "validated": true }
200 — Already validated
{ "validated": true, "already_validated": true }
422 — Token not found
{
"validated": false,
"error": "Validation token not found on the site."
}
Errors
| Code | Description |
|---|---|
401 | Missing or invalid API key. |
403 | Insufficient scope (sites:write required). |
404 | Site not found or not accessible with this key. |
422 | Validation token not found on the site. |