A defined way for software to interact
An application programming interface, or API, describes how one piece of software can use another. The interface names permitted operations, the information they accept, and the responses callers can expect. An API can exist inside a program or across a network; it is not automatically a public internet service.
For an HTTP API, a specification can describe paths, operations, parameters, and response structures. The OpenAPI Initiative explains how OpenAPI provides a language-independent description using JSON or YAML. Such a description helps different teams agree on a contract, even if their implementations use different programming languages.
An inventory example
Imagine a shop application asking an inventory service how many units of an item are available. The request supplies a product identifier and warehouse identifier. The response might include an available quantity and the time the inventory was observed. The caller does not need to know how the service stores stock records.
The contract still needs precise meaning. Does “available” exclude reserved items? Is the count exact at the moment of the request or a recent snapshot? What happens when the warehouse identifier is unknown? Two services returning the same-shaped JSON object can mean different things if these questions are unanswered.
Now consider reserving two units. Reading a quantity and changing a reservation are different operations. A user might double-click, or the application might retry after a connection fails. The design must determine whether repeating the request creates a second reservation or safely returns the original result. This is a behavioral promise, not merely a field-format question.
The protocol carries meaning too
HTTP defines method and status semantics. The HTTP Semantics standard distinguishes properties such as safe and idempotent methods. Safe methods are intended to be read-only in their defined semantics; idempotence concerns the intended effect of repeating a request. Those properties help callers reason about caching and retries, but they must be supported by the application design.
For example, a network timeout does not reveal whether a server completed a reservation before the response was lost. A caller cannot resolve that uncertainty simply by choosing a more optimistic message. It needs a documented way to identify the request, inspect its outcome, or retry safely under the service’s rules.
Validation is not authorization
A product identifier can be well formed while referring to an item the requester is not allowed to access. Input validation checks structure and permitted values. Authorization checks whether this caller can perform this operation on this resource. Authentication, when required, establishes the caller’s identity or session. A useful API design addresses these separately.
Bound resource use as well. An operation that accepts an arbitrary list of product identifiers needs limits on list length and response size. Otherwise an ordinary-looking query can create unbounded work. Errors should give callers enough information to recover without exposing private implementation details.
Interfaces evolve over time
Changing a response field from a number to a string can break a client. Removing an operation can break an integration even when the replacement is more capable. A maintenance plan defines which changes preserve compatibility, how versions are identified, and how callers learn that behavior will change.
Good APIs reduce the amount callers must know about internal implementation while making external behavior explicit. For a software buyer, that means evaluating documentation, failure behavior, access boundaries, and compatibility alongside the advertised function. For an engineer, it means testing the contract from the caller’s perspective, including invalid input and interrupted requests. Continue with observability to understand how teams inspect these interactions when a service slows down or fails.