CrawlClick API errors and refusals
The external routes can refuse a request in 25 documented ways, with 12 distinct codes. Each one names what to do next.
A refusal body is JSON of the form {"error": "…", "code": "…"}. The error sentence is for people and may be reworded. The code is the stable part, so branch on it. Two refusals are exceptions and show a dash for the code. The access-request form sends only the sentence. The conversion postback’s unknown click sends{"status": "unknown_click"}. Status codes follow HTTP meaning. A 4xx will fail the same way if you resend it unchanged. A 503 is worth retrying, and so is a 429 after a short back-off, because the rate limit refills continuously.
What does each error code mean, and what should I do?
| Status | Code | Route | Means | Do instead |
|---|---|---|---|---|
| 400 | bad_request | POST /v1/decide | The body is not JSON of this shape. An empty body is accepted and treated as {"safe": true}. | Send a JSON object with only the four documented fields. consumer, channel and tier are ignored if sent: they are fixed on your account. |
| 400 | bad_request | POST /v1/decide/receipts | The body lacks decision_id, key_id or signature. | Send all three as strings. |
| 400 | invalid_decision | POST /v1/decide/receipts | The decision_id was not issued by this service, or was altered. | Send the token byte for byte as /v1/decide returned it; do not decode, re-encode or trim inner characters. |
| 400 | bad_request | POST /v1/conversions | The body is not JSON with a click_id string. | Send {"click_id": "…"} with the cc_click value. |
| 401 | invalid_key | POST /v1/decide | The bearer token is missing, unknown, revoked, or lacks the scope this route needs. | Send Authorization: Bearer ccp_… with the key CrawlClick issued. A rotated or revoked key stops working within about ten seconds; ask CrawlClick for a new one. |
| 401 | invalid_key | POST /v1/decide/receipts | The bearer token is missing, unknown, revoked, or lacks the scope this route needs. | Send Authorization: Bearer ccp_… with the key CrawlClick issued. A rotated or revoked key stops working within about ten seconds; ask CrawlClick for a new one. |
| 401 | bad_receipt_signature | POST /v1/decide/receipts | The signature does not verify against the public key registered under key_id. | Sign the exact message bytes, with no trailing newline, using the private half of the registered key, and send the signature as unpadded base64url. |
| 401 | invalid_key | POST /v1/conversions | The key is missing or is not the advertiser’s current conversion key. | Create a new key in the console (it is shown once) and store it server-side only. |
| 401 | invalid_token | POST /v1/app/mcp | No token, or an expired one. The response carries WWW-Authenticate: Bearer resource_metadata=…. | Follow resource_metadata to discover the authorisation server and run the OAuth flow again, or use your refresh token. |
| 403 | not_your_decision | POST /v1/decide/receipts | The decision was issued to another partner account. | Confirm decisions only with the key of the account that requested them. |
| 403 | — | POST /v1/access-requests | The request did not come from the CrawlClick website. | Apply through the form at www.crawlclick.com/request-access/. There is no server-to-server way to apply. |
| 404 | — | POST /v1/conversions | The body is {"status": "unknown_click"}, with no code. The click_id is not 32 hexadecimal characters, or the click was settled for another advertiser’s campaign. A well-formed id that has not settled yet is not refused: it is answered pending. | Send the cc_click value unchanged, in lower case as it arrived. Do not report conversions for traffic that did not arrive with one. |
| 404 | not_found | POST /v1/conversions | The CrawlClick Earn app is not enabled on this deployment. Every request gets this answer until it is. | Nothing to fix on your side. Keep the integration ready; the route starts answering when the Earn channel opens. |
| 405 | method_not_allowed | POST /v1/app/mcp | GET and DELETE are not served; there is no server-to-client stream. | POST each JSON-RPC message. |
| 410 | decision_expired | POST /v1/decide/receipts | The decision is older than its expires_at (15 minutes after issue). | Do not confirm it. A decision you did not confirm in time costs nothing and earns nothing. |
| 413 | — | POST /v1/decide | The body is over 65,536 bytes. The body is {"error": "body too large"}, with no code. | Send only the documented fields. Truncate query and topics on your side. |
| 413 | — | POST /v1/decide/receipts | The body is over 65,536 bytes. The body is {"error": "body too large"}, with no code. | Send only the documented fields. Truncate query and topics on your side. |
| 422 | — | POST /v1/access-requests | A required field is missing or invalid, or the Turnstile check failed. | Correct the field named in the error sentence and resubmit from the form. |
| 429 | rate_limited | POST /v1/decide | Your per-minute request limit, set on your partner account, was exceeded. | Back off and retry. The limit is a token bucket that refills continuously at your per-minute rate, counted per partner and separately for decisions and receipts. |
| 429 | rate_limited | POST /v1/decide/receipts | Your per-minute request limit, set on your partner account, was exceeded. | Back off and retry. The limit is a token bucket that refills continuously at your per-minute rate, counted per partner and separately for decisions and receipts. |
| 500 | internal | POST /v1/conversions | An unexpected server error. | Retry later with the same body. |
| 503 | — | POST /v1/decide | The service is at capacity. The body is empty and Retry-After: 1 is set. | For a decision, answer without a placement. For a receipt, retry after a second. |
| 503 | — | POST /v1/decide/receipts | The service is at capacity. The body is empty and Retry-After: 1 is set. | For a decision, answer without a placement. For a receipt, retry after a second. |
| 503 | unavailable | POST /v1/decide/receipts | The receipt could not be written as evidence. | Retry the same receipt. Keep your own serve log: it is what reconciliation compares against. |
| 503 | unavailable | POST /v1/conversions | The conversion could not be recorded, or accounts are unavailable. | Retry the same request. A conversion is recorded at most once per click, so a retry cannot double-count. |
What errors does the publisher edge show a crawler?
None of its own. The edge fails open: if CrawlClick answers with any 4xx or 5xx, times out or cannot be reached, the Worker fetches the page from your origin and returns that instead. A crawler or reader never sees a CrawlClick error on your hostname. Failure behaviour lists every case.