API Security Checklist: Auth, Rate Limits and Logging
An API security checklist for Indian product teams: authorisation, authentication, rate limits, input validation and logging, mapped to the OWASP API Top 10.
Summary of this article
- Defines API security and explains why APIs are a common attack surface for web, mobile and partner integrations.
- Walks through authorisation checks at object, property and function level, based on the OWASP API Security Top 10.
- Covers authentication, token handling, rate limiting and resource caps, including stricter limits for login and reset flows.
- Explains input and output validation, secrets and configuration hygiene, and structured logging with request IDs.
- Provides a checklist table, an Indian data protection note and a description of how Arham Technology builds secure APIs.
Summarised by AI from the full article. Check figures and prices against the article before you act on them.

Quick answer
An API security checklist covers six areas: check authorisation on every object and function, secure authentication and tokens, rate-limit every route (login most strictly), validate all input and output, keep secrets and configuration safe, and log requests with an ID so incidents can be traced. Start with object-level authorisation, because it is OWASP's top API risk.
Key takeaways
- Check that the logged-in user may access the specific record on every endpoint that takes an ID, because broken object-level authorisation is the first risk on the OWASP API list.
- Validate token signature, algorithm, issuer, audience and expiry on the server, and keep access tokens short-lived.
- Rate-limit every route, apply much stricter limits to login and password reset, and cap page sizes and file uploads.
- Return only the fields a client needs, and accept only the fields a client may set.
- Log who did what with a request ID, never log secrets or full personal data, and test your alerts before an incident.
On this page
- What is API security, and why do APIs get attacked?
- Are you checking authorisation for every object?
- How should you handle authentication and tokens?
- How do you apply rate limits and resource caps?
- How should you validate input and shape responses?
- What belongs in configuration, secrets and inventory?
- What should you log, and what should you never log?
- API security checklist you can reuse before every release
- How Arham Technology approaches API security
- Next step
Most API breaches are not clever. A user changes an order number in a request and sees someone else's invoice. A login endpoint accepts a million password guesses. A debug log quietly stores access tokens. If you are building or inheriting an API, a practical API security checklist helps you close these gaps before a customer, a partner or an attacker finds them.
This guide follows the structure of the OWASP API Security Top 10 (2023) and turns it into checks your team can run: authorisation, authentication, rate limits, input handling, configuration and logging. It ends with a checklist table you can paste into your release process.
What is API security, and why do APIs get attacked?
API security is the set of controls that make sure only the right callers can read or change the right data through your API, at a rate and in a shape you expect. APIs are attacked often because they expose business logic directly, they are documented by design, and a mobile app or website shows attackers exactly how to call them.
Three facts shape how you should approach it:
- Your frontend is not a security layer. Hiding a button does not stop someone from sending the request by hand.
- The API is the product's real boundary. Web, Android, iOS and partners all go through it.
- Security bugs are usually logic bugs. Missing ownership checks cause far more damage than exotic exploits.
Are you checking authorisation for every object?
Check on the server that the logged-in user is allowed to access the specific record in every request. OWASP lists broken object level authorisation as API1:2023, and describes it as endpoints that take an object ID without verifying the caller's right to that object.
This is the single highest-value check on the list. Make sure you cover three levels:
- Object level: can this user read invoice 1042? Check ownership or membership, not just that they are signed in.
- Property level: can this user change this field? A customer should not be able to send
"role": "admin"or"price": 1in an update body. - Function level: can this role call this endpoint at all? Admin and internal routes need their own checks.
OWASP also warns that comparing the user ID in a token with an ID in the request is not enough on its own, because it covers only a small set of cases. Build one reusable policy layer, such as middleware in Node.js or policies in Laravel, and write automated tests that try each role against each route. Using unguessable IDs reduces enumeration but does not replace the check.
How should you handle authentication and tokens?
Use proven libraries and standards for authentication, and validate every token fully on every request. OWASP's broken authentication risk covers weak passwords, no brute-force protection, tokens in URLs and unvalidated tokens.
A solid baseline looks like this:
- Never put tokens or passwords in URLs. They end up in logs, browser history and referrer headers. Send them in headers or secure cookies.
- Validate JWTs strictly. RFC 8725 says applications should specify the algorithms they accept, tie each key to one algorithm, and reject tokens that fail any cryptographic check. Also check the issuer, audience and expiry.
- Keep access tokens short-lived and use refresh tokens that can be revoked when a device is lost or a user logs out everywhere.
- Treat password reset and OTP as login. OWASP advises applying brute-force, rate limiting and lockout protections to credential recovery too.
- Store passwords with a slow, salted hash such as Argon2id or bcrypt, never with plain hashing, and check new passwords against known weak ones.
- Offer multi-factor authentication for admin and finance roles at minimum.
For OTP flows common in India, cap OTP attempts per number and per device, expire codes quickly and never reveal whether a mobile number is registered.
How do you apply rate limits and resource caps?
Limit how often and how heavily each client can call every route, and set the strictest limits on authentication and anything that costs you money. OWASP calls this unrestricted resource consumption: requests need bandwidth, CPU, memory and storage, and paid services such as SMS and email are billed per request, so abuse can mean downtime or a large bill.
Apply limits in layers:
| Control | What to set | Why |
|---|---|---|
| Per-IP and per-user rate limit | Sensible default on every route | Stops scraping and simple floods |
| Login, OTP, reset limits | Very low, with lockout or captcha | Blocks credential stuffing and SMS pumping |
| Page size cap | A hard maximum such as 100 items | Stops "return everything" requests |
| Request body and upload size | Reasonable maximum in bytes | Protects memory and storage |
| Timeouts and query limits | Server timeout, bounded filters | Prevents slow or expensive queries |
| Spend limits on SMS and email | Daily caps and alerts | Protects against bill shock |
When a client goes over the limit, return 429 Too Many Requests with a Retry-After header, as defined in RFC 9110, so well-behaved clients know when to retry. Behind a load balancer, make sure your limiter reads the real client IP and not the proxy's.
How should you validate input and shape responses?
Treat every incoming value as untrusted, accept only what you expect, and return only what the client needs. This closes injection bugs and the excessive data exposure that comes from returning whole database rows.
- Validate against a schema for every request: types, lengths, formats and allowed values. Your OpenAPI contract is a good source for these rules.
- Use an allow-list for writable fields. Never pass a raw request body to your database layer, which is how mass assignment bugs happen.
- Use parameterised queries or your ORM's safe methods, never string-built SQL.
- Return explicit response fields. Do not send password hashes, internal IDs, flags or other users' data because the model happened to contain them.
- Check outbound calls. OWASP also flags server-side request forgery and unsafe consumption of third-party APIs, so validate URLs you fetch and treat data from partners as untrusted.
If your API design is still in progress, our guide to REST API design best practices covers contracts, error formats and pagination, all of which make validation simpler.
What belongs in configuration, secrets and inventory?
Keep secrets out of code, lock down defaults and know every API you run. OWASP lists security misconfiguration and improper inventory management as separate risks, because forgotten test endpoints and old API versions are common entry points.
- Store secrets in environment variables or a secrets manager, rotate them, and never commit them to Git.
- Force HTTPS everywhere and set a strict CORS list instead of allowing all origins.
- Turn off debug mode, stack traces and verbose errors in production.
- Keep an inventory of every API host, version and owner, and retire old versions on a published date.
- Separate environments. Staging should not hold real customer data or production keys.
- Update dependencies on a schedule and run an automated vulnerability scan on every release.
What should you log, and what should you never log?
Log enough to reconstruct what happened, and never log secrets. Good API logs answer who called what, when, from where and with what result, without becoming a second place where sensitive data leaks.
Log these for every request: a request ID, timestamp, authenticated user or client ID, route, status code and duration. Always log login failures, permission denials, rate-limit hits, password and role changes, and admin actions.
Never log passwords, full tokens, OTPs, card numbers or full request bodies containing personal data. Return the request ID to the client in error responses, so support can find the exact failure without exposing internals.
Logs only help if someone looks at them. Set alerts for spikes in 401, 403 and 429 responses, and rehearse an incident once: who is told, who can revoke keys, and how do you contact affected users. The Digital Personal Data Protection Rules, 2025 notified in November 2025 require data fiduciaries to take reasonable security safeguards and to report personal data breaches, with obligations phasing in over eighteen months. Logs and a rehearsed process make that reporting realistic. Confirm exact dates and duties with a legal adviser.
API security checklist you can reuse before every release
Use this table in your pull request template or release checklist:
| Area | Check | Done |
|---|---|---|
| Authorisation | Object, property and function checks on every route, with tests per role | โ |
| Authentication | Tokens validated fully, short expiry, revocation works | โ |
| Recovery flows | Login, OTP and reset have strict limits and lockout | โ |
| Rate limits | Default limits, page caps, upload caps and spend alerts set | โ |
| Input | Schema validation and allow-listed writable fields | โ |
| Output | Explicit response fields, no internal data | โ |
| Configuration | HTTPS, strict CORS, no debug output, secrets outside code | โ |
| Inventory | Every API version and host listed with an owner | โ |
| Logging | Request IDs, security events logged, secrets never logged | โ |
| Dependencies | Scan passed and critical updates applied | โ |
If you are still choosing a stack for these controls, our comparison of Node.js vs Laravel for backends shows how each handles authentication, validation and background jobs.
How Arham Technology approaches API security
Our backend development service builds security into the design instead of adding it at the end. For each project we follow the same steps:
- Domain and threat sketch: we map entities, trust boundaries and the abuse cases that matter for your product, such as one customer reading another's data.
- Contract first: OpenAPI or an equivalent contract is agreed, including auth requirements and error formats.
- Core services build: authentication, authorisation and primary workflows ship with automated tests around the rules that must never break.
- Integration and load checks: third-party adapters use retries and idempotency, and key paths are exercised under expected load.
- Runbook handover: deploy steps, logging notes and incident basics are documented for your team.
We build in Node.js and Laravel. If you are handling subscriptions, customer accounts or multiple tenants, our SaaS development service applies the same controls to tenant isolation and billing flows.
Next step
If you already have an API in production, start with an authorisation review of your ID-based endpoints and a check of your login rate limits. If you are planning a new product, agree the security rules before the first endpoint is written. Learn more about our backend development service or contact us with your endpoint list, and we will suggest a practical plan.
Frequently asked questions
What is the most important API security control?
Authorisation checked on the server for every object and action is the most important control. OWASP ranks broken object-level authorisation as the number one API risk, because attackers simply change an ID in a request. Authentication proves who a user is, but it does not decide which records they may touch.
Is JWT safe to use for API authentication?
JWT is safe when it is implemented carefully. Allow only the signing algorithms you choose, verify the signature, issuer, audience and expiry on every request, and keep access tokens short-lived. RFC 8725 lists the best current practices. Most JWT incidents come from skipped validation, not from the format itself.
How many requests per minute should I allow per user?
There is no universal number, so set limits from real usage. A common approach is a generous limit for normal reads, a lower one for writes and a very low one for login, OTP and password reset. Return a 429 status with a Retry-After header when a client exceeds the limit.
Do I need an API gateway for security?
Not at the start. A gateway helps with central rate limiting, authentication and logging once you run several services. A single well-built API can enforce the same controls in its own middleware. Add a gateway when the number of services or partners makes central control worthwhile.
How often should an API be security tested?
Test before launch, after major changes, and on a regular schedule such as every quarter or year, depending on the data you hold. Run automated dependency and configuration checks on every release. Authorisation tests for each role should be part of your normal automated test suite.
Does India's DPDP law affect API security?
Yes. The Digital Personal Data Protection Rules, 2025 require data fiduciaries to take reasonable security safeguards and to report personal data breaches, and these obligations phase in over an eighteen-month period from November 2025. If your API handles personal data, treat these controls as requirements, and take legal advice for your case.
Want Backend Development done right?
Get a free consultation and a clear plan โ scope, timeline and cost โ from our Mumbai team.



