Appendix B: API Error Codes

CodeHTTP StatusDescription
QUOTA_EXCEEDED429Customer has exceeded workload quota
INSUFFICIENT_CAPACITY503No spot capacity available for requirements
POLICY_BLOCKED403Request blocked by Kivera policy
INVALID_REQUIREMENTS400Workload requirements cannot be satisfied
WORKLOAD_NOT_FOUND404Workload ID does not exist
PROVIDER_ERROR502Cloud provider API returned an error
UNAUTHORIZED401Invalid or expired authentication token
FORBIDDEN403Insufficient permissions for this operation
RATE_LIMITED429Too many requests, please slow down
VALIDATION_ERROR400Request body failed validation
INTERNAL_ERROR500Unexpected server error
SERVICE_UNAVAILABLE503Service temporarily unavailable
WORKLOAD_ALREADY_TERMINATED400Cannot perform action on terminated workload
WORKLOAD_NOT_RUNNING400Workload is not in RUNNING state
DUPLICATE_WORKLOAD_NAME409Workload name already exists for this customer
INVALID_CLOUD_ACCOUNT400Cloud account not configured or invalid
CREDENTIAL_ERROR500Failed to decrypt or use cloud credentials
TIMEOUT504Operation timed out

Error Response Format

All API errors return a consistent JSON structure:

{
  "error": {
    "code": "QUOTA_EXCEEDED",
    "message": "You have reached your maximum of 100 concurrent workloads",
    "details": {
      "currentCount": 100,
      "maxAllowed": 100,
      "tier": "pro"
    },
    "requestId": "req_abc123def456"
  }
}

Handling Errors

Retry-able Errors

The following errors may be retried with exponential backoff:

  • PROVIDER_ERROR - Cloud provider may be temporarily unavailable
  • RATE_LIMITED - Wait for the Retry-After header duration
  • SERVICE_UNAVAILABLE - Platform is temporarily unavailable
  • TIMEOUT - Operation may have partially completed

Non-Retry-able Errors

These errors require user action or configuration changes:

  • QUOTA_EXCEEDED - Upgrade tier or terminate existing workloads
  • POLICY_BLOCKED - Review Kivera policies
  • INVALID_REQUIREMENTS - Adjust workload requirements
  • UNAUTHORIZED - Refresh or replace authentication token
  • FORBIDDEN - Request additional permissions