# Access Token

> A string an app sends with each request to prove it may use an API.

**Field:** Software Development  
**Category:** Auth  
**Also known as:** Auth Token, Token

## Think of it like

Think of it like a pool wristband. It lets you in for one hour.

## Definition

An access token is a string an app sends with each request to prove it may use an API. You get it after logging in, and it stands in for your password from then on. Most access tokens expire quickly, often within an hour. The server checks the token on every request before it answers. Anyone who holds a valid token can use it, so it must be kept secret.

## Example

Lucy's phone app logs her in and gets an access token. For the next hour, every request carries that token instead of her password.

## Example code

```http
GET /api/orders HTTP/1.1
Authorization: Bearer eyJhbGciOiJIUzI1NiJ9...
```

The token rides in a header, after the word Bearer.

## Why it matters

Apps never have to store or resend your password. A short-lived token limits the harm if it leaks.

## Common mistake

Saving access tokens where page scripts can read them, like localStorage. One XSS bug then hands them over.

## Three principles

- **Proof on each request.** Instead of a password.
- **Short-lived.** Often an hour.
- **Keep it secret.** Holding it is enough.

## Related terms

- [Refresh Token](https://learn.benibix.com/term/development/refresh-token)
- [Bearer Token](https://learn.benibix.com/term/development/bearer-token)
- [JSON Web Token (JWT)](https://learn.benibix.com/term/development/json-web-token)
- [OAuth 2.0](https://learn.benibix.com/term/development/oauth)

## Told apart from

- [Access Token vs Refresh Token](https://learn.benibix.com/compare/access-token-vs-refresh-token): An access token is the short-lived pass you show on each request, and a refresh token is how you get a new one. The access token often lasts minutes, so a stolen one is soon useless. The refresh token lasts days or weeks. It goes only to the login server, and it must be kept far safer.
- [API Key vs Access Token](https://learn.benibix.com/compare/api-key-vs-access-token): People think an API key and an access token are the same thing, and they are not. An API key names your app, and it lasts until someone turns it off. An access token is short-lived, and it often acts for one user who logged in. Both go in a header, and both must stay secret.

## Taught in

- [Claude Code Login Commands](https://learn.benibix.com/learn/ai-claude-code-commands/claude-code-login-commands): Claude Code Commands, 3/17

---

Source: https://learn.benibix.com/term/development/access-token
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
