---
title: "Error handling"
description: "HTTP status codes, error response shape, and what to do when a request fails."
---

> Documentation Index
> Fetch the complete documentation index at: https://docs.wazapin.id/llms.txt
> Use this file to discover all available pages before exploring further.

# Error handling

Wazapin uses standard HTTP status codes. Each error response includes a `detail` field you can show to users or log for support.

## Common status codes

  <Accordion open>
    <AccordionTrigger>400 Bad Request</AccordionTrigger>
    <AccordionContent>Invalid payload or query params.</AccordionContent>
  </Accordion>
  <Accordion>
    <AccordionTrigger>401 Unauthorized</AccordionTrigger>
    <AccordionContent>Missing or invalid token.</AccordionContent>
  </Accordion>
  <Accordion>
    <AccordionTrigger>403 Forbidden</AccordionTrigger>
    <AccordionContent>Token does not have the required permission.</AccordionContent>
  </Accordion>
  <Accordion>
    <AccordionTrigger>404 Not Found</AccordionTrigger>
    <AccordionContent>The requested resource does not exist.</AccordionContent>
  </Accordion>
  <Accordion>
    <AccordionTrigger>409 Conflict</AccordionTrigger>
    <AccordionContent>The request conflicts with the current resource state.</AccordionContent>
  </Accordion>
  <Accordion>
    <AccordionTrigger>422 Unprocessable Entity</AccordionTrigger>
    <AccordionContent>Validation failed. Check the request payload and field values.</AccordionContent>
  </Accordion>
  <Accordion>
    <AccordionTrigger>429 Too Many Requests</AccordionTrigger>
    <AccordionContent>Rate limit exceeded. Retry with exponential backoff.</AccordionContent>
  </Accordion>
  <Accordion>
    <AccordionTrigger>500 Internal Server Error</AccordionTrigger>
    <AccordionContent>Unexpected server error. Check the response detail and contact support if it persists.</AccordionContent>
  </Accordion>

## Error response schema

```json Error
{
  "title": "Bad Request",
  "status": 400,
  "detail": "to is required"
}
```

## Handling guidelines

1. Log response body and request metadata for incident tracing.
2. Retry only for `429` and `5xx` errors with exponential backoff.
3. Do not retry `4xx` validation errors before fixing payload.

Source: https://docs.wazapin.id/api/errors/index.mdx
