API Errors
The CDP API uses conventional HTTP response codes to indicate the success or failure of an API request. In general:-
Codes in the
2xxrange indicate success -
Codes in the
4xxrange indicate an error that failed given the information provided (e.g., a required parameter was omitted) -
Codes in the
5xxrange indicate an error on CDP’s backend servers.5xxerrors are not a guarantee of failure; there’s always the chance that the operation may have succeeded in our back-end. Therefore, your application should treat the operation’s status as unknown.
errorType: A machine-readable error codeerrorMessage: A human-readable message providing more detailcorrelationId: A unique identifier for the request that can help with debuggingerrorLink: A link to detailed documentation about the specific error type
HTTP 400
Invalid request
This error occurs when the request is malformed or contains invalid data, including issues with the request body, query parameters, path parameters, or headers. Steps to resolve:- Check all required fields and parameters are present
- Ensure request body (if applicable) follows the correct schema
- Verify all parameter formats match the API specification:
- Query parameters
- Path parameters
- Request headers
- Validate any addresses, IDs, or other formatted strings meet requirements
- Missing required parameters
- Invalid parameter types or formats
- Malformed JSON in request body
- Invalid enum values
Transfer-specific validation errors
The following transfer validation scenarios returnerrorType: "invalid_request". Use the errorMessage field to identify the specific case.
| Scenario | Example errorMessage |
|---|---|
| Source account ID is malformed | "source is invalid." |
| Target account ID is malformed | "target is invalid." |
| Source account does not exist | "source not found." |
| Target account does not exist | "target not found." |
| Asset not supported at source | "source is not supported." |
| Asset not supported at target | "target is not supported." |
| Target email address is malformed | "target has an invalid email format." |
| Target onchain address is invalid for network | "The recipient address is invalid for the selected network." |
| Asset not supported for this transfer route | "Transfer asset pair is not supported." |
| Insufficient balance | "Insufficient funds to complete this transfer." |
| Asset mismatch between request fields | "Currency mismatch in request." |
| Metadata has too many keys | "Metadata has too many keys. Up to 10 key/value pairs are permitted." |
| Metadata key exceeds length limit | "Metadata key is too long. Each key must be less than or equal to 40 characters." |
| Metadata value exceeds length limit | "Metadata value is too long. Each value must be less than or equal to 500 characters." |
| Travel rule fields missing | "Travel rule information is incomplete. Missing fields: ..." |
| Recipient address not in account allowlist | "Your coinbase account allowlist does not include this address. Please update your allowlist at https://www.coinbase.com/settings/allowlist" |
Malformed transaction
This error occurs when the transaction data provided is not properly formatted or is invalid. Steps to resolve:- Verify transaction encoding:
- EVM networks: Check RLP encoding is correct
- Solana: Validate base64 encoding
- Ensure all required transaction fields are present
- Validate transaction parameters are within acceptable ranges
- Check that the transaction type is supported on the target network (see our Supported Networks page for more details)
- Invalid hex encoding for EVM transactions
- Missing required transaction fields
- Incorrect parameter formats
- Unsupported transaction types
- Network-specific transaction format mismatches
Invalid signature
This error occurs when the signature provided for the given user operation is invalid. Steps to resolve:- Verify the signature was generated by the correct owner account
- Ensure the signature corresponds to the exact user operation hash
- Check that the signature format matches the expected format
- Confirm you’re using the correct network for the Smart Account
- Using wrong owner account to sign
- Signing modified/incorrect user operation data
- Malformed signature encoding
- Network mismatch between signature and broadcast
Policy in use
This error occurs when trying to delete a Policy that is currently in use by at least one project or account. Steps to resolve:- Update project or accounts to remove references to the Policy in question.
- Retry your delete request.
Invalid sql query
This error occurs when the SQL query is invalid or not allowed. Common causes:- Using non-SELECT SQL statements (INSERT, UPDATE, DELETE, etc.)
- Invalid table or column names
- Syntax errors in SQL query
- Query exceeds character limit
- Too many JOIN operations
Unknown
Example 1:Network not tradable
This error occurs when the selected asset cannot be purchased on the selected network in the user’s location. Steps to resolve:- Verify the asset is tradable on the selected network
- Check the user’s location to ensure it is allowed to purchase the asset on the selected network
- Users in NY are not allowed to purchase USDC on any network other than Ethereum
Guest permission denied
This error occurs when the user is not allowed to complete onramp transactions as a guest. Steps to resolve:- Redirect the user to create a Coinbase account to buy and send crypto.
Guest region forbidden
This error occurs when guest onramp transactions are not allowed in the user’s region. Steps to resolve:- Redirect the user to create a Coinbase account to buy and send crypto.
Guest transaction limit
This error occurs when the user has reached the weekly guest onramp transaction limit. Steps to resolve:- Inform the user they have reached their weekly limit and will have to wait until next week.
Guest transaction count
This error occurs when the user has reached the lifetime guest onramp transaction count limit. Steps to resolve:- Redirect the user to create a Coinbase account to buy and send crypto.
Phone number verification expired
This error occurs when the user’s phone number verification has expired. Use of guest Onramp requires the user’s phone number to be verified every 60 days. Steps to resolve:- Re-verify the user’s phone number via OTP.
- Retry the request with the phoneNumberVerifiedAt field set to new verification timestamp.
HTTP 401
Unauthorized
This error occurs when authentication fails. Steps to resolve:- Verify your CDP API credentials:
- Check that your API key is valid
- Check that your Wallet Secret is properly configured
- Validate JWT token:
- Not expired
- Properly signed
- Contains required claims
- Check request headers:
- Authorization header present
- X-Wallet-Auth header included when required
HTTP 402
Payment method required
This error occurs when a payment method is required to complete the requested operation but none is configured or available. Steps to resolve:- Add a valid payment method to your account using the CDP Portal
- Ensure your payment method is valid and not expired
- No payment method configured on the account
- Payment method is expired
HTTP 403
Forbidden
This error occurs when you don’t have permission to access the resource. Steps to resolve:- Verify your permissions to access the resource
- Ensure that you are the owner of the requested resource
HTTP 404
Not found
This error occurs when the resource specified in your request doesn’t exist or you don’t have access to it. Steps to resolve:- Verify the resource ID/address/account exists
- Check your permissions to access the resource
- Ensure you’re using the correct network/environment
- Confirm the resource hasn’t been deleted
- Mistyped addresses
- Accessing resources from the wrong CDP project
- Resource was deleted or hasn’t been created yet
HTTP 408
Timed out
This error occurs when a request exceeds the maximum allowed processing time. Steps to resolve:- Break down large requests into smaller chunks (if applicable)
- Implement retry logic with exponential backoff
- Use streaming endpoints for large data sets
HTTP 409
Already exists
This error occurs when trying to create a resource that already exists. Steps to resolve:- Check if the resource exists before creation
- Use GET endpoints to verify resource state
- Use unique identifiers/names for resources
HTTP 422
Idempotency error
This error occurs when an idempotency key is reused with different parameters. Steps to resolve:- Generate a new UUID v4 for each unique request
- Only reuse idempotency keys for exact request duplicates
- Track used keys within your application
HTTP 429
Rate limit exceeded
This error occurs when you’ve exceeded the API rate limits. Steps to resolve:- Implement exponential backoff
- Cache responses where possible
- Wait for rate limit window to reset
Faucet limit exceeded
This error occurs when you’ve exceeded the faucet request limits. Steps to resolve:- Wait for the time window to reset
- Use funds more efficiently in your testing
HTTP 499
Client closed request
This error occurs when the client closes the connection before the server can send a response. Common causes:- The client timed out waiting for the server response
- The client application was terminated during a pending request
- Network interruption caused the client connection to drop
- Increase client-side timeout settings if applicable
- Implement retry logic with exponential backoff for long-running queries
- Consider optimizing the request to reduce server processing time
HTTP 500
Internal server error
This indicates an unexpected error that occurred on the CDP servers. Important: If you encounter this error, please note that your operation’s status should be treated as unknown by your application, as it could have been a success within the CDP back-end. Steps to resolve:- Retry your request after a short delay
- If persistent, contact CDP support with:
- Your correlation ID
- Timestamp of the error
- Request details
- Consider implementing retry logic with an exponential backoff
HTTP 502
Bad gateway
This error occurs when the CDP API is unable to connect to the backend service. Steps to resolve:- Retry your request after a short delay
- If persistent, contact CDP support with:
- The timestamp of the error
- Request details
- Consider implementing retry logic with an exponential backoff
HTTP 503
Service unavailable
This error occurs when the CDP API is temporarily unable to handle requests due to maintenance or high load. Steps to resolve:- Retry your request after a short delay
- If persistent, contact CDP support with:
- The timestamp of the error
- Request details
- Consider implementing retry logic with an exponential backoff
HTTP 504
Timed out
This error occurs when a request exceeds the maximum allowed processing time. Steps to resolve:- Break down large requests into smaller chunks (if applicable)
- Implement retry logic with exponential backoff
- Use streaming endpoints for large data sets
Network Errors
Network errors occur when there is a problem establishing or maintaining a connection to the CDP API at the network layer. These errors are distinct from API service errors - they indicate that your request never reached the CDP API or was blocked before it could be processed.Understanding Network Errors
When you encounter a network error via the CDP SDK, you’ll receive aNetworkError object with:
statusCode: Always 0 (indicating no HTTP response was received)errorType: Specific type of network errorerrorMessage: Human-readable descriptionnetworkDetails: Additional information including:code: Technical error codemessage: Original error messageretryable: Whether the operation should be retried
Types of Network Errors
1. IP Blocked (network_ip_blocked)
Your IP address has been blocked at the gateway level.
Common causes:
- Geographic restrictions.
- Rate limiting at infrastructure level.
- Security policies or DDoS protection.
- Corporate firewall/proxy restrictions.
- Verify you’re not accessing from a restricted region.
- Check if you’re behind a VPN or proxy that might be blocked.
- Contact CDP support on Discord if you believe this is in error.
- This error is not retryable.
2. Connection Failed (network_connection_failed)
Unable to establish a connection to the CDP API.
Common causes:
- CDP API is temporarily unavailable. Check the CDP Status Page for any ongoing issues.
- Network connectivity issues.
- Firewall blocking outbound HTTPS connections.
- Incorrect API endpoint configuration.
- Check your internet connection.
- Verify firewall settings allow HTTPS traffic to
api.cdp.coinbase.com. - Ensure you’re using the correct API endpoint.
- This error is retryable. Retry the request with exponential backoff.
3. Timeout (network_timeout)
The request took too long and was terminated.
Common causes:
- Network congestion.
- Slow internet connection.
- Increase timeout settings if consistently timing out.
- This error is retryable. Retry the request with exponential backoff.
4. DNS Failure (network_dns_failure)
Unable to resolve the CDP API domain name.
Common causes:
- DNS configuration issues.
- Network connectivity problems.
- DNS server unavailable.
- Incorrect API endpoint URL.
- Check your DNS settings.
- Verify network connectivity with
nslookup api.cdp.coinbase.com. - Try using a different DNS server (e.g., 8.8.8.8).
- Ensure the API URL is correct.
- This error is not retryable until DNS is fixed.
Handling Network Errors in Code
Best Practices
- Implement Retry Logic: For retryable errors, use exponential backoff:
- Log Network Errors: Always log network errors with full details for debugging.
- Monitor Patterns: Track network errors to identify patterns (time of day, specific operations, etc.).
- Have Fallback Strategies: Consider implementing fallback mechanisms for critical operations.
Troubleshooting Checklist
- Verify internet connectivity.
- Check if you’re behind a proxy or VPN.
- Ensure firewall allows HTTPS traffic to
api.cdp.coinbase.com. - Verify you’re not in a restricted geographic region.
- Check DNS resolution:
nslookup api.cdp.coinbase.com. - Test with
curlor similar:curl -I https://api.cdp.coinbase.com/platform. - Check if the issue is consistent or intermittent.
Getting Help
If you continue to experience network errors after following this guide:-
Collect error details including:
- Full error message and type.
- Network details from the error.
- Time and frequency of occurrence.
- Your network configuration (proxy, VPN, region).
- Contact CDP support on Discord with this information.
- Check the CDP Status Page for any ongoing issues.