Skip to main content
All HookPulse API endpoints use a consistent error response format. This guide explains how errors are structured and how to handle them in your application.

Error Response Format

All API endpoints return errors in the same format:

Response Fields

HTTP Status Codes

HookPulse uses standard HTTP status codes to indicate the type of error:
Even when the HTTP status code is 200, you should always check the success field in the response body. Some endpoints return 200 with success: false for business logic errors.

Common Error Messages

Authentication Errors

Validation Errors

Resource Errors

Rate Limiting Errors

System Errors

Error Handling Examples

JavaScript/TypeScript

Python

cURL

Best Practices

1. Always Check the success Field

Even when the HTTP status code is 200, always verify the success field:

2. Handle HTTP Status Codes

Check HTTP status codes for network and authentication errors:

3. Implement Retry Logic

For transient errors (5xx, rate limits), implement retry logic with exponential backoff:

4. Log Errors Appropriately

Log errors with sufficient context for debugging:

5. Provide User-Friendly Error Messages

Map technical error messages to user-friendly messages:

6. Validate Before Sending

Validate request data before making API calls to catch errors early:

Error Handling Checklist

When implementing error handling, ensure you:
  • Check HTTP status codes
  • Verify success field in response body
  • Handle authentication errors (401)
  • Handle rate limiting (429) with retry logic
  • Implement retry logic for transient errors (5xx)
  • Log errors with sufficient context
  • Provide user-friendly error messages
  • Validate input before making API calls
  • Handle network errors (timeouts, connection failures)
  • Test error scenarios in your application