Skip to main content

Error Handling

The PostSyncer API uses standard HTTP status codes and returns detailed error messages to help you debug issues quickly.

HTTP Status Codes

Status CodeDescription
200Success - Request completed successfully
201Created - Resource created successfully
400Bad Request - Invalid request parameters
401Unauthorized - Invalid or missing API key
403Forbidden - Insufficient permissions
404Not Found - Resource doesn’t exist
422Unprocessable Entity - Validation errors
429Too Many Requests - Rate limit exceeded
500Internal Server Error - Server error

Error Response Format

All error responses follow this format:
{
  "message": "Human-readable error message",
  "errors": {}
}

Common Error Codes

Authentication Errors

{
  "message": "Unauthenticated"
}

Validation Errors

{
    "message": "The workspace id field is required.",
    "errors": {
        "workspace_id": [
            "The workspace id field is required."
        ]
    }
}

Rate Limit Errors

{
  "message": "Too Many Attempts."
}

Best Practices

Check Status Codes

Always check HTTP status codes before processing responses

Handle Rate Limits

Implement retry logic for 429 responses with exponential backoff

Log Errors

Log detailed error information for debugging

Validate Input

Validate data before sending to avoid 422 errors