Skip to main content
This guide covers common errors, their causes, and how to resolve them when using the Swig Developer Portal API.

HTTP Status Codes

Error Response Format

All API errors follow this format:

Common Error Codes

Authentication Errors

UNAUTHORIZED

Causes:
  • Missing Authorization header
  • Invalid API key format
  • Expired API key
  • Revoked API key
Solutions:
  1. Check the Authorization header is set correctly:
  2. Verify the API key in the Developer Portal
  3. Generate a new API key if needed

FORBIDDEN

Causes:
  • API key doesn’t have access to the project
  • Attempting to access another project’s resources
Solutions:
  1. Verify you’re using the correct API key
  2. Check the resource belongs to your project

Resource Errors

NOT_FOUND / POLICY_NOT_FOUND

Causes:
  • Policy ID doesn’t exist
  • Policy was deleted
  • Typo in the policy ID
Solutions:
  1. Verify the policy ID in the Developer Portal
  2. Check for typos (IDs are case-sensitive)
  3. Confirm the policy hasn’t been deleted

SWIG_ID_EXISTS / CONFLICT

Causes:
  • Duplicate custom Swig ID
  • Retry with same ID after successful creation
Solutions:
  1. Use a unique Swig ID
  2. Omit swigId for auto-generation
  3. Check if the wallet was already created

Validation Errors

BAD_REQUEST

Causes:
  • Missing required fields
  • Invalid field values
  • Malformed JSON
Solutions:
  1. Check all required fields are provided
  2. Validate field formats and values
  3. Ensure valid JSON in request body

MISSING_URL

Causes:
  • SDK not configured with portal URL
Solutions:

Rate Limit Errors

RATE_LIMITED

Causes:
  • Exceeded requests per minute
  • Burst of requests
Solutions:
  1. Implement exponential backoff
  2. Reduce request frequency
  3. Upgrade subscription for higher limits

Paymaster Errors

INSUFFICIENT_BALANCE

Causes:
  • Paymaster wallet has no SOL
  • Transaction fee exceeds available balance
Solutions:
  1. Fund the paymaster wallet
  2. Reduce transaction complexity

LIMIT_EXCEEDED

Causes:
  • Exceeded SOL usage threshold
  • Exceeded API call threshold
  • Exceeded subscription limit
Solutions:
  1. Wait for monthly reset
  2. Increase paymaster limits
  3. Upgrade subscription

SINGLE_TX_LIMIT_EXCEEDED

Causes:
  • Transaction fee exceeds per-transaction limit
Solutions:
  1. Increase single TX limit in paymaster settings
  2. Simplify the transaction

Subscription Errors

SUBSCRIPTION_REQUIRED

Causes:
  • Attempting to use paymaster on FREE tier
  • Feature requires upgrade
Solutions:
  1. Upgrade to PRO or higher
  2. Use free tier features only

SDK Error Handling

API SDK (@swig-wallet/api)

Legacy SDK (@swig-wallet/developer)

Retry Strategies

Exponential Backoff

For transient errors (5xx, network issues):

SDK Built-in Retry

Both portal clients support retry configuration:

Debugging Tips

Enable Logging

Log requests and responses for debugging:

Check API Key

Verify your API key is correct:
  1. Log in to Developer Portal
  2. Go to API Keys
  3. 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:
  1. Check this guide - Most common issues are covered above
  2. Search the docs - Use the search function
  3. Community support - Join our Telegram
  4. GitHub issues - Report bugs at swig-wallet
  5. Email support - Paid tiers get email support
When reporting issues, include:
  • Error code and message
  • Request details (sanitize sensitive data)
  • Steps to reproduce
  • SDK version