details array listing all problems at once so you can fix them in a single request.
Error response format
All error responses follow one of two shapes depending on whether multiple validation errors were found. Single error:"Validation failed", inspect the details array to see all issues at once and correct your request in one round-trip.
HTTP status codes
| Code | Meaning | When you’ll see it |
|---|---|---|
200 | Success | Request completed successfully |
201 | Created | A new resource was created (POST requests) |
400 | Bad Request | Missing or invalid request parameters |
401 | Unauthorized | API key is missing or invalid |
403 | Forbidden | Resource exists but belongs to another account |
404 | Not Found | Resource does not exist |
409 | Conflict | Duplicate resource — e.g., a form title that is already in use |
410 | Gone | Resource existed but has been deleted |
429 | Too Many Requests | Rate limit exceeded (1,000 requests per hour) |
500 | Internal Server Error | Unexpected error on CharityStack’s side |
403 Forbidden and 404 Not Found are intentionally distinct. A 403 means the record exists but belongs to a different merchant account; a 404 means no matching record was found at all.Rate limit headers
Every API response includes the following headers so you can monitor your usage:| Header | Description |
|---|---|
X-RateLimit-Limit | Maximum requests allowed per hour (1,000) |
X-RateLimit-Remaining | Requests remaining in the current window |
X-RateLimit-Reset | Unix timestamp when the rate limit window resets |
X-RateLimit-Remaining proactively in long-running batch jobs to avoid hitting the limit unexpectedly.
Handling errors in code
The examples below show a recommended error-handling pattern that checks the status code, parses the error body, and retries with exponential backoff on429 and 500 responses.
Best practices
Check the status code before parsing the body
Check the status code before parsing the body
Status codes tell you the category of the problem immediately. Parse
error and details from the body for the specific message, but key your error-handling logic on the status code.Use exponential backoff for 429 and 500
Use exponential backoff for 429 and 500
Retrying immediately after a rate limit or server error usually makes things worse. Wait at least 1 second before the first retry and double the wait on each subsequent attempt. For
429 responses, prefer to wait until the time indicated by X-RateLimit-Reset.Do not retry 4xx errors (except 429)
Do not retry 4xx errors (except 429)
Client errors in the
4xx range — bad parameters, missing auth, conflicts — won’t resolve on their own. Fix the underlying problem in your code rather than retrying the same request.Log the X-Webhook-ID or request context on errors
Log the X-Webhook-ID or request context on errors
When logging errors, include the relevant resource ID, the status code, and the full
error/details body. This makes debugging much faster when tracing a specific failed request.