Getting Started
The PathGuard API lets you programmatically check affiliate link health, detect affiliate networks, run batch checks, set up monitors, and generate dispute evidence.
Base URL
All API requests are made to:
https://pathguard-api.robertberrisford.workers.dev
Quick Example
Run a health check on an affiliate link:
curl
curl -X POST https://pathguard-api.robertberrisford.workers.dev/v1/checks \
-H "Content-Type: application/json" \
-H "Authorization: Bearer pg_live_your_key_here" \
-d '{"url": "https://www.awin1.com/cread.php?awinmid=1234&awinaffid=5678&p=https://example.com"}'Response Format
All successful responses wrap the result in a data field. List endpoints also include a has_more boolean for pagination.
Success response
{
"data": {
"slug": "abc123",
"healthScore": 85,
"network": "Awin",
"willTrack": true,
"issues": [
{
"code": "short_cookie_expiry",
"severity": "warning",
"title": "Short cookie expiry",
"description": "Cookie expires in 7 days (typical is 30+).",
"fix": "Contact the advertiser to extend cookie duration."
}
],
...
}
}Errors follow a consistent envelope with type, code, message, and request ID:
Error response
{
"error": {
"type": "authentication_error",
"code": "invalid_api_key",
"message": "The API key provided is invalid or has been revoked.",
"request_id": "req_abc123"
}
}Next Steps
- Authentication — API keys, anonymous access, and Clerk JWT
- Errors — Error types, codes, and status mapping
- Rate Limits — Request limits and response headers
- Billing & Credits — Free tiers, check costs, and credit packs
- Use Cases — Practical workflows for checks, batches, and monitoring
- Endpoint Reference — Interactive API explorer with request/response schemas