An application programming interface (API) is a set of rules, protocols, and tools that allows software applications to communicate with each other.
APIs define how requests for data or functionality should be made, transmitted, and responded to. They power virtually every modern digital interaction, from mobile apps loading content to cloud services exchanging data to payment processors authorizing transactions.
For enterprises, APIs are also a primary data exposure surface. Every API call that transmits sensitive information (PII, payment data, health records) creates an opportunity for unauthorized access if the API is not properly secured and the data it carries is not protected at the field level.
An API acts as an intermediary between two software systems. One system (the client) sends a request, and the other (the server) processes it and returns a response.
The API defines the rules for this exchange.
Every API interaction follows the same pattern:
Endpoint. A specific URL where an API receives requests. Each endpoint corresponds to a resource or function. A single API may expose dozens or hundreds of endpoints.
API key. A unique string is passed with each request to identify the calling application. API keys authenticate the application, not the user. They are insufficient for user-level access control on their own.
Payload. The data is transmitted in the body of an API request or response. For sensitive data (credit card numbers, Social Security numbers, health identifiers), the payload is the primary attack target.
Rate limiting. Controls that restrict how many API calls a client can make within a given time period. Rate limiting prevents abuse, brute-force attacks, and resource exhaustion.
API gateway. An infrastructure layer that sits between clients and backend API services. Gateways handle authentication, rate limiting, routing, and logging in a centralized location.
APIs are the connective tissue of modern software. Every SaaS integration, mobile app backend, payment processor, and cloud service depends on APIs to exchange data and trigger actions across systems.
APIs enable microservices architecture, allowing development teams to build, deploy, and scale components independently. They create business value by opening partner integrations, developer ecosystems, and data-sharing pipelines. Without APIs, every software system would operate as a closed silo.
The scale is significant. Cloud providers report that API traffic now accounts for the majority of internet requests. The average enterprise manages hundreds of internal and external APIs, each of which represents a potential data access point.
This is where the security dimension becomes critical. Every API endpoint that transmits sensitive data is an exposure surface.
Unlike a web page (where users see rendered content), an API returns structured data directly. A misconfigured API can expose entire database records, including fields the consuming application does not need.
| Type | Protocol | Data Format | Strengths | Limitations |
|---|---|---|---|---|
| REST | HTTP | JSON (typically) | Simple, stateless, widely adopted | Can over-fetch or under-fetch data |
| SOAP | HTTP, SMTP | XML | Strict contracts, built-in error handling, WS-Security | Verbose, complex to implement |
| GraphQL | HTTP | JSON | Client specifies exact fields needed | Complex caching, potential for over-querying |
| gRPC | HTTP/2 | Protocol Buffers | High performance, bidirectional streaming | Limited browser support |
REST APIs dominate modern web and mobile development. Their simplicity and stateless design make them the default choice for most applications.
GraphQL has gained adoption in environments where clients need precise control over the data they receive, reducing unnecessary data transfer.
Public APIs (also called open APIs) are available to external developers. Examples include the Stripe payments API, the Google Maps API, and the X (Twitter) API. Public APIs typically require an API key and enforce rate limits.
Private APIs (also called internal APIs) are used within an organization. They connect internal services, databases, and applications. Private APIs are not exposed to external consumers but still require security controls, as they often carry the most sensitive data.
Partner APIs are shared with specific business partners under contractual agreements. They sit between public and private in terms of access scope and typically require more stringent authentication than public APIs.
APIs have become the primary attack vector for data breaches in cloud-native and SaaS environments.
The OWASP API Security Top 10 (2023) identifies the most critical vulnerabilities:
| Rank | Risk | Core Problem |
|---|---|---|
| API1 | Broken Object Level Authorization | API fails to verify that the requesting user has permission to access a specific object |
| API2 | Broken Authentication | Weak or missing authentication allows attackers to impersonate legitimate users |
| API3 | Broken Object Property Level Authorization | API exposes sensitive object properties that the consumer should not access |
| API4 | Unrestricted Resource Consumption | No rate limiting or resource controls, enabling brute-force and denial-of-service |
| API5 | Broken Function Level Authorization | Unauthorized users can execute admin-level API functions |
| API6 | Unrestricted Access to Sensitive Business Flows | Attackers automate access to business-critical API flows (purchasing, account creation) |
| API7 | Server-Side Request Forgery (SSRF) | API fetches user-supplied URLs without validation |
| API8 | Security Misconfiguration | Default settings, missing headers, verbose error messages |
| API9 | Improper Inventory Management | Undocumented, outdated, or shadow APIs remain exposed |
| API10 | Unsafe Consumption of APIs | Insufficient validation of data received from third-party APIs |
Most API security tools focus on the perimeter: authentication, rate limiting, WAF rules, and gateway policies. These controls verify who is making the request and whether the request is allowed.
They do not address what data the API returns.
This is the gap that data-centric security closes.
Tokenization and dynamic data masking applied before API response transmission ensure that sensitive fields never reach downstream systems in cleartext.
Even if an API is misconfigured or an authorization check fails, the exposed data contains no exploitable values.
Authentication proves identity. Authorization determines what the authenticated identity is allowed to do. Both are necessary for API security, but neither protects the actual data payload.
| Method | Authenticates | Security Level | Best For |
|---|---|---|---|
| API key | Application | Low (no user context) | Public APIs with basic access tracking |
| OAuth 2.0 | User (delegated) | High (scoped tokens) | Consumer-facing APIs, third-party integrations |
| JWT | User (self-contained) | High (signed claims) | Stateless APIs, microservices |
| mTLS | Both client and server | Very high (certificate-based) | Service-to-service, zero trust environments |
API keys identify the calling application. They are simple to implement but provide no user-level context. An API key alone cannot distinguish between an authorized user and an attacker who has obtained the key.
OAuth 2.0 is the standard framework for delegated user authorization. It issues access tokens with defined scopes, allowing users to grant third-party applications limited access without sharing credentials.
JWT (JSON Web Tokens) are self-contained tokens that carry user claims (identity, roles, permissions) in a signed payload. JWTs are commonly used with OAuth 2.0 and eliminate the need for the API server to query a session store on every request.
mTLS (Mutual TLS) requires both client and server to present certificates, establishing two-way authentication. mTLS is the standard for service-to-service communication in zero trust architectures.
Authentication and authorization control who accesses the API and what functions they can call. They do not control what data values appear in the response.
This is where field-level data protection becomes essential.
Attribute-based access controls can evaluate user attributes at the data layer to determine whether a given field returns the original value, a tokenized substitute, or a masked representation. This adds a third security layer that operates on the data itself, independent of the API's own access controls.
1. Authenticate every API call. Use OAuth 2.0 or mTLS for production APIs. API keys alone are insufficient for any API that handles sensitive data.
2. Enforce least privilege at the field level. Return only the fields the consuming application needs. Do not rely on the consumer to ignore extra data. Oversharing is the root cause of OWASP API3 (Broken Object Property Level Authorization).
3. Apply rate limiting and throttling. Set request limits per client, per endpoint, and per time window. Rate limiting prevents brute-force attacks, credential stuffing, and resource exhaustion.
4. Validate and sanitize all input. Reject malformed requests before they reach business logic. Input validation prevents injection attacks (SQL, NoSQL, command injection) that exploit API parameters.
5. Use TLS 1.3 for all API traffic. Never transmit data in cleartext, even between internal services. Encrypt all API traffic in transit.
6. Log every API call and monitor for anomalies. Capture request metadata (caller, endpoint, timestamp, response code) and feed logs into your security monitoring pipeline. Alert on unusual patterns: spikes in 4xx errors, unexpected geographic origins, or abnormal data volumes.
7. Apply data-level protection to API responses. Tokenize or mask sensitive fields in API responses so downstream systems never handle cleartext PII, PAN, or PHI. This is the control that prevents data exposure even when API-level authorization fails.
8. Maintain a complete API inventory. Document every API endpoint, its authentication requirements, its data classification, and its consumer applications. Data discovery and classification tools can identify what sensitive data flows through each API. Undocumented or shadow APIs (OWASP API9) are the most common source of undetected data exposure.
API perimeter security (authentication, rate limiting, gateways) controls access. It does not control the data values that flow through authenticated connections.
Data security platforms close this gap by applying tokenization and dynamic data masking inline, before API responses reach consuming applications.
DataStealth enforces field-level data protection at the network layer, without code changes or application modifications, ensuring that sensitive values never appear in cleartext outside the environments where they are explicitly authorized.
See how DataStealth protects sensitive data flowing through your APIs →
API stands for application programming interface. It is a set of rules and protocols that allows software applications to communicate with each other by defining how requests and responses should be structured and transmitted.
A REST (Representational State Transfer) API is the most common API architecture. It uses standard HTTP methods (GET, POST, PUT, DELETE) to interact with resources identified by URLs. REST APIs are stateless, meaning each request contains all the information the server needs to process it.
An API defines the interface: endpoints, methods, data formats, and authentication requirements. An SDK (Software Development Kit) is a toolkit that makes it easier to interact with an API, typically including libraries, documentation, and sample code for a specific programming language. SDKs wrap APIs.
An API key is a unique string that identifies the calling application when making an API request. API keys are used for basic authentication and usage tracking. They do not authenticate individual users and should not be the sole security control for APIs handling sensitive data.
An API endpoint is a specific URL where an API receives requests. Each endpoint corresponds to a particular resource or function. For example, api.example.com/v1/users might return user data, while api.example.com/v1/orders might return order records.
APIs expose sensitive data when they return more fields than the consumer needs (excessive data exposure), when authorization checks fail to restrict access at the object or property level, or when APIs lack field-level data protection. A single misconfigured API endpoint can expose thousands of records containing PII, payment data, or health information.
The OWASP API Security Top 10 is a list published by the Open Web Application Security Project that identifies the ten most critical API security risks. The current version (2023) includes broken object-level authorization, broken authentication, unrestricted resource consumption, and server-side request forgery, among others.
Organizations should authenticate every API call, enforce least-privilege field-level access, and apply data-level protection to API responses. Tokenization replaces sensitive values with non-reversible substitutes before the response reaches the consumer. Dynamic data masking controls field visibility based on user attributes. These controls ensure that even if an API is compromised, the exposed data contains no exploitable information.