Getting started

Errors

Every error has the same shape, with a code your app can act on.

Every error has the same shape:

{
  "code": "kwazi_invalid",
  "message": "Some fields are not valid.",
  "details": { "email": "invalid_email" }
}

details names, per field, what is wrong. Show message to people; let your code act on code and details.

HTTP code Meaning What to do
400 kwazi_invalid A value is missing or not valid; see details Fix the values and send again
400 rest_invalid_param A parameter has the wrong type (WordPress checks this first) Fix the parameter
401 rest_forbidden Not logged in: no or wrong credentials Check username and application password
403 rest_forbidden, kwazi_forbidden Logged in, but the user lacks the permission of this route Use a user with that permission
403 kwazi_app_password_not_allowed The user’s role may not use application passwords with Kwazi Ask an administrator (authentication)
404 kwazi_not_found No such record, or the user may not see it Check the id; with "only own" visibility, records of others are "not found"
409 kwazi_duplicate A contact with this email address exists; details.id is its id Update that contact instead
409 kwazi_slot_taken The time was just booked by someone else; details.alternatives lists the closest free times Offer one of those
409 kwazi_in_use The record is still used (e.g. a form that a service books with; details says what) Change what uses it first
429 kwazi_rate_limited Too many requests on a public route Wait and try again later
502 kwazi_mail_failed An email could not be sent Check the site’s email settings and try again

Common field codes in details: required, too_long, invalid, invalid_email, invalid_phone, invalid_url, invalid_date, invalid_option, unknown_field, not_allowed (an address a webhook may not send to).

Still stuck?

A real person answers, in plain words. Use the help form, or ask on the WordPress forum.

Ask us a question