> ## Documentation Index
> Fetch the complete documentation index at: https://sigma-docs.pastelhq.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Response Codes

> Sigma's API uses standard HTTP response codes to indicate the status of a request.

Sigma uses conventional HTTP response codes to indicate whether a request succeeded or failed:

* **2xx** codes indicate the request was received and processed successfully
* **4xx** codes indicate a problem with the request — missing fields, invalid values, or authentication issues
* **5xx** codes indicate a server-side error on Sigma's end

<table className="min-w-full divide-y divide-gray-200 dark:divide-gray-700">
  <thead className="bg-gray-50 dark:bg-gray-800">
    <tr>
      <th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
        Code
      </th>

      <th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
        Meaning
      </th>

      <th className="px-6 py-3 text-left text-xs font-medium text-gray-500 dark:text-gray-400 uppercase tracking-wider">
        What to do
      </th>
    </tr>
  </thead>

  <tbody className="bg-white dark:bg-gray-900 divide-y divide-gray-200 dark:divide-gray-700">
    <tr>
      <td className="px-6 py-4 text-sm font-medium text-gray-900 dark:text-white bg-green-100">
        200
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        Success
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        Request was processed successfully. Read the response body for results.
      </td>
    </tr>

    <tr>
      <td className="px-6 py-4 text-sm font-medium text-gray-900 dark:text-white bg-red-200">
        400
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        Bad Request
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        The request is malformed or missing required fields. Check the error message in the response body and fix the request before retrying.
      </td>
    </tr>

    <tr>
      <td className="px-6 py-4 text-sm font-medium text-gray-900 dark:text-white bg-red-200">
        401
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        Unauthorized
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        The request is missing valid API credentials. Ensure your <code>apiKey</code> and <code>apiSecret</code> headers are included and correct.
      </td>
    </tr>

    <tr>
      <td className="px-6 py-4 text-sm font-medium text-gray-900 dark:text-white bg-gray-200">
        404
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        Not Found
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        The requested resource does not exist. Check the endpoint URL and any IDs in the path.
      </td>
    </tr>

    <tr>
      <td className="px-6 py-4 text-sm font-medium text-gray-900 dark:text-white bg-red-100">
        429
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        Too Many Requests
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        You have exceeded the rate limit. Wait before sending further requests. Consider adding retry logic with exponential backoff in your integration.
      </td>
    </tr>

    <tr>
      <td className="px-6 py-4 text-sm font-medium text-gray-900 dark:text-white bg-red-200">
        500, 502
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        Server Error
      </td>

      <td className="px-6 py-4 text-sm text-gray-500 dark:text-gray-400">
        An unexpected error occurred on Sigma's end. Contact support if the issue persists.
      </td>
    </tr>
  </tbody>
</table>

### Error Response Format

When a request fails, the response body includes details about what went wrong:

```json theme={null}
{
  "status": "error",
  "message": "Validation failed",
  "errors": [
    {
      "field": "amount",
      "message": "amount is required"
    }
  ]
}
```

Use the `message` and `errors` fields to identify and fix the issue before retrying.
