Skip to main content

POST /api/static/sites/scan

Trigger a new scan run for a Site you already own. Use this to re-check a site after remediation or on a schedule. Requires an API key with the read-and-scan scope.

Request

Headers:
  • x-api-key (required): Your Rafter security API key, scope read-and-scan
  • Content-Type: application/json
Body: Provide projectId or url to identify the site. Optionally restrict the scan to specific sections. If both projectId and url are given, projectId is used and url is ignored.
Fields:

Example Request

Response

Success (200 OK):
Error (400 Bad Request — missing identifier):
Error (400 Bad Request — invalid url):
Returned when url is given (instead of projectId) and doesn’t resolve to a usable domain. Same validation and messages as Create Site — "Invalid URL format", "IP addresses and localhost are not allowed for security reasons", "Internal TLDs are not allowed", or "Invalid input: must be a non-empty string". Error (400 Bad Request — no pages to scan):
Returned when the site has no enabled discovery pages yet. Error (401 Unauthorized — missing key):
Error (401 Unauthorized — invalid key):
Error (403 Forbidden — wrong scope):
Error (403 Forbidden — run limit reached):
{N} is your plan’s per-project run limit — see rafter.so/pricing for current plan limits. Error (404 Not Found — not owned or doesn’t exist):
The 404 response is deliberately identical whether the site doesn’t exist or simply isn’t owned by your account — this avoids leaking which domains other accounts monitor.
Error (429 Too Many Requests):
Error (500 Internal Server Error):

Response Fields

Site scans are rate-limited to 10 requests per hour per account, separate from your scan quota. A 429 response includes X-RateLimit-Limit, X-RateLimit-Remaining, and X-RateLimit-Reset headers.

Examples

JavaScript

Python

Next Steps

Poll the Get Site endpoint with the site’s id to watch the run’s status and see the resulting findings summary once it completes.