Errors

Handle documented Roots API errors and prepare for the production error contract.

Handle Roots API errors by using the documented HTTP status and error message, then confirm the production error contract before automating retries.

See API availability before using error behavior in production.

Error envelope

The currently documented error response uses this JSON shape:

{
  "error": "Invalid credentials"
}

Treat the error string as diagnostic information for a human or application log. Do not build business logic that depends on the exact wording of an error message.

Documented HTTP statuses

StatusDocumented useYour action
400 Bad RequestInvalid request, such as an invalid payment source/destination pair or an invalid association.Correct the request data. Do not retry unchanged.
401 UnauthorizedInvalid login credentials or no authenticated session where required.Check the credentials or authentication state. Do not retry unchanged.
403 ForbiddenThe caller lacks permission for an operation, such as API-key creation.Request the required role or permission. Do not retry unchanged.
404 Not FoundA referenced resource is not found for selected endpoints.Verify the identifier and owning company context.
409 ConflictA duplicate association exists.Retrieve the existing record or resolve the duplicate condition.

Handle errors safely

  1. Record the HTTP status, endpoint, internal correlation ID, and sanitized error response.
  2. Do not log passwords, API-key secrets, full account numbers, or sensitive document content.
  3. Correct client-side validation errors before resubmitting a request.
  4. Route authorization failures to the owner of the relevant access control.
  5. Reconcile uncertain payment outcomes before you create another payment instruction.

Target schema — confirm in API reference

The production error contract is not yet published. Confirm the following before implementing generalized error handling:

  • Full HTTP-status coverage and error codes.
  • A stable machine-readable error identifier.
  • Request or correlation IDs.
  • Rate-limit responses and retry-after behavior.
  • Validation-error field paths.
  • Retry-safe outcomes for network failures and timeouts.

Next steps


Did this page help you?