Apify API 400, 401, 402 (x402) and 403: what each means

Read error.type in the response body. 400 is invalid Actor input. 401 (user-or-token-not-found) means a token reached Apify but it is wrong or revoked. 402 with x402-payment-required means no token reached Apify at all: the n8n credential or the Authorization: Bearer header is missing, and Apify is offering its pay-per-run x402 route for agents instead; any other 402 is an exhausted usage limit on the account that pays for the run. 403 is a token without permission for that Actor or storage.

Source: Apify API: authentication; Apify documentation: agentic payments with x402; Apify API: run Actor synchronously and get dataset items. Applies to: n8n workflows, Apify API from code.

The question people ask

What do 400, 401, 402 and 403 from the Apify API mean?

Where to fix it on this site

A known-good workflow to compare against: Google Maps leads to Google Sheets (validated, not run).