Overview
The Modulus Labs QR API uses conventional HTTP response status codes to indicate the success or failure of API requests. Error responses include detailed information to help you quickly identify and resolve issues.HTTP Status Codes
2xx Success
Request completed successfully
4xx Client Error
Error in the request (missing parameters, validation failure, etc.)
5xx Server Error
Unexpected error on Modulus Labs’ servers
Status Code Ranges
| Status Code | Meaning | What to Do |
|---|---|---|
| 200-299 | Success | Request worked as expected |
| 400-499 | Client Error | Check your request parameters and credentials |
| 500-599 | Server Error | Contact Modulus Labs support |
5xx errors are rare and shouldn’t happen under normal circumstances. If you encounter persistent 5xx errors, please contact support immediately.
Error Response Format
The API returns a standard JSON error object:Error Object Properties
| Field | Type | Description |
|---|---|---|
code | string | Machine-readable error code for programmatic handling |
error | string | Human-readable error message with details |
referenceNumber | string | Unique identifier for this error occurrence (use when contacting support) |
Error Codes Reference
Account & Authentication Errors (10000001-10000015)
10000001 - Account Locked
10000001 - Account Locked
Meaning: Your account has been locked due to security concernsCommon Causes:
- Multiple failed authentication attempts
- Suspicious activity detected
- Manual lock by administrator
- Contact Modulus Labs support to unlock your account
- Provide the reference number from the error response
- Review account security after unlocking
10000002 - Account Not Active
10000002 - Account Not Active
Meaning: Your account is not active or has been disabledCommon Causes:
- Account pending approval
- Subscription expired
- Account manually disabled
- Check your email for activation instructions
- Verify your subscription status
- Contact support if the issue persists
10000003 - Account Not Found
10000003 - Account Not Found
Meaning: The account associated with the credentials doesn’t existCommon Causes:
- Using credentials from deleted account
- Typo in Secret Key
- Wrong environment (sandbox vs. production)
- Verify your Secret Key is correct
- Ensure you’re using the right environment
- Contact support if you believe this is an error
10000006 - API Key Not Found
10000006 - API Key Not Found
Meaning: The Secret Key provided doesn’t exist in the systemCommon Causes:
- Incorrect Secret Key
- Key was deleted
- Copy/paste error
- Double-check your Secret Key
- Generate a new key if needed
- Verify key is properly stored in environment variables
10000008 - API Key Expired
10000008 - API Key Expired
Meaning: Your Secret Key has expiredCommon Causes:
- Key exceeded its validity period
- Automatic expiration policy
- Generate a new Secret Key
- Update your application configuration
- Implement key rotation strategy
10000009 - API Key Revoked
10000009 - API Key Revoked
Meaning: Your Secret Key has been revokedCommon Causes:
- Key compromised and manually revoked
- Revoked during key rotation
- Security incident
- Generate a new Secret Key immediately
- Review security logs
- Contact support if unexpected
10000010 - API Key Suspended
10000010 - API Key Suspended
Meaning: Your Secret Key is temporarily suspendedCommon Causes:
- Suspicious activity
- Policy violation
- Payment issue
- Contact support to resolve the suspension
- Provide reference number
- Address the underlying issue
10000011 - API Key Deleted
10000011 - API Key Deleted
Meaning: The Secret Key has been permanently deletedCommon Causes:
- Manual deletion
- Account cleanup
- Security incident response
- Generate a new Secret Key
- Update application configuration
- Cannot recover deleted keys
10000012 - Unauthorized Action
10000012 - Unauthorized Action
10000013 - Invalid API Key
10000013 - Invalid API Key
Meaning: The Secret Key format is invalidCommon Causes:
- Malformed key string
- Incorrect encoding
- Corrupted key during storage/retrieval
- Verify the Secret Key format
- Ensure no extra spaces or characters
- Re-copy the key from secure storage
10000015 - Insufficient Permissions
10000015 - Insufficient Permissions
Meaning: API key doesn’t have required permissions for this operationCommon Causes:
- Read-only key used for write operation
- Key lacks specific permission
- Permission not assigned to account
- Use an API key with appropriate permissions
- Request permission upgrade from support
- Review key permissions in dashboard
Error Response Types
The API returns errors in different formats depending on the authentication status:- Authenticated Errors
- Unauthenticated Errors
Declined Requests (Authenticated)
When authenticated but the request is declined, errors are returned as encrypted JWE tokens:You must decrypt these responses using your Encryption Key. See the Encryption Guide for details.
Handling Errors in Code
Here’s how to properly handle errors in your application:Best Practices
Log Reference Numbers
Always log the
referenceNumber - it’s essential for troubleshooting with supportImplement Retry Logic
Implement exponential backoff for 5xx errors and rate limit errors
Handle Both Formats
Check for both encrypted and unencrypted error responses
Monitor Error Rates
Track error rates to identify integration issues early
Graceful Degradation
Provide fallback options when API calls fail
User-Friendly Messages
Translate technical errors into user-friendly messages
Testing Errors
You can simulate errors in the sandbox environment to test your error handling:Test with Invalid Credentials
Test with Malformed Request
Getting Help
1
Check This Documentation
Review the error code and common solutions above
2
Test in Sandbox
Reproduce the error in the sandbox environment
3
Gather Information
Collect:
- Error code
- Reference number
- Full request/response (remove sensitive data)
- Timestamp
4
Contact Support
Email [email protected] with the gathered information
Reference numbers are crucial - always include them when contacting support for faster resolution.