How to Secure Business APIs
Securing a business API means knowing every endpoint that exists, requiring strong authentication for every caller, and separately checking that an authenticated caller is authorised for the specific record they're requesting. Add input validation, careful secret handling, safe logging and a plan for keeping dependencies patched, and most real-world API attacks are prevented.
Inventory Endpoints, Data and Trust Boundaries
Imagine a multi-location salon and gym chain running a central booking API that both its own staff app and a customer-facing app connect to. The first security step, before any specific control, is a complete inventory — every endpoint the API exposes, what data each one touches, and which category of caller (staff app, customer app, a partner integration) is meant to reach it.
This inventory matters because the most common real-world API breaches involve an endpoint nobody remembered was exposed, often left over from an old app version or a testing build, rather than a flaw in a well-known, actively maintained one — you can't secure what you haven't listed.
Apply Authentication and Object-Level Authorisation
Authentication answers 'who is this caller?' — typically a token issued at login. Authorisation is a separate question: 'is this specific, authenticated caller allowed to see or change this specific record?' A staff member at one salon branch being authenticated correctly doesn't mean they should be able to pull another branch's customer list just by changing an ID number in the request.
This gap — being logged in correctly but not checked against the specific record requested — is called broken object level authorisation, and it's currently listed as the single most common API security risk by OWASP's API Security Top 10, ahead of authentication failures themselves (owasp.org, checked 2026-09-08). Every endpoint that takes an ID and returns or changes data tied to that ID needs an explicit check that the caller is actually allowed to touch that particular record, not just any record of that type.
Validate Inputs, Protect Secrets and Control Abuse
Every value an API accepts from outside — a booking date, a branch ID, a search term — should be validated against what's actually expected before it's used, rather than trusted because it came through an authenticated session. This blocks a wide range of attacks that rely on sending unexpected data to a poorly guarded endpoint.
API keys and secrets should never live in code that ships to a browser or mobile app, since anything shipped to a client device can eventually be extracted; they belong on the server side only, in a secrets manager or environment configuration the client never sees. Rate limiting each caller — capping how many requests one account can make in a given period — controls abuse from a compromised account or a scraping attempt without requiring a person to notice and intervene manually.
Log Safely and Test Only in Authorised Environments
Logs are essential for diagnosing problems and investigating incidents, but they should never capture full card numbers, passwords, or other sensitive fields in plain text — a log file is often less protected than the primary database, and a leak there is just as damaging.
Any security testing — probing the API to see how it responds to bad or malicious input — should happen only against a system explicitly designated for testing, with clear authorisation, never against a live production API without the business's own written sign-off; unauthorised testing, even well-intentioned, can itself be a security and legal problem.
Manage Dependency Updates and Incident Response
An API is rarely built from scratch alone — it depends on frameworks and libraries that receive their own security patches over time, and a known vulnerability in an outdated dependency is one of the more common ways an otherwise well-built API gets compromised. A routine for checking and applying these updates, not just at launch but on an ongoing basis, is part of running the API, not a one-time setup task.
Finally, an incident response plan — how a suspected breach gets detected, who's notified, how access gets revoked or rotated quickly — should exist before it's needed. This is implementation planning, not a substitute for a proper security or compliance review specific to your industry and data, which is worth getting from a qualified advisor where regulated data is involved.
API security control checklist
A checklist grouped into four areas — inventory (endpoints, data sensitivity, caller type), access control (authentication plus per-record authorisation), hardening (input validation, secret storage, rate limiting), and operations (safe logging, dependency updates, incident response plan) — for reviewing an existing API or scoping a new one.
Frequently asked questions
Is an API key sufficient protection?
No, on its own it only proves which application is calling, not what that specific caller should be allowed to see or change. An API key needs to be paired with per-record authorisation checks, or a valid key alone can be enough to pull data it was never meant to reach.
How do we restrict access to individual records?
By checking, on every request that includes a record ID, whether the authenticated caller is actually permitted to access that specific record — not just whether they're logged in. This check, known as object-level authorisation, is currently rated the top API security risk by OWASP.
Sources
- OWASP API Security Top 10 (2023) — API1: Broken Object Level Authorization — verified 8 Sept 2026
Have a specific situation to work through?
This article covers the general case. Tell us what you're actually dealing with and we'll respond directly.