API security is the practice of protecting APIs, the connections that let one piece of software ask another for data or actions, so that only the right callers can do only the right things.
Every time a phone app shows your bank balance, a website takes a payment or two cloud services share data, an API is doing the work behind the scenes. This guide explains API security in plain English for newcomers, students, career changers and managers who are not security specialists. It covers why APIs are a target, how a well-protected API handles a request, a worked example, common myths and first steps for a small team.
By the end of this guide you will be able to:
- Explain what an API is and why it needs protecting.
- Understand the difference between authentication and authorisation for APIs.
- Describe the checks a secure API makes on each request.
- Identify the most common API weaknesses and first steps to address them.
Key takeaways
- APIs are doors into your data. They are built for software to use, which makes them easy to call at speed and at scale, by attackers too.
- Proving who is calling is not enough. The API must also check that this caller is allowed to see this particular record or perform this action.
- You cannot protect APIs you do not know about. Old, forgotten and test APIs are a common weak spot.
- Every request should be checked. Identity, permission, input and volume should be checked each time, not just at login.
- The OWASP API Security Top 10 is a good starting map. It lists the most common API weaknesses in plain categories.
What it is, in plain English
An API (application programming interface) is a defined set of rules that lets one system request data or actions from another. Each specific address an API offers, such as "get customer details", is called an endpoint. Most modern APIs work over the web, using the same HTTP and HTTPS protocols as websites, but they return data for software to read rather than pages for people.
API security means making sure that each request comes from a known caller, that the caller is allowed to do what they ask, that the request is safe to process, and that misuse is noticed. The UK National Cyber Security Centre (NCSC) lists threats to HTTP-based APIs that include using insecure endpoints to reach sensitive data, unauthorised actions such as payments, manipulating stored data and denial of service through repeated requests.[2]
A helpful comparison is a restaurant's order hatch. Waiters (apps) pass order slips (requests) through the hatch, and the kitchen (the system behind the API) sends back dishes (data). A good kitchen checks that the slip comes from a real waiter, that the dish is on that table's order, and that nobody orders 500 desserts in a minute. Where the analogy breaks down: a kitchen sees every waiter's face, while an API often only sees a key or token, which anyone who steals it can present.
Why it matters to you
- If you run a small business: your online shop, booking system and accounting tools all use APIs, and the keys that connect them can give direct access to customer data.
- If you are new to a security job: API weaknesses can lead to large data exposures, and testing and reviewing APIs is a growing part of application security work.
- If you are a manager: partners, apps and AI tools increasingly connect through APIs, so knowing which APIs exist and who owns them is a governance question.
APIs are attractive because they are designed to hand out data efficiently. If the checks are weak, an attacker can ask for record after record. In the T-Mobile API Breach 2023, T-Mobile told US regulators that an unauthorised party had obtained data through a single API from around 25 November 2022, affecting about 37 million customer accounts, before the activity was found on 5 January 2023 and stopped within a day.[3] The company said the data included names, billing addresses, email addresses, phone numbers and dates of birth, but not payment card details or passwords.[3]
Every API caller is a kind of non-human identity: an app, script or service that holds a credential. That is why API security and identity security overlap so much.
How it works, step by step
A well-protected API makes a series of checks on every request. Products and teams use different tools for each step, but the ideas are the same.
- Request. An app sends a request to an endpoint. The connection should use HTTPS so the request cannot be read or changed on the way.
- Authenticate. The API checks who is calling. This is API authentication, usually done with an API key or a short-lived access token, often issued through a standard called OAuth.
- Authorise. The API checks whether this caller may do this action on this particular record. This is API authorisation. The OWASP API Security Top 10 puts the failure of this check for individual records, called broken object level authorization, first on its list.[1]
- Validate. The API checks the input is what it expects, such as the right type, format and size, before using it. This is called input validation.
- Respond. The API returns only the data the caller needs, not whole records "just in case".
- Log and limit. Calls are recorded, and rate limiting caps how many requests a caller can make in a set time. Unusual patterns, such as one caller downloading far more records than normal, can then be spotted.

Many organisations put an API gateway in front of their APIs to handle some of these checks in one place, such as authentication, rate limiting and logging. A gateway helps, but the check on whether a caller may see a specific record usually still has to happen in the application itself. The OWASP list also warns about improper inventory management: old API versions and forgotten endpoints left running with weaker protection.[1]
For a deeper, standards-based treatment, NIST publishes guidelines on protecting APIs across their life cycle, with basic and advanced controls for development and runtime.[4]
A worked example
Brightside Fitness is a fictional chain of six gyms with a mobile app. Members use it to book classes and see their payment history. Aisha, a developer, is asked to review the app's API before a new feature launches.
She signs in as a test member and watches the requests the app sends. To show payment history, the app calls an endpoint with the member's number in the address. Aisha changes the number to that of a second test account she controls, and the API returns the other account's payment history. The API checked that she was signed in, but not that the record was hers: a broken object level authorization issue.
Aisha reports it to the team lead, Marcus. The team fixes the endpoint so it looks up the signed-in member's own records, and adds the same check to three similar endpoints. They also find an old version of the API, used by a retired app, still running. They plan its shutdown with a short, approved notice period and record the decision.
Finally, they set a rate limit on the history endpoint and an alert if one account requests an unusual number of records. There is no sign the flaw was misused, but the team checks the logs to be sure, and adds an object-level authorisation test to their release checklist.
Myths and misunderstandings
| What people think | What is true |
|---|---|
| Our API is hidden because it has no web page. | APIs can be found by watching app traffic or scanning. Obscurity is not protection. |
| If callers have to sign in, the API is secure. | Signing in proves who is calling. Each request still needs a check on what that caller may access. |
| HTTPS means the API is safe. | HTTPS protects data on the way. It does nothing about weak permission checks. |
| An API gateway handles all of API security. | A gateway helps with keys, limits and logging, but record-level permission checks usually live in the application. |
| API keys are fine to put in mobile apps or web pages. | Anything shipped to users' devices can be extracted. Sensitive keys belong on servers. |
| Internal APIs do not need protecting. | An attacker who gets inside, or a compromised partner, can reach internal APIs too. |
Key terms
- API
- An application programming interface: a defined set of rules that lets one system request data or actions from another.
- API endpoint
- A network address that lets a caller reach one resource or operation, together with the rules on who may use it.
- API authentication
- Proving which client, service or application is calling an API, using credentials such as keys, tokens or certificates.
- Deciding what a caller may do once its identity is known, using scopes, roles or policies.
- API key
- A unique, usually long-lived credential that identifies an application when it calls an API.
- Access token
- A credential that lets a caller use an API for a limited time with specific permissions.
- A failure to check whether a signed-in caller may access a specific record, so a valid credential can reach other people's data.
- Rate limiting
- Capping how many requests a caller can make in a set period, to reduce abuse and protect availability.
- API gateway
- A layer in front of backend services that handles how requests are authenticated, routed, logged and rate limited.
- Shadow API
- An API that is running in production but is not fully known, reviewed or governed by the security team.
- Input validation
- Checking that data matches the type, format and range an application expects before using it.
Common questions
What is the difference between API authentication and authorisation?
Authentication answers "who is calling?". Authorisation answers "what is this caller allowed to do, and to which records?". Both are needed on every request.
Are API keys enough on their own?
They identify the calling application, but they are often long-lived and easy to leak. Short-lived tokens, limited permissions and per-caller keys reduce the damage if one is stolen.
What is the OWASP API Security Top 10?
It is a list from the Open Worldwide Application Security Project (OWASP) of the ten most important API security risks. The 2023 edition starts with broken object level authorization and broken authentication.[1]
Do small businesses need to worry about API security?
Yes, even if they do not build APIs. The tools you use connect through APIs, and the keys and connected apps you set up are part of your security.
What is a shadow API?
An API that is running but that the security team does not know about or manage, such as an old version or a test service left online.
Is an API gateway the same as API security?
No. A gateway is one useful tool. API security also covers design, permission checks in code, testing, inventory and monitoring.
First steps
Three things you can do this week:
- Make a list of your APIs and connections. Write down the APIs you run and the third-party apps and services connected to yours, with an owner for each.
- Find and protect API keys. Check where your API keys are stored. Remove any found in code, shared documents or apps on users' devices, replace them, and give each integration its own key with only the access it needs.
- Test one endpoint for record-level checks. With two test accounts, check that one cannot see the other's data. If you find a gap, fix it there and look for the same pattern elsewhere.
Checklist
- We have an up-to-date list of our APIs, with an owner for each.
- All APIs use HTTPS.
- Every API request is authenticated, and each caller has its own credential.
- Each endpoint checks that the caller may access the specific record or action requested.
- APIs return only the data needed, not full records.
- Rate limits are set on sensitive and data-heavy endpoints.
- API calls are logged and someone is alerted to unusual volumes.
- Old API versions are retired on a planned, approved schedule.
- API keys are kept out of code and user devices, and are rotated.
Check your understanding
1. What is the difference between authentication and authorisation for an API?
Answer: authentication proves who is calling; authorisation decides what that caller may do and which records it may reach.
2. What is broken object level authorization?
Answer: when an API checks that a caller is signed in but not whether the specific record requested belongs to them, so changing an identifier can reveal other people's data.
3. Why are forgotten or old APIs risky?
Answer: they may run with weaker protection and nobody is watching them, but they can still reach real data.
4. Does HTTPS make an API secure?
Answer: no. HTTPS protects data on the way, but it does not check who may access what.
Suggested learning pathway
- SQL Injection for Beginners: a related beginner guide to read next.
- The OWASP Top 10 for Beginners: a related beginner guide to read next.
- Mobile App Security for Beginners: a related beginner guide to read next.
- For the credentials that many APIs rely on, start with API Keys for Beginners.
- For how apps get access tokens, see OAuth 2.0 for Beginners.
- For a common token format, see JSON Web Tokens for Beginners.
- For the full practitioner view, see the API Security Guide.
- For the top API weakness in depth, see the OWASP API Top 10 API1 Broken Object Level Authorization Guide.
- For limits and abuse controls, see the Rate Limiting and API Abuse Guide.
- For gateways, see the API Gateway Security Guide.
Standards and references
- OWASP API Security Top 10 2023 (API1:2023 Broken Object Level Authorization; API9:2023 Improper Inventory Management). OWASP Foundation. https://owasp.org/API-Security/editions/2023/en/0x11-t10/.
- Securing HTTP-based APIs. National Cyber Security Centre (NCSC), published 3 Apr 2025. https://www.ncsc.gov.uk/collection/securing-http-based-apis, accessed 27 Nov 2026.
- T-Mobile US, Inc. Form 8-K. US Securities and Exchange Commission (SEC), filed 19 Jan 2023. https://www.sec.gov/Archives/edgar/data/1283699/000119312523010949/d641142d8k.htm.
- SP 800-228 Update 1, Guidelines for API Protection for Cloud-Native Systems. National Institute of Standards and Technology (NIST), June 2025, updated 13 Mar 2026. https://csrc.nist.gov/pubs/sp/800/228/upd1/final, accessed 27 Nov 2026.
Related NHI Mgmt Group resources: API Keys for Beginners · OAuth 2.0 for Beginners · JSON Web Tokens for Beginners