← Integration Engineering
Integration Engineering

Five Ways an API Asks “Who Are You?”

30 Sept 2026·3 min read

The first page of any API doc says something like "Auth: Basic" or "Bearer" or "OAuth 2.0". They are not the same thing. Mixing them up is a common reason a first request fails with 401, "I do not know who you are".

The five, in plain words

  • None: public data, no login. There is often a small limit on calls.
  • API key: one long secret string. Whoever copies it can use it until you delete it.
  • Basic: username and password in the Authorization header. Only safe over HTTPS, and many providers are moving away from it.
  • Bearer token: sent in the Authorization header. Whoever holds it can use it, like cash, so keep it secret. It usually expires, so a leaked one stops working on its own.
  • OAuth: in the usual flow, the user logs in on the real site and approves. Your app gets a token, never the password.

Basic is not encryption

Basic turns "user:password" into Base64. Base64 is only a way to write text with safe characters, and anyone can turn it back in one command. RFC 7617 itself says Basic is not secure on its own and needs HTTPS. Atlassian’s cloud APIs, for example, no longer take an account password here and ask for an API token instead.

echo 'QWxhZGRpbjpvcGVuIHNlc2FtZQ==' | base64 -d
The example header value from RFC 7617. I ran it in Git Bash and it printed Aladdin:open sesame.
The common mix-up"Bearer" and "OAuth" are not rivals. OAuth is how you got the token. Bearer is how you send it: "Authorization: Bearer <token>". Some APIs also use certificates or signed requests instead.
Do this in 60 secondsOpen the auth page of one API you use. Write in one line which of the five it is and which header it goes in. If it says Basic, check that every call uses https://.
Today’s AI angleA long-lived key in an agent’s config works for anything, forever. A short-lived OAuth token with narrow scopes limits what the agent can touch. Keep the secret in the tool layer, not in the prompt.
Five Ways an API Asks “Who Are You?” · Ali Huzaifa