Atlassian Cloud API tokens for Jira and Confluence are created at id.atlassian.com/manage-profile/security/api-tokens. They expire between 1 and 365 days after creation (default one year). Authenticate with HTTP basic auth using your account email as the username and the token as the password, and prefer scoped tokens over unscoped ones.
Atlassian (Jira and Confluence) key types
| Type | Prefix | Secret? | Scope | Expiry |
|---|---|---|---|---|
| Scoped API token Must be sent to api.atlassian.com/ex/... URLs that include your cloud ID. | — | Yes | Limited to chosen Jira or Confluence scopes | 1 to 365 days after creation; default one year |
| Unscoped API token Token length varies, so scripts should not assume a fixed length. | — | Yes | Broader access for apps that do not yet support scoped tokens | 1 to 365 days after creation; default one year |
How to create a Atlassian (Jira and Confluence) key
- Go to
id.atlassian.com/manage-profile/security/api-tokens. - Select Create API token (or Create API token with scopes for a scoped token).
- Name the token and choose an expiration date.
- Select Create and copy the token; it cannot be recovered afterwards.
Open Atlassian (Jira and Confluence)'s key settings
Limiting what the key can do
Scoped tokens limit what the token can do in Jira and Confluence and are recommended as more secure. Use unscoped tokens only for apps that do not support scoped tokens yet. Requests with a scoped token go to api.atlassian.com/ex/... URLs containing your cloud ID.
How to rotate a Atlassian (Jira and Confluence) key
- Create a new API token with the same scopes.
- Update the systems that use the old token.
- Revoke the old token on the API tokens page.
Tokens created before December 15, 2024 were set to expire in one year, between March 14 and May 12, 2026.
How to revoke a Atlassian (Jira and Confluence) key
- Open the API tokens page and select Revoke next to the token, or Revoke all API tokens.
- You may need to verify your identity first. Revoked tokens stop working and are permanently removed.
If your Atlassian (Jira and Confluence) key leaked
- Revoke the token on the API tokens page.
- Create a replacement scoped as narrowly as possible with a short expiry.
- Review recent Jira and Confluence activity for the account.
Things that catch people out
- Users with two-step verification must use an API token for REST calls; the account password will not work.
- The username for basic auth is the Atlassian account email, not a username handle.
- The same Atlassian account page issues Bitbucket tokens, so check the app and scopes you selected.
- The Rovo MCP server at
https://mcp.atlassian.com/v2/mcpuses OAuth 2.1 by default; API token authentication is an optional alternative.
Using your Atlassian (Jira and Confluence) key with AI agents
A coding agent that can read your .env file or your shell history can read the key, and anything in its context can end up in logs, transcripts or a prompt-injected request. The safer pattern is to keep the key in a credential broker that performs the authenticated step for the agent and hands back only the result.
BotPassword works this way. For a Atlassian (Jira and Confluence) key, these intents fit:
| Intent | What BotPassword does |
|---|---|
list_credentials | Lists the credentials this agent is granted and what it may do with each. Never values. |
request_access | Asks you for a grant, which you approve with your master password or decline in BotPassword on your desktop, never in the chat. The agent gets a receipt, never a value. Approval on your phone is planned. |
run_with | Runs a command with the key injected as an environment variable or a 0600 temporary file, never on the command line, and redacts the key from the output. |
http_request | Makes an authenticated API call after checking the destination against the hosts this key may be sent to. The response comes back with credential-shaped values redacted, and one that holds the key itself is refused. |
rotate | Partly built: creates a new key, stores it as pending, verifies it, promotes it, then revokes the old key after a grace period. Today it works for Cloudflare tokens and AWS IAM keys you have set up, and an agent can start it only under a grant with autopilot; other providers cannot be rotated through their API yet. |
capture_secret | Planned, not built yet: will read a newly created key straight from the page or command output into the vault. |
store_secret | Saves a value the agent already holds as a new vault item. |
Atlassian (Jira and Confluence) also publishes its own MCP server. Whatever server the agent uses, keep the credential it authenticates with out of the agent's context.
Set it up in your agent: Aider · Amp · Claude Code · Claude Desktop · Cline · OpenAI Codex CLI · all agents
Frequently asked questions
Where do I create an Atlassian API token?
At id.atlassian.com/manage-profile/security/api-tokens, select Create API token, name it and choose an expiration.
How long does an Atlassian API token last?
1 to 365 days after creation; new tokens default to one year.
How do I use an Atlassian API token with curl?
Use HTTP basic authentication with your account email as the username and the token in place of a password.
Can I recover an Atlassian API token I lost?
No. Create a new one and revoke the old one.
Can an AI agent use my Atlassian (Jira and Confluence) key without seeing it?
Yes, if the key never enters the agent's context. Instead of pasting the key into a chat or leaving it in a .env file the agent can read, keep it in a credential broker that injects it into the command or request on the agent's behalf. BotPassword does this with list_credentials, run_with, http_request, so the agent gets the result and never the value.