Skip to main content
When an API request fails, Posthook returns a JSON error response with an HTTP status code and a descriptive message.

Error Response Format

Error Codes

400 Bad Request

The request body is malformed or fails validation.
Common causes:
  • Missing required fields (path, data)
  • Invalid postAt format (must be RFC 3339)
  • Providing both postAt and postIn (mutually exclusive)
  • postAtLocal without timezone
  • Payload exceeds 64 KB
Fix: Check the API Reference for required fields and valid values.

401 Unauthorized

The API key is missing or invalid.
Common causes:
  • Missing X-API-Key header
  • Invalid or revoked API key
  • Using a signing key instead of an API key
Fix: Verify your API key in Project Settings in the Dashboard.

404 Not Found

The requested resource does not exist.
Common causes:
  • Hook ID does not exist or belongs to a different project
  • Endpoint path is incorrect

413 Payload Too Large

The request body exceeds the maximum allowed size.
Fix: Reduce the size of your data field. If you need to send large payloads, store the data externally and include a reference URL in the hook payload.

429 Too Many Requests

You’ve exceeded your plan’s monthly hook quota.
Fix: Check your usage with the Posthook-HookQuota-* response headers, or upgrade your plan.

500 Internal Server Error

An unexpected error occurred on Posthook’s end.
Fix: Retry the request with backoff. If the issue persists, contact support@posthook.io.

SDK Error Handling