Errors

An error is a status code and a JSON body with a message:

{
  "error": "sign in again with your second factor to make changes",
  "next": "step_up"
}

next, when present, says what to do: step_up means sign in again using your second factor; enroll_two_factor means set up a second factor first.

Every call

Status When
400 The request is malformed, or sends a token together with a cookie or an Origin header.
401 No token, or one that has ended. Sign in again.
403 Your roles don't allow it, the change needs a second factor (next says which), or the endpoint isn't open to tokens.
404 Nothing with that ID in your organization.
409 It conflicts with what is there: a name in use, or a change that would leave your organization with no administrator.
415 A change sent without Content-Type: application/json.
503 Try again shortly.

Each endpoint's page lists the errors particular to it.