Protect identity and access

Use a supported authentication method and protect credentials in transit and at rest. Set a clear token lifetime and revoke tokens when a user or integration no longer needs access.

Check authorization on every route and object. Test with accounts that have different roles. A valid token proves an identity; it does not prove permission to read every record or call every function.

Limit input and resource use

Validate data on the server and reject values that do not match the expected format. Set limits for request size, page size, query complexity and expensive actions. Apply rate limits that fit the business flow and do not expose private data in error messages.

Review how the API uses external services. Validate responses and set timeouts. An API can inherit risk from a service it trusts, so define which destinations and data are allowed.

Test the release candidate

Use a staging environment with representative routes and test accounts. Check authentication, access control, input handling, logging and failure paths. Confirm that logs help the team investigate events without storing passwords, tokens or unnecessary personal data.

Keep an API inventory and owner after launch. A scoped API penetration test can validate key user and integration flows before a public release or major change.