Error Codes

The HookWatch API uses standard HTTP status codes to indicate success or failure. This page documents all error codes and how to handle them.

Error Response Format

All error responses follow this structure:

Json

HTTP Status Codes

Success Codes

CodeNameDescription
200OKRequest succeeded
201CreatedResource created successfully
204No ContentRequest succeeded, no content returned (e.g., delete)

Client Error Codes

CodeNameDescription
400Bad RequestInvalid request body, missing required fields, or malformed JSON
401UnauthorizedMissing, invalid, or expired authentication token
403ForbiddenAuthenticated but not allowed (plan limits, permissions)
404Not FoundResource doesn't exist or you don't have access
409ConflictResource already exists or action conflicts with current state
422Unprocessable EntityRequest was valid but cannot be processed (business logic error)
429Too Many RequestsRate limit exceeded. Check Retry-After header

Server Error Codes

CodeNameDescription
500Internal Server ErrorSomething went wrong on our end. Try again or contact support
502Bad GatewayUpstream service unavailable. Usually temporary
503Service UnavailableService temporarily unavailable (maintenance or overload)

Error Codes

The error.code field provides a machine-readable error type:

CodeDescription
validation_errorRequest failed validation. Check details array for specific fields
authentication_requiredNo authentication provided
invalid_tokenToken is malformed or invalid
token_expiredToken has expired. Refresh or re-authenticate
resource_not_foundThe requested resource doesn't exist
resource_existsResource already exists (duplicate)
plan_limit_reachedYou've reached a limit of your current plan
rate_limitedToo many requests. Slow down
internal_errorUnexpected server error

Handling Errors

  • 401: Refresh your access token and retry the request
  • 429: Wait for the time specified in Retry-After header
  • 5xx: Retry with exponential backoff
  • 400/422: Fix the request based on error details

Related