You can use an API token to authenticate a script or other process with an Atlassian Cloud application. You generate the token from your Atlassian account, then copy and paste it to the script.
If you use two-step verification to authenticate with your Atlassian Cloud site, then your script will need to use a REST API token to authenticate.
API tokens can be used with the Jira Cloud and Confluence Cloud REST APIs.
Create an API token
Create an API token from your Atlassian account:
- Log in to https://id.atlassian.com.
- Click API tokens, then Create API token.
- Use Copy to clipboard, and paste the token to your script, or elsewhere:
- For security reasons it isn't possible to view the token after closing the creation dialog; if necessary, create a new token.
- You should store the token securely, just as for any password.
Use an API token
A primary use case for API tokens is to allow scripts to access REST APIs for Atlassian Cloud applications using HTTP basic authentication.
Depending on the details of the HTTP library you use, simply replace your password with the token. For example, when using curl, you could do something like this:
curl -v https://mysite.atlassian.net --user firstname.lastname@example.org:my-api-token
email@example.com here is the email address for the Atlassian account you're using to create the token.