Access control
The foundation of API security is access control, which comprises two elements—authentication verifies who accesses an API, and authorization determines what they may do.
Beware of mixing up authentication and authorization concepts
Although the two concepts are closely related and used in conjunction to provide secure and granular access to an API, they are distinctly different. Authentication is about establishing the identity of a user or client and whether they are who they say they are, usually by means of a set of credentials. Authorization determines what access to resources a user or client is permitted based on who they are (established via authentication).
No authentication
Public APIs intended for read-only access may not require authentication if they are intended for anonymous (unauthenticated) access. Typically, these endpoints are used for information or status, for example, a status API for an online service.