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

Source: https://botpassword.com/keys/atlassian
Last checked: 2026-10-25

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.

## Key types

| Type | Prefix | Secret | Scope | Expiry |
|---|---|---|---|---|
| Scoped API token | — | Yes | Limited to chosen Jira or Confluence scopes | 1 to 365 days after creation; default one year |
| Unscoped API token | — | 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

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.

## 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.

## 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 the 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.

## Gotchas

- 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 this key with AI agents (BotPassword)

- `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.

## FAQ

### 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.

## Sources

- https://support.atlassian.com/atlassian-account/docs/manage-api-tokens-for-your-atlassian-account/
- https://support.atlassian.com/atlassian-rovo-mcp-server/docs/getting-started-with-the-atlassian-remote-mcp-server/
