HTTP Status Codes
Success Codes
Client Error Codes
Server Error Codes
API Error Response Format
All API errors follow this standardized flat format:status: HTTP status code (always matches response header)code: Machine-readable error code for client-side branchingmessage: Human-readable message safe for UI display and developer debuggingdetails: Additional context (omitted if not needed), never raw error details
Authentication Errors
invalid_token
invalid_token
HTTP Status: 401Message: “Invalid or expired authentication token”Causes:
- Token has expired (default: 1 hour)
- Token was revoked
- Token is malformed
- Refresh the token using Clerk SDK
- Sign out and sign back in
- Check token format is
Bearer <token>
missing_token
missing_token
HTTP Status: 401Message: “Authentication token required”Causes:
- Authorization header not included
- Header format incorrect
- Add
Authorization: Bearer <token>header - Ensure token is not empty
- Check for typos in header name
token_expired
token_expired
HTTP Status: 401Message: “Authentication token has expired”Causes:
- JWT token exceeded its lifetime (1 hour default)
- Call
getToken()from Clerk to get fresh token - Clerk SDK handles refresh automatically in most cases
- Check if user session is still valid
invalid_signature
invalid_signature
HTTP Status: 401Message: “Token signature verification failed”Causes:
- Token was modified
- Wrong Clerk instance (test vs production)
- Clerk secret key mismatch
- Verify
CLERK_SECRET_KEYmatches Clerk Dashboard - Ensure using correct environment (test/prod)
- Check token hasn’t been tampered with
Authorization Errors
forbidden
forbidden
HTTP Status: 403Message: “You don’t have permission to perform this action”Causes:
- User lacks required role (Owner/Admin)
- Resource belongs to different organization
- Feature requires higher subscription tier
- Check user’s role in the organization
- Verify organization membership
- Check subscription tier for feature access
not_member
not_member
HTTP Status: 403Message: “User is not a member of this organization”Causes:
- User trying to access organization they don’t belong to
- User was removed from organization
- Verify user is member of the organization
- Check if membership was revoked
- Request invitation to organization
PLAN_UPGRADE_REQUIRED
PLAN_UPGRADE_REQUIRED
HTTP Status: 403Message: ” is available on and above”Causes:Solutions:
- The organization’s plan is below the tier the feature needs in
entitlements/registry.json, and that entitlement isenforced
entitlement (the registry key), required_tier, and current_tier, so a client can name the plan to upgrade to:- Upgrade the plan under Settings → Billing & payments → Billing
- Check the org’s tier with
GET /api/v1/organizations/{orgId}/entitlements
insufficient_role
insufficient_role
HTTP Status: 403Message: “This action requires Owner or Admin role”Causes:
- User has Member role, needs Admin or Owner
- Specific action restricted to organization owner
- Request role upgrade from organization owner
- Use account with appropriate permissions
Validation Errors
validation_error
validation_error
HTTP Status: 400Message: “Validation failed”Response includes details:Solutions:
- Check the
details.fieldsfor specific errors - Validate input before sending
- Ensure required fields are present
invalid_json
invalid_json
HTTP Status: 400Message: “Invalid JSON in request body”Causes:
- Malformed JSON syntax
- Missing Content-Type header
- Empty request body when body expected
- Validate JSON syntax
- Add
Content-Type: application/jsonheader - Ensure body is not empty
missing_field
missing_field
HTTP Status: 400Message: “Required field missing: ”Causes:
- Required field not included in request
- Field name typo (camelCase vs snake_case)
- Check API documentation for required fields
- Verify field naming convention (API uses snake_case)
invalid_date
invalid_date
HTTP Status: 400Message: “Invalid date format”Expected format: ISO 8601 (
2024-06-15T19:00:00Z)Solutions:- Use ISO 8601 format with timezone
- Ensure date is valid (not Feb 30)
Resource Errors
not_found
not_found
HTTP Status: 404Message: “Resource not found”Causes:
- Resource doesn’t exist
- Resource was deleted
- Wrong ID format
- No permission to view resource
- Verify the resource ID is correct
- Check if resource was deleted
- Ensure user has access to the resource
already_exists
already_exists
HTTP Status: 409Message: “Resource already exists”Causes:
- Duplicate email address
- Duplicate organization slug
- Duplicate invitation for same user/event
- Use unique values for unique fields
- Check if resource already exists before creating
- Update existing resource instead
resource_in_use
resource_in_use
HTTP Status: 409Message: “Cannot delete resource that is in use”Causes:
- Deleting position assigned to events
- Deleting user with pending invitations
- Remove references before deleting
- Archive instead of delete
Webhook Errors
invalid_webhook_signature
invalid_webhook_signature
HTTP Status: 401Message: “Webhook signature verification failed”Causes:
- Wrong webhook secret
- Request body modified in transit
- Replay attack (timestamp too old)
- Verify webhook secret matches service dashboard
- Ensure raw body is used for signature verification
- Check system clock is synchronized
webhook_processing_failed
webhook_processing_failed
HTTP Status: 500Message: “Failed to process webhook event”Causes:
- Database error during processing
- Required data missing in webhook payload
- Check API logs for detailed error
- Verify webhook payload format
- Most webhooks auto-retry on failure
Rate Limiting
rate_limit_exceeded
rate_limit_exceeded
HTTP Status: 429Message: “Too many requests”Response headers:Solutions:
- Implement exponential backoff
- Cache responses where possible
- Batch requests when possible
- Wait until
X-RateLimit-Resettimestamp
External Service Errors
stripe_error
stripe_error
HTTP Status: 502Message: “Payment service error”Causes:
- Stripe API unavailable
- Invalid Stripe API key
- Card declined
- Check Stripe status page
- Verify Stripe API keys
- Check card details for decline reason
twilio_error
twilio_error
HTTP Status: 502Message: “SMS service error”Causes:
- Twilio API unavailable
- Invalid phone number
- Insufficient Twilio balance
- Check Twilio status page
- Verify phone number format (E.164)
- Check Twilio account balance
clerk_error
clerk_error
HTTP Status: 502Message: “Authentication service error”Causes:
- Clerk API unavailable
- Invalid Clerk configuration
- Check Clerk status page
- Verify Clerk API keys
- Retry after brief delay
Debugging Tips
Enable Verbose Logging
Check API Logs
Validate Request
Getting Help
If you encounter an error not listed here:- Check the API logs for detailed error messages
- Search the Troubleshooting guide
- Check GitHub Issues for known issues
- Ask in Slack
#soundcheck-devwith:- Error code and message
- Request details (endpoint, method, body)
- Steps to reproduce