Atomic Mail
Products
↓
Atomic VPN
Private VPN service
Atomic Mail
Secure encrypted email
Atomic Bot
One-click AI agent runner
Atomic Chat
Local & open-source AI super chat
Atomic Wallet
Secure, anonymous crypto wallet
Sigma Browser
Private AI browser
Atomic Agent
Local-first AI agent
How it worksUse casesCompareFAQBlog
Docs
Login
Blog
/
What Is an API? Meaning, How It Works and Examples

What Is an API? Meaning, How It Works and Examples

Guides
9 min read
Mary Atomic
CMO
September 21, 2026
What Is an API? Meaning, How It Works and Examples
Share this post
Copied!

An API (Application Programming Interface) is a defined set of rules that lets one piece of software ask another to do something – fetch data, send a message, run a calculation – without needing to know how that other software works internally. "Application" is the program making the request, "Interface" is the point of contact between two systems, and "Programming" just means this contact happens in code rather than through a screen a human clicks on.

TL;DR
  • An API lets one program ask another to do something, following fixed rules for the request and the response – the requester never needs to see the code behind it.
  • The core loop is always client → request → server → response, whether that's a weather app, a payment form, or an AI agent calling a tool.
  • The main styles are REST (the most common), GraphQL (flexible queries), SOAP (older, strict, common in enterprise/banking), and WebSocket (for live, two-way data).
  • Most APIs need authentication – an API key or a token – so the server knows who's asking and what they're allowed to do.
  • APIs come in three access levels: public (anyone can use them), private (internal only), and partner (shared with select outside companies).

A Quick Analogy

A restaurant menu doesn't show you the kitchen – you pick an item, the kitchen does the work, a waiter brings back a plate in a predictable form. The API is the menu plus the waiter; the kitchen (the actual code, database, or server behind it) stays hidden and can change without you needing to learn anything new.

How an API Actually Works

Every API call follows the same basic cycle, no matter what it's for:

  1. The client sends a request. This is the app or script asking for something – it specifies what it wants and, often, what data it's sending along.
  2. The request hits an endpoint. An endpoint is a specific URL that represents one action or one piece of data – /users/42 might fetch one user, /orders might list all orders. Each endpoint typically supports one or more HTTP methods: GET to read data, POST to create something, PUT/PATCH to update it, DELETE to remove it.
  3. The server processes it. Behind the endpoint, the server runs whatever logic the request triggers – querying a database, running a calculation, checking a payment.
  4. The server sends a response. This usually comes back as JSON (occasionally XML), along with a status code that summarizes what happened – 200 for success, 404 for "not found," 401 for "you're not authenticated," 500 for a server-side error.

A request to fetch a single order might look like this:

terminal
curl -X GET https://api.example.com/v1/orders/4471 \
  -H "Authorization: Bearer YOUR_API_KEY"

And the response:

json
{
  "id": 4471,
  "status": "shipped",
  "total": 58.00,
  "customer_email": "alex@example.com"
}

No mention anywhere of what database this came from or what server it ran on – that's the entire point.

Types of APIs

Not every API works the same way under the hood. The style matters for what kind of app it fits best:

Type How it works Best for
REST Standard HTTP methods (GET, POST, PUT, DELETE) on resource URLs, usually returning JSON The default choice for most web and mobile APIs – simple, cacheable, widely supported
GraphQL The client specifies exactly which fields it wants in one query, instead of hitting several fixed endpoints Apps that need flexible, nested data without over-fetching or under-fetching
SOAP XML-based messaging with a strict, formally defined contract (WSDL) Enterprise systems, banking, and legacy integrations where formal contracts and built-in error handling matter more than simplicity
WebSocket A persistent, two-way connection instead of one request per action Live data: chat apps, stock tickers, multiplayer games, real-time dashboards

Most APIs you'll encounter day to day – payment processors, mapping services, weather data – are REST APIs, which is why "REST API" and "API" get used almost interchangeably in casual conversation.

Public, Private, and Partner APIs

APIs also differ by who's allowed to use them:

  • Public (open) APIs are available to any developer, often with a free tier and published documentation – Google Maps and OpenWeatherMap are examples.
  • Private (internal) APIs are built for a company's own teams to connect their own services together, and are never exposed outside the organization.
  • Partner APIs sit in between: shared with specific outside companies under a business agreement, with access controlled more tightly than a public API but more broadly than an internal one.

Authentication: API Keys and Tokens

Most APIs need to know who's calling before they'll do anything. The two most common mechanisms:

  • API keys are a single, long string a developer includes in each request (often in a header, as in the curl example above). Simple to implement, but a leaked key is fully compromised until it's rotated.
  • Tokens (commonly OAuth 2.0 access tokens or JWTs) are usually short-lived and scoped to specific permissions – a token might allow reading data but not deleting it, and it expires on its own even if it leaks.

As a rule of thumb: an API key is fine for a personal project or a low-stakes integration; a token-based flow is the standard for anything handling user data or requiring fine-grained permissions.

Where APIs Show Up

The same request-response pattern powers very different products:

  • Maps and geocoding. Google Maps' API turns "123 Main St" into coordinates and turn-by-turn directions – the calling app never has to know how the routing engine or the satellite data works.
  • Payments. Stripe's API processes a card charge without the calling app touching a bank directly or storing card numbers itself – the regulated, hard part stays entirely on Stripe's side.
  • Weather. A forecast API returns a prediction for a location; the app has no idea whether that came from a satellite model or a ground-station network.
  • Streaming and social apps. Spotify and Twitter/X both expose public APIs so third-party apps can pull playlists, post updates, or read public data without scraping a website.

How to Start Using an API

Getting from zero to a working call usually takes four steps:

  1. Read the documentation. Every API worth using publishes docs describing its endpoints, required parameters, and response format.
  2. Get credentials. Sign up for an API key or register an app to get OAuth credentials – most providers have a free or trial tier for this.
  3. Make a test call. Use a tool like curl, Postman, or a simple script to hit one endpoint and confirm you get the response you expect.
  4. Handle errors and rate limits. Real usage means planning for a 429 (too many requests) or a 500 (server error) response, not just the happy path.

APIs and AI Agents

An AI agent doesn't click buttons or open apps – every action it takes happens through an API call. This is what "tool use" actually is under the hood: the model decides what to do, and an API executes it. A weather agent calls a weather API; a scheduling agent calls a calendar API; a support agent that reads and replies to email calls an email API built to handle inbound as well as outbound mail, since a plain transactional send-only API isn't built for a two-way conversation.

Atomic Mail Agentic is one such API, purpose-built to give an AI agent its own inbox rather than just an outbound send endpoint.

Give your agent a real inbox
Free while in open alpha.
Get started →

FAQ

What's the difference between an API and an SDK? An API is the interface itself (the rules for requests and responses); an SDK is a code library that wraps those requests in functions for a specific programming language, so you don't write raw HTTP calls by hand.

Do all APIs use JSON? Most modern web APIs do, though some (especially older or enterprise systems using SOAP) use XML, and a few specialized protocols use their own binary formats.

What does "REST API" mean? REST is a common architectural style for designing APIs around standard HTTP methods (GET, POST, PUT, DELETE) and predictable URLs – most APIs you'll encounter are REST APIs.

What is an API, with an example? An API is a set of rules letting two programs talk to each other – for example, a weather app calling a weather service's API, sending a city name and getting back a JSON response with the temperature and forecast.

Is ChatGPT an API? ChatGPT itself is a consumer product, but OpenAI also offers a separate API (the same underlying models) that developers can call directly from their own applications – so "ChatGPT" the chat app and "the OpenAI API" are related but distinct things.

Is Netflix an API? No, Netflix is a streaming service, not an API – though Netflix does use APIs internally to connect its own apps and devices to its servers, and historically offered a limited public API for affiliates before shutting it down to the general public.

Is API a coding language? No – an API isn't a programming language at all. It's an interface: a set of rules for how two pieces of software communicate, and it can be built using any programming language on either end.

‍

Posts you might have missed

Best MCP Servers in 2026
Comparisons
10 min read

Best MCP Servers in 2026

Most lists are somebody's taste. This one ranks 20 MCP servers by measured search demand – and says how many you should actually run.
Read more
Best Email APIs 2026
Comparisons
13 min read

Best Email APIs 2026

Every email API sends well. Almost none let your agent receive. Here's what breaks, and how the free tiers actually compare in August 2026.
Read more
Build an AI Email Agent With Its Own Inbox in 30 Seconds (No Gmail, No OAuth, No Domain)
Guides
8 min read

Build an AI Email Agent With Its Own Inbox in 30 Seconds (No Gmail, No OAuth, No Domain)

Give an autonomous AI agent its own email inbox in about 30 seconds — no Gmail, no OAuth, no domain. A runnable guide: register, send, receive, and reply over JMAP.
Read more
Go through all posts

Product

How it worksUse casesCompareFAQDocumentationBlogEmail for humans

Compare to

AgentMailResendSendGridOpenMailHostingerNylas

Policies

Terms of UsePrivacy Policy
support@atomicmail.ai
Atomic Mail Agentic - Let your agents read, send, and react to email autonomously | Product Hunt

ATOMICMAIL SYSTEMS OÜ.
HARJU MAAKOND, TALLINN, KESKLINNA LINNAOSA, HARJU TN 3 // VANA-POSTI TN 2, 10146

© 2026 ATOMIC MAIL