The full set of ways a Next.js app exposes and calls server-side endpoints.
'APIs' covers more ground in a Next.js app than it first appears. Route Handlers (route.ts) are the direct equivalent of a traditional REST endpoint. Server Actions let a component call a server-side function without any manually defined endpoint at all. External third-party APIs, meanwhile, can be called directly from Server Components — with no client-exposed endpoint needed — or through a Route Handler acting as a proxy when the client genuinely needs to trigger the call itself.
The practical decision is choosing the right mechanism for a given need: a public API meant to be consumed by other clients — a mobile app, a third party — needs a real Route Handler with a stable, versioned contract. Internal mutations triggered only by your own UI are usually a better fit for a Server Action, since it skips the boilerplate of defining, calling, and typing a separate endpoint that nothing outside your own app will ever use.
What you'll walk away knowing
No questions match "".