API Design and Security
An API should expose a durable business contract rather than mirror internal tables or route implementation.
Contract Checklist
- Use resource-oriented paths and stable opaque identifiers.
- Authenticate before loading protected data.
- Apply workspace and object authorization to every operation.
- Validate types, length, format, allowed values, and cross-field rules.
- Return consistent success and error envelopes.
- Paginate registers and bound expensive filters or exports.
- Make retry behavior and idempotency explicit for consequential writes.
- Version breaking contract changes deliberately.
Do not expose stack traces, SQL, filesystem paths, credentials, configuration values, or internal exception details. Log a correlation identifier server-side and return a safe error to the caller.