Pro monitoring
These routes need M2_ENABLED=1 on the API.
Same auth as the rest of the API: x-session-id.
When the flag is off you get 404 with code: "M2_DISABLED".
Most people use the Watch UI at pafcore.site/pro. This page is for the same engine over HTTP.
Projects
curl -s -X POST "$API/v1/projects" \
-H "content-type: application/json" \
-H "x-session-id: $SID" \
-d '{"name":"Marketing site"}'
curl -s -H "x-session-id: $SID" "$API/v1/projects"
Add a page to watch:
curl -s -X POST "$API/v1/projects/$PROJECT/targets" \
-H "content-type: application/json" \
-H "x-session-id: $SID" \
-d '{"url":"https://example.com/"}'
Domain proof
Required before a host can be scheduled.
curl -s -X POST "$API/v1/domains/verify" \
-H "content-type: application/json" \
-H "x-session-id: $SID" \
-d '{"hostname":"example.com"}'
# → token + DNS TXT and file instructions
curl -s -X POST "$API/v1/domains/$DOMAIN_ID/check" \
-H "content-type: application/json" \
-H "x-session-id: $SID" \
-d '{}'
curl -s -H "x-session-id: $SID" "$API/v1/domains"
curl -s -X DELETE "$API/v1/domains/$DOMAIN_ID" \
-H "x-session-id: $SID"
# Also deletes schedules on that hostname. Pages stay.
DNS TXT host: _pafcore.<hostname>
Value: pafcore-site-verification=<token>
Or file: https://<hostname>/.well-known/pafcore-site-verification.txt with the token as the body.
Schedules
Needs a Pro plan (or paid plan) and a proven domain for that page.
Fair use (does not spend credits): up to 20 saved pages, 10 active schedules, 3 hourly. Over the cap returns 403 with code: PLAN_LIMIT. Cron skips excess schedules with reason over_fair_use.
curl -s -H "x-session-id: $SID" "$API/v1/fair-use"
# → { fairUse: { targets, schedules, hourly }, limits: { maxTargets, maxSchedules, maxHourly } }
curl -s -X POST "$API/v1/schedules" \
-H "content-type: application/json" \
-H "x-session-id: $SID" \
-d '{"targetId":"'"$TARGET"'","cadence":"daily","device":"mobile"}'
curl -s -H "x-session-id: $SID" "$API/v1/schedules"
curl -s -X POST "$API/v1/schedules/$SCHEDULE/pause" \
-H "x-session-id: $SID" -d '{}'
curl -s -X POST "$API/v1/schedules/$SCHEDULE/resume" \
-H "x-session-id: $SID" -d '{}'
curl -s -X DELETE "$API/v1/schedules/$SCHEDULE" \
-H "x-session-id: $SID"
cadence is hourly or daily. Free plans get 403 with PLAN_REQUIRED. Unproven hosts get DOMAIN_UNVERIFIED.
History
Lab scores over time:
curl -s -H "x-session-id: $SID" "$API/v1/projects/$PROJECT/history"
curl -s -H "x-session-id: $SID" "$API/v1/targets/$TARGET/history"
Field data
Real visitor numbers from Chrome (CrUX):
curl -s -H "x-session-id: $SID" "$API/v1/targets/$TARGET/field?device=mobile"
curl -s -H "x-session-id: $SID" \
--get "$API/v1/field" \
--data-urlencode "url=https://example.com/"
Needs CRUX_API_KEY on the API for live Google data.
Alerts
curl -s -X POST "$API/v1/alerts" \
-H "content-type: application/json" \
-H "x-session-id: $SID" \
-d '{
"projectId":"'"$PROJECT"'",
"kind":"threshold",
"metric":"score",
"thresholdValue":50,
"webhookUrl":"https://hooks.example.com/pafcore"
}'
Outbound webhook body:
{ "text": "*Title*\nBody", "title": "...", "body": "..." }
Next
- Watch (Pro)
- Full curl guide in the repo:
docs/api-v1.md