Developer tools

Atlassian (Jira and Confluence) API tokens: find, store, rotate, and use them safely with AI agents

Last checked 2026-10-25 against Atlassian (Jira and Confluence)'s documentation

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

TypePrefixSecret?ScopeExpiry
Scoped API token
Must be sent to api.atlassian.com/ex/... URLs that include your cloud ID.
—YesLimited to chosen Jira or Confluence scopes1 to 365 days after creation; default one year
Unscoped API token
Token length varies, so scripts should not assume a fixed length.
—YesBroader access for apps that do not yet support scoped tokens1 to 365 days after creation; default one year

How to create a Atlassian (Jira and Confluence) key

  1. Go to id.atlassian.com/manage-profile/security/api-tokens.
  2. Select Create API token (or Create API token with scopes for a scoped token).
  3. Name the token and choose an expiration date.
  4. 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

  1. Create a new API token with the same scopes.
  2. Update the systems that use the old token.
  3. 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

  1. Open the API tokens page and select Revoke next to the token, or Revoke all API tokens.
  2. You may need to verify your identity first. Revoked tokens stop working and are permanently removed.

If your Atlassian (Jira and Confluence) key leaked

  1. Revoke the token on the API tokens page.
  2. Create a replacement scoped as narrowly as possible with a short expiry.
  3. 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/mcp uses 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:

IntentWhat BotPassword does
list_credentialsLists the credentials this agent is granted and what it may do with each. Never values.
request_accessAsks 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_withRuns 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_requestMakes 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.
rotatePartly 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_secretPlanned, not built yet: will read a newly created key straight from the page or command output into the vault.
store_secretSaves 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.

Stop pasting Atlassian (Jira and Confluence) keys into agents

BotPassword is in early access. Request an invite and we'll email you when your spot opens.