What an API promises to another program
An API defines how one piece of software can request capabilities or data from another. It specifies operations, inputs and expected responses, allowing callers to use a service without knowing all its internal code. Following the interface does not automatically grant permission to access everything behind it.
Go deeper
A defined interface between software components
An application programming interface describes an allowed way to interact with a software component. It may expose functions inside a program or requests to a remote service.
For example, a booking API might define how to request available rooms for a date. The caller provides the required fields and receives a response in an agreed structure.
The interface separates use from implementation. The service can change internal details while preserving the contract expected by its callers.
- Operations describe what can be requested.
- Inputs define what the caller must supply.
- Responses describe successful results and errors.
Authentication and authorisation are separate concerns. Knowing how to format a request does not mean the requester is entitled to the data. An API can enforce different permissions for different callers.