KwitKwit Docs

Errors

HTTP status codes and SDK error handling

llms.txtHTTP status codes and SDK error handling

HTTP responses

StatusMeaning
400Validation failed - { "error": { "<field>": ["message"] } }
401Missing/invalid/expired API key - { "error": "..." }
404Resource not found - { "error": "..." }
500Server error - { "error": "message" }

Some routes return 204 with no body (e.g. DELETE /meters/:id).

SDK: KwitError

import Kwit, { KwitError } from "@kwit/sdk";

try {
  await kwit.customers.create({ email: "bad" });
} catch (err) {
  if (err instanceof KwitError) {
    console.log(err.status);
    console.log(err.code);
    console.log(err.details); // field errors on 400
  }
}
CodeStatusNotes
validation_error400Check details
authentication_error401Rotate API key
not_found404Wrong ID or other org
rate_limit_exceeded429SDK retries automatically
internal_error5xxSDK retries with backoff

On this page