Skip to main content
All errors follow a consistent format with clear messages to help you diagnose and resolve issues quickly.

Error response format

Every error response from the Knot API uses the same JSON structure:

HTTP status codes

When you receive a 429 response, do not immediately retry. Implement exponential backoff to avoid being blocked for longer periods.

Common error scenarios

Cause: The OTP code is incorrect or has expired. OTP codes are valid for 10 minutes.Solution: Request a new OTP and retry authentication.
Cause: The wallet doesn’t have enough funds for the requested operation.Solution: Check balances before operations and ensure sufficient funds are available.
Cause: The transaction violates the agent’s policy settings.Solution: Wait for the daily limit to reset, increase the limit via policy update, or reduce the transaction size.
Cause: The JWT token has reached its expiration time.Solution: Re-authenticate to obtain a new token.
Cause: Your request rate has exceeded the per-IP or per-agent limit.Solution: Implement exponential backoff and retry after waiting.

Error handling patterns

Exponential backoff

For 429 and 503 errors, wait progressively longer between retries:

Handle authentication errors

Watch for 401 responses and re-authenticate automatically:

Log all errors

Maintain detailed error logs for debugging:
Never retry a failed transaction without generating a new idempotency key. Using the same key may return a cached error response rather than retrying the operation.