API result codes
Every public API response carries a standard HTTP status code. Use this page to work out what a code means and how to fix the request.
Status codes
Section titled “Status codes”| Code | Meaning | What to do |
|---|---|---|
| 200 OK | The request reached Wasp Asset and was processed. | Check HasError in the response body. A function can return 200 and still report a business error (such as a record that doesn’t exist) in Messages. |
| 400 Bad Request | The token is invalid, or the request is malformed (bad syntax, too large, or badly framed). | Check the Authorization: Bearer <token> header and that the token hasn’t expired or been replaced. Check the request body. |
| 403 Forbidden | Our firewall blocked the request before it reached Wasp Asset. | Add a User-Agent header. Remove any HTML, script, or other markup from the request body. |
| 415 Unsupported Media Type | The body isn’t JSON. | Send JSON and set Content-Type: application/json. Plain text, XML, HTML, and form data aren’t accepted. |
| 422 Unprocessable Entity | The JSON is well formed, but Wasp Asset couldn’t act on what it contains. | Read Messages in the response, correct the values, and send again. |
| 429 Too Many Requests | Your account is sending requests faster than the rate limit allows. | Wait the number of seconds in the Wasp-OverloadProtection-Reset (or Retry-After) response header before sending again. Sending early resets the wait. |
| 500 Internal Server Error | Something unexpected went wrong while processing the request. | Check that the JSON matches the function’s request fields in the API function reference. If it keeps happening with a valid request, contact Wasp support with the time of the call and the function you called. |
Read the response body
Section titled “Read the response body”Most problems are explained in the body rather than the status code. Every response includes:
- HasError —
truewhen the function failed. - Messages — a list of what went wrong, or informational notes when the call succeeded.
- Data — the result, which depends on the function you called.
- HasSuccessWithMoreDataRemaining —
truewhen a paging function returned one page and more data is available.
Callout response codes
Section titled “Callout response codes”Callouts work the other way round: Wasp Asset calls your system. The status code your endpoint returns is shown for each attempt in Callout Results. A 2xx code such as 200 OK means your endpoint accepted the call. A code such as 300 Multiple Choices (your endpoint answered with a redirect) or 400 Bad Request (your endpoint rejected the request) means it didn’t. Fix the callout’s URL, headers, or body and use Retry to send it again.
Related
Section titled “Related”- Public API overview — headers, permissions, and rate limits
- Try the API with Postman — reproduce a failing call step by step
- API access tokens — fix expired or replaced tokens