Skip to documentation
AdQuestDocs

Errors

Error codes returned by the API and SDK, and what to check for each.

On this page

Error codes and next steps

Code / symptomWhat to check
INVALID_API_KEYKey value, environment, rotation and disabled / revoked status.
INACTIVE_PLATFORMBoth approval and activation are required.
ORIGIN_FORBIDDEN / PACKAGE_FORBIDDENThe platform’s Where AdQuest may appear list: exact origin or package, and the hosted embed origin.
PARTICIPANT_AUTH_REQUIRED / PARTICIPANT_EXPIREDMint or refresh through your authenticated backend; use the same user and platform.
PARTICIPANT_BLOCKEDResolve participant account status; refreshing alone will not help.
HOST_CONTEXT_INVALID / HOST_CONTEXT_TOO_LARGEContext shape, permission values and the 8 KB limit.
QUEST_NOT_FOUNDQuest ID, visibility, lifecycle and participant eligibility.
TIMER_NOT_STARTED / invalid watch evidenceStart the quest and satisfy actual duration / progress requirements.
INVALID_ANSWERThe selected option, required questions and verification settings.
ALREADY_COMPLETEDRefresh participant state instead of granting again.
CAPACITY_EXHAUSTED / RATE_LIMITEDWait or resolve delivery limits. Back off instead of retrying in a loop.
INSUFFICIENT_TOKENS / LOTTERY_CLOSED / ENTRY_LIMIT_REACHEDRefresh lottery state and balance before another confirmed purchase.
NETWORK_ERROR / CORS failureAPI reachability, HTTPS, origin restrictions and browser network details.

The API can return more specific evidence errors in data.code or data.reason. If the SDK maps an unfamiliar code to UNKNOWN, inspect the response details rather than treating it as success.

Using the wrong key

CodeHTTPWhat it means
PLATFORM_KEY_USED_AS_SECRET401You sent the public API key (aqk_) as the Secret Key. Use the aqs_ key on your server.
WEBHOOK_SECRET_USED_AS_SECRET401You sent the webhook signing secret (whsec_) as the Secret Key. It only verifies incoming webhooks.
PARTICIPANT_AUTH_REQUIRED401The Secret Key or participant token is missing or does not match.

Quest evidence errors

Quest routes return the code in the top-level code field and in data.code. A request that fails validation is HTTP 422 unless a status is listed.

CodeHTTPRaised when
NOT_EVENT_QUEST400You sent an event to a quest that is not an event quest.
INVALID_EVENT400The event payload is not valid.
EVENT_NAME_MISMATCH400The event name is not the one the quest waits for.
EVENT_SOURCE_FORBIDDEN400The event source (sdk or server) is not allowed for this quest.
EVENT_WINDOW_EXPIRED422The event arrived outside the quest’s attribution window.
EVENT_CAP_REACHED422The participant reached the quest’s completion limit.
INVALID_EVENT_SIGNATURE401The signature of a server event does not match.
INVALID_DELIVERY_TOKEN401The delivery token is missing or not valid for this participant.
NOT_VISIT_QUEST400You called visit on a quest that is not a visit quest.
INVALID_REDIRECT422The quest’s destination link is not valid.
NOT_REFERRAL_QUEST422You attributed a referral on a quest that is not a referral quest.
INVALID_REFERRAL_CODE422The referral code does not exist.
SELF_REFERRAL422A participant used their own referral code.
ACCOUNT_REUSED, DEVICE_REUSED422The account or device was already counted for another referral.
REFERRAL_REQUIRED422The quest needs a referral attribution first.
QUEST_BUDGET_EXHAUSTED422The quest’s budget is used up.
PROGRESS_UNSUPPORTED422You sent a progress metric to a quest that does not track progress.
QUEST_SETTLEMENT_FAILED422The reward could not be settled. Retry later or contact support.
PREVIEW_READONLY403A theme preview cannot complete quests, enter lotteries or submit claims.

Lottery and claim errors

Lottery and claim routes return the code in data.code. They have no top-level code.

CodeHTTPRaised when
LOTTERY_NOT_FOUND404The lottery does not exist or is not visible to this platform.
LOTTERY_NOT_AVAILABLE404Country policy hides the lottery from this participant.
LOTTERY_CLOSED422The lottery is not open for entries.
ENTRY_LIMIT_REACHED422The participant reached the lottery’s entry limit.
INSUFFICIENT_TOKENS422The participant does not have enough tokens.
DUPLICATE_PURCHASE409The idempotency_key was already used for a different lottery or participant.
CLAIM_NOT_AVAILABLE404 or 422The claim is not the participant’s (404), or it is closed or expired (422).

Streak callback errors

CodeHTTPRaised when
STREAK_CALLBACK_NOT_FOUND404The callback token does not match a quest.
INVALID_STREAK_USER422The user ID is missing or not valid.
STREAK_DAY_LOCKED422Today’s day is not unlocked yet.
STREAK_FROZEN422The streak is frozen after a missed day.
TIMEZONE_ABUSE422The participant’s timezone changed in a way that looks like abuse.
STREAK_CALLBACK_REQUIRED422You called complete on a streak quest. Use the callback URL.
RATE_LIMITED429Too many requests.

Winner contact errors

CodeHTTPRaised when
WINNER_CONTACT_INVALID422The email is not valid.
CLAIM_NOT_AVAILABLE404The claim does not exist or is not available.

Next steps

Something unclear, missing or wrong here? Tell us