Errors and validation
Find the correct failure contract for each API and authentication surface.
Unidy's REST API, SDK HTTP API, OAuth endpoints, and SDK libraries do not have one interchangeable error envelope. Choose the contract for the request that failed.
| Surface | Use this guide |
|---|---|
REST API requests under /api/v1 | Errors, idempotency, and retries |
| OAuth, hosted sign-in, and authentication failures | Authentication errors |
| JavaScript SDK or React hook failures | SDK troubleshooting |
| SDK HTTP operations called directly | SDK HTTP API reference and the operation's guide |
| Webhook receiver or delivery failures | Troubleshoot failed deliveries |
Handle the failed operation
- Record the surface, method, path, status, and documented error identifier. Keep credentials, tokens, and personal payloads out of shared diagnostics.
- Check the response status and content before parsing it. Some successful operations have no JSON body; some failure responses do not use the envelope of a neighboring API.
- For validation errors, correct the submitted fields and preserve the user's input. Do not turn a failed update into an empty or null-valued replacement.
- For authorization errors, check token type, expiry, scope, and applicable resource access. Repeating the same request does not repair missing permissions.
- Before retrying a write after a timeout or connection failure, determine whether it may already have succeeded. Reconcile the resource state using the operation's documented behavior; do not assume all PATCH or PUT requests are safe to repeat.
Use Schemas and identifiers when the issue is an identifier, missing field, or null value, and Limits and production readiness for operational checks.