Ana içeriğe atla

Overview

The Management API uses standard HTTP status codes and returns error responses in a consistent JSON format.

HTTP Status Codes

Error Response Format

All error responses follow this format:

Common Error Codes

400 Bad Request

Error Codes

  • bad_request - General validation error
  • validation_failed - Request validation failed
  • invalid_parameter - Invalid parameter value

Example Response

Common Causes

  • Missing required fields
  • Invalid field values
  • Invalid data types
  • Validation rule violations

401 Unauthorized

Error Codes

  • unauthorized_client - Invalid credentials
  • invalid_token - Token is invalid or expired
  • token_expired - Token has expired

Example Response

Common Causes

  • Missing Authorization header
  • Invalid token format
  • Expired token
  • Revoked token

403 Forbidden

Error Codes

  • forbidden - Insufficient permissions
  • access_denied - Access denied for this resource

Example Response

Common Causes

  • User lacks required role
  • Resource access restrictions
  • Project-level permissions

404 Not Found

Error Codes

  • not_found - Resource not found
  • resource_not_found - Specific resource not found

Example Response

Common Causes

  • Incorrect resource name
  • Resource was deleted
  • Wrong project/environment context

409 Conflict

Error Codes

  • conflict - Resource conflict
  • duplicate_name - Name already exists

Example Response

Common Causes

  • Duplicate resource name
  • Unique constraint violation

500 Internal Server Error

Error Codes

  • internal_error - Internal server error
  • server_error - Unexpected server error

Example Response

Common Causes

  • Database errors
  • System failures
  • Unexpected exceptions

Error Handling Best Practices

1. Check Status Codes

Always check the HTTP status code before processing the response:

2. Parse Error Messages

Extract and log error messages for debugging:

3. Handle Specific Errors

Handle specific error codes differently:

4. Retry Logic

Implement retry logic for transient errors (500, network errors):

5. Logging

Log errors for debugging and monitoring:

Validation Errors

Validation errors may include field-specific information:

Rate Limiting Errors

When rate limits are exceeded, you may receive:
The retry_after field indicates seconds to wait before retrying.

Troubleshooting

Common Issues

1

401 Unauthorized

  • Check token validity
  • Verify Authorization header format
  • Ensure token hasn’t expired
2

404 Not Found

  • Verify resource names (case-sensitive)
  • Check project/environment context
  • Ensure resource exists
3

400 Bad Request

  • Validate request body against schema
  • Check required fields
  • Verify data types
4

500 Internal Server Error

  • Retry the request
  • Check system status
  • Contact support if persistent

Next Steps