Guides · For publishers · Intermediate
How the Edge Verify API Decides Access
The edge gateway calls POST /api/v1/access/verify before going to origin and reads one field, accessGranted. If it is true, fetch the content. If it is false, return the statusCode and JSON body to the crawler unchanged.
You're reading the full report — free for humans. The machine-readable dataset for this section is open to all agents too — no payment required.
https://esa.aisa.one/api/v1/access/verify
This guide is for publishers and CDN or ESA integrators who put AISA in front of their content to decide whether a crawler gets in for free, pays, or is blocked. You will see exactly what the gateway sends to the verify endpoint, which decisions come back, and what the crawler receives. You will also see how price intent works and why 402 and 403 bodies must reach the crawler untouched. A table at the end lists every verify outcome.
How the flow works
Before you start
- A gateway token issued out-of-band by AISA
- Rules configured for your site in the publisher console
- An edge gateway that can make a server-to-server POST before origin fetch
Step by step
Send the two auth layers in headers
The verify call uses two independent layers. The gateway layer is Authorization: Bearer with your gateway token, and a failure returns 401 gateway_unauthorized. The crawler layer is X-Crawler-Token, forwarded verbatim if the crawler sent one; it replaces the earlier name X-AISA-Crawler-Token. Also forward the original crawler user agent, because gateways rewrite User-Agent. Never put the crawler token in Authorization.
http POST /api/v1/access/verify HTTP/1.1 Host: cdn.aisa.one Authorization: Bearer YOUR_ESA_GATEWAY_TOKEN X-Crawler-Token: YOUR_CRAWLER_TOKEN X-ESA-Original-Crawler-Agent: ORIGINAL-CRAWLER-UA X-Request-Id: req-8c85ba19abef566b Content-Type: application/jsonBuild the JSON request body
Send publisherDomain (the request Host) and resourceUrl (the requested path). Add crawlerAgent: the identifier if your gateway recognised the bot, otherwise the original user agent string. Add one price intent field; crawlerAutoPrice set to true is the recommended mode. A crawler with no token should still be sent, because the decision flow answers it with 402 and onboarding guidance. Query strings are stripped before rule matching.
text Body fields (JSON object): publisherDomain: PUBLISHER-SITE resourceUrl: /path/of/requested/resource crawlerAutoPrice: true crawlerAgent: gptbotPick one price intent mode
crawlerAutoPrice, crawlerExactPrice and crawlerMaxPrice are mutually exclusive. Auto charges the resource price in one request if the balance covers it. Sending none is price discovery: no charge, 402 with error price_required plus price and currency. Exact, for example USD 0.10, charges only on a full match, otherwise 402 price_mismatch. Max charges the real price if it is within the cap, otherwise 402 price_too_high.
Branch on accessGranted
Minimal integrations read one field. When accessGranted is true, serve the content by fetching from origin or cache. When it is false, do not serve anything; return statusCode and the response body to the crawler. Rules are first-match-wins: block gives 403 access_blocked, allow gives a free 200, and pay needs a valid token and balance. No matching rule means a default allow, not charged.
text if accessGranted is true: fetch from origin or cache and serve the content else: respond with statusCode and the verify JSON body, unmodifiedPass 402 and 403 bodies through unmodified
On a denial, the JSON carries onboarding and a guidance block that teach a new crawler to register, fund a balance and retry with X-Crawler-Token. Deliver that JSON unchanged; it is how unknown crawlers become paying ones. A 402 means payment can unlock the resource, while 403 means the publisher blocked it and payment will not help. Render your own block page if you want one, since AISA returns JSON only.
Handle gateway-side errors separately
A 401 gateway_unauthorized means your gateway token is missing or invalid, so check the key configured in the console; this is for operators, not crawlers. A 400 covers missing fields, conflicting price fields or a bad price format (invalid_price_format). A 500 internal_error is a provider fault, handled by your timeout and failure policy. On retries after a timeout, reuse the same X-Request-Id so both sides can reconcile charges.
Verify outcomes and what the crawler gets
| Outcome | Status and error | Trigger | Gateway action |
|---|---|---|---|
Allowed free | 200, accessGranted true | allow rule, or no rule matched (default allow); not charged | Fetch from origin and serve content |
Paid and charged | 200, charged true | pay rule, valid token, sufficient balance, price intent sent | Fetch from origin and serve content |
Token problem | 402 invalid_token | Token missing, not recognised, or account inactive | Pass 402 JSON through with onboarding |
Low balance | 402 insufficient_balance | Balance below price; crawler.shortfall may be included | Pass 402 JSON through |
Price negotiation | 402 price_required, price_mismatch, price_too_high | No price intent, exact price differs, or max price below the real price | Pass 402 JSON through |
Blocked | 403 access_blocked | block rule matched, whatever the token or balance | Pass 403 JSON through |
Gateway auth failed | 401 gateway_unauthorized | Gateway token missing or invalid | Operator checks the console key |
Bad request or provider fault | 400 invalid_price_format, 500 internal_error | Malformed price string, or internal error | Fix the request, or apply failure policy |
Common pitfalls
- Do not place the crawler token in Authorization: Bearer. That slot is the gateway layer, so the call returns 401 gateway_unauthorized instead of 402 invalid_token.
- Do not send more than one of crawlerAutoPrice, crawlerExactPrice and crawlerMaxPrice. They are mutually exclusive, and combining them returns a 400.
- Do not rewrite or trim 402 and 403 bodies. The onboarding and guidance fields are how new crawlers learn to register and pay.
- Do not rely on User-Agent for crawler identity. Gateways rewrite it, so forward the original in X-ESA-Original-Crawler-Agent and crawlerAgent.
Key takeaways
- Read accessGranted: true means fetch from origin, false means return statusCode and the JSON body to the crawler.
- Two auth layers stay separate: gateway token in Authorization, crawler token in X-Crawler-Token.
- 402 means payment can unlock the resource; 403 access_blocked means the publisher blocked it.
FAQ
What does the edge gateway send to POST /api/v1/access/verify?
Headers: Authorization: Bearer with the gateway token, X-Crawler-Token forwarded from the crawler, X-ESA-Original-Crawler-Agent, and optionally X-Request-Id. Body: publisherDomain, resourceUrl, a price intent such as crawlerAutoPrice, and crawlerAgent.
Which header carries the crawler token?
X-Crawler-Token. It replaces the earlier X-AISA-Crawler-Token, which older pages still show. The body field crawlerToken is an alternative, and when both are present the header wins.
What happens when a crawler sends no token?
The request is not rejected outright. On a pay rule it gets 402 with error invalid_token plus onboarding and guidance. On an allow rule or with no matching rule it still gets a free 200.
What is the difference between 402 and 403 from verify?
A 402 says payment or registration can unlock the resource. A 403 access_blocked means a block rule matched, so no token or balance will help. Pass both JSON bodies to the crawler unchanged.
How this page is made. Written from 4 primary sources — the AISA agent and publisher documentation and AgentFlare's own files (pricing.json, robots.txt, llms.txt, live responses, .data.json field lists). Each step links the sources it relies on; steps naming a header, endpoint, error code or figure that the sources do not contain are removed. Refreshed weekly.
Sources & citations
- Header name: X-Crawler-Token esa.aisa.one
- Open Verify specification (edge gateway ↔ verify provider) esa.aisa.one
- AISA verify API for publishers and edge gateways (llms.txt) esa.aisa.one
- AISA publisher API documentation esa.aisa.one