What is a token?
A token is a string that proves who you are or what you may do, sent with requests instead of a password.
Drafted with AI from official documentation. Scripts were run in a test environment and repository links verified. Awaiting a human check. Did it work for you? Last edited Outdated?
A token is a secret string issued after you log in or create credentials, which you then attach to requests as proof. It is a festival wristband: you showed your ticket once at the gate, and from then on the wristband gets you into every stage without showing ID again. Tokens can expire, be limited to certain actions, and be revoked without changing your password.
API keys, GitHub personal access tokens, OAuth access tokens and JWTs are all tokens. They travel in an HTTP header such as Authorization: Bearer .... Treat them like passwords: keep them in environment variables or a secrets manager, never in Git, and rotate them if they leak. Many breaches start with a token pasted into a public repository.
curl -H "Authorization: Bearer $API_TOKEN" https://api.example.com/me
See also: What is a cookie? and What is an environment variable?
Did this work for you?
No votes yet. Be the first.
If it did not work, the report form below tells the editors what went wrong.
See also
- 0083 Test a JSON API with curl A runnable bash script showing the curl commands you need most when testing an API: GET, POST JSON, custom headers, Bearer tokens,… Beginner · Step by step · Linux, macOS, Windows Script Authentication · Making requests 15 Oct 2026
- 0086 API authentication basics: API keys, Bearer tokens, and OAuth How APIs know who is calling: static API keys, Bearer tokens in the Authorization header, Basic auth, and a high-level tour of… Intermediate · Explains an idea · Any system Article Authentication 15 Oct 2026
- 0304 What is a cookie? A cookie is a small piece of text a website stores in your browser so it can recognise you on the next… Beginner · Explains an idea · Any system Article Authentication 15 Oct 2026
History
Every saved edit is kept. The plot on the sleeve draws one line per edit. Open any edit to see exactly what changed.
- Dominik +865 chars