HTTP Status Codes
Error Response Format
All API errors follow this format:Common Error Codes
Authentication Errors
UNAUTHORIZED
- Missing
Authorizationheader - Invalid API key format
- Expired API key
- Revoked API key
- Check the
Authorizationheader is set correctly: - Verify the API key in the Developer Portal
- Generate a new API key if needed
FORBIDDEN
- API key doesn’t have access to the project
- Attempting to access another project’s resources
- Verify you’re using the correct API key
- Check the resource belongs to your project
Resource Errors
NOT_FOUND / POLICY_NOT_FOUND
- Policy ID doesn’t exist
- Policy was deleted
- Typo in the policy ID
- Verify the policy ID in the Developer Portal
- Check for typos (IDs are case-sensitive)
- Confirm the policy hasn’t been deleted
SWIG_ID_EXISTS / CONFLICT
- Duplicate custom Swig ID
- Retry with same ID after successful creation
- Use a unique Swig ID
- Omit
swigIdfor auto-generation - Check if the wallet was already created
Validation Errors
BAD_REQUEST
- Missing required fields
- Invalid field values
- Malformed JSON
- Check all required fields are provided
- Validate field formats and values
- Ensure valid JSON in request body
MISSING_URL
- SDK not configured with portal URL
Rate Limit Errors
RATE_LIMITED
- Exceeded requests per minute
- Burst of requests
- Implement exponential backoff
- Reduce request frequency
- Upgrade subscription for higher limits
Paymaster Errors
INSUFFICIENT_BALANCE
- Paymaster wallet has no SOL
- Transaction fee exceeds available balance
- Fund the paymaster wallet
- Reduce transaction complexity
LIMIT_EXCEEDED
- Exceeded SOL usage threshold
- Exceeded API call threshold
- Exceeded subscription limit
- Wait for monthly reset
- Increase paymaster limits
- Upgrade subscription
SINGLE_TX_LIMIT_EXCEEDED
- Transaction fee exceeds per-transaction limit
- Increase single TX limit in paymaster settings
- Simplify the transaction
Subscription Errors
SUBSCRIPTION_REQUIRED
- Attempting to use paymaster on FREE tier
- Feature requires upgrade
- Upgrade to PRO or higher
- Use free tier features only
SDK Error Handling
API SDK (@swig-wallet/api)
Developer SDK
The TypeScript Developer SDK throwsSwigDeveloperSdkError. Inspect its
HTTP status and code when handling failed API calls. See
Developer API Errors for response formats and status
handling.
Retry Strategies
Exponential Backoff
For transient errors (5xx, network issues):SDK Built-in Retry
The API SDK supports retry configuration:Debugging Tips
Enable Logging
Log requests and responses for debugging:Check API Key
Verify your API key is correct:- Log in to Developer Portal
- Go to API Keys
- Verify the key exists and isn’t expired
Validate Inputs
Before sending requests:Use Test Environment
Test on devnet first:Getting Help
If you’re stuck:- Check this guide - Most common issues are covered above
- Search the docs - Use the search function
- Community support - Join our Telegram
- GitHub issues - Report bugs at swig-wallet
- Email support - Paid tiers get email support
- Error code and message
- Request details (sanitize sensitive data)
- Steps to reproduce
- SDK version

