Token (API)
A credential string used to authenticate API requests. Tokens are either long-lived (API keys) or short-lived (OAuth access tokens). Short-lived tokens require automated refresh logic to prevent authentication failures in long-running workflows.
Expert insight
API tokens that never expire are convenient and dangerous in equal measure, if one leaks (committed to a public repo, pasted into a chat), it's valid until manually revoked. Where a service supports short-lived tokens with refresh flows, using them limits the blast radius of an eventual leak.
In a real workflow
An API token stored as a credential authenticates requests to the accounting system.
Common mistakes
- Sharing one token between many workflows and people.
- Not rotating tokens after staff changes.
Complexity level
Requires some familiarity with automation concepts.
Related terms
API Key
A secret token that authenticates your automation with a third-party service. Tr…
OAuth (Open Authorisation)
An authentication standard that lets users grant third-party apps access to thei…
JWT (JSON Web Token)
A compact, self-contained authentication token used by many APIs. JWTs expire an…
See it in action
Want Token (API) built into your automation?
Book a free audit and we'll show you exactly how this applies to your business.
Get my free automation plan →Who we build for
Run a firm, an agency or an online store? We automate the work behind it.
Done-for-you n8n workflows and Claude AI agents, fixed price, maintained for you.
- Professional firms Onboarding, documents, billing and reporting run on their own. See what we automate →
- Agencies and SaaS teams Custom n8n and Claude builds, client reporting and internal tools. See what we automate →
- E-commerce brands Orders, support, returns and stock handled without the busywork. See what we automate →
More in Security
Keep exploring
Webhook security
Verifying that incoming webhooks are genuinely from the expected sourc…
Access token
A short-lived credential issued after OAuth authentication that grants…
Audit trail
A chronological record of all actions taken by an automation who trigg…
Client credentials flow
An OAuth flow where a server-side application authenticates directly u…
Data residency
Where data is physically stored and processed. Regulated industries (f…
Data sovereignty
The principle that data is subject to the laws of the country where it…
Go deeper
Guides that cover Token
$env and Credentials in the n8n Code Node: What Works and What Doesn't
The n8n Code node can read environment variables and custom variables, but never stored credentials. What to use instead, and how to fix "access to env vars denied".
n8n Respond to Webhook: Return JSON, Status Codes, Redirects and Files
Turn an n8n webhook into a real API endpoint: when to respond immediately, after the last node or with the Respond to Webhook node, plus status codes, headers, files and the multi-item trap.
Secure an n8n Webhook: Header Auth, Basic Auth, JWT and HMAC Signatures
An n8n webhook URL with no authentication accepts requests from anyone who finds it. Five layers of protection, from a header secret to HMAC signature checks, and which to use for each sender.