After understanding Service Accounts , we need to set them up. Thanks again to @Darryl Lee for the review and contribution!
Before we go crazy with the account creation though, there are a few things that we should consider.
For one, Account creation and setup needs Organization Administration privileges. As a regular user, you will need help. However, you can come prepared if you are aware of all the info your Org Admin will need for you. Jump straight ahead to the step-by-step guide and come back for part 3. That one’s for you.
Secondly, Atlassian is not making it very easy to keep track of all Accounts, Tokens, Owners etc. That’s why we need some…
…Best Practices for Administration & Governance
Service accounts often end up with a lot of power and very long lives. There is a team or person that requested the account and therefore a use case. If we create accounts with documentation of that, we will not remember in a few years when an audit is coming up and we need to account for everything happening on our sites.
Documentation of Service Account
For every service account, track at least:
- Owner (named person or team)
- Purpose / systems using it
- Tokens & Expiration date (you can check the Scope in the UI later on)
Tokens and their expiration dates as well as scopes actually do not need to be documented separately anymore as there is a new API available for this. Check out Part 4 for more details.
You can use the description field in the Service Account. This information is returned by the API Access API so you can run automatic checks and find the owner for each Account, as long as you follow the same format each time.
You could also set up something a little more sophisticated if that suits your governance needs better. For example, if you are tracking Confluence & Jira spaces per Team already in Assets, it makes sense to add Service Accounts there also.
Rotation and expiry
- Plan for token expiration - any token is valid for 365 days max; Set expiration dates on a set date every month so tokens don't run out at random points in time
- Set calendar reminders, automation, or monitoring for upcoming expiry
- When rotating:
- Create a new token and share with Account owner
- (Remind owners to) update all scripts/integrations
- Revoke the old token
Check out Part 4 of this series for more details on token renewal
Create with least privilege
- Minimal App access
- Minimal scopes
- Minimal permissions
Only widen when there is a justified need. Beware that Service Accounts will be added to Default App Access groups just like any regular user. You might want to manage App Access via separate groups that have limited Global Permissions or Space permissions.
Consider Self Service Options
If your company is in need of a lot of Service Accounts, you as an Org Admin may get very busy with Account and Token creation. Depending on the expiration date, new Tokens need to be created at least every year.
Consider things like
- A request form for new Accounts
- A request form for App access change
- A request form for new Tokens
- A system triggered request that prompts the Account owner to approve token renewal (if there is no response, tokens run out and the Account may be ready for deletion)
Right. Let’s jump into the actual guide.
Setting up a service account - a step-by-step guide
Step 1: Design the use case first
Before creating or requesting anything, write down:
-
What will this integration do?
- “Read issues from Project A and update a few custom fields.”
- “Create Confluence pages in Space X with release notes.”
- Which products and areas are involved?
- Jira? Confluence? Which projects/spaces?
- What’s the minimum it needs to do?
- Read only vs read + write vs delete?
- Does it really need admin‑level powers?
Then map that into scopes using the REST API docs:
💡
Make sure that a Service Account is actually what you need. Some Use Cases may be better covered by Personal API Access Tokens, Filter Subscriptions, Out-of-the-Box Features, Marketplace Apps… Check out Part 1 of this series.
💡
Step 2: Create the service account (Org Admin only)
- Go to admin.atlassian.com and select your organization.
- Open Directory → Service accounts.
- Create a new service account:
- Give it a clear, purpose‑driven name, like:
jira-ci-cd-bot
confluence-reporting-bot
- Optionally add a description including a human owner/contact.
- Give it App access (Jira, Confluence, Goals, … ) in the correct role (User, Customer, App Admin…)
- Optionally add it to groups
Details to this flow can change over time, so always check Atlassian’s docs: https://support.atlassian.com/user-management/docs/understand-service-accounts/
💡
You may want to manage App Access for Service Accounts via special groups so they are not added to any Default Access groups automatically. Default Groups may be used for Global or Space Level Permissions.
If so:
- Create Groups that grant access to specific App roles
e.g. “service-account-jira-user” > Grants access to Jira in the Role “User”
- Add the Groups to App Access (see https://support.atlassian.com/user-management/docs/give-users-access-to-products/ )
- Make sure these Groups have the correct Global App Permissions in each App
- Add Service Accounts to the respective groups
💡
Step 3: Create a credential for the service account (Org Admin only)
See https://support.atlassian.com/user-management/docs/manage-api-tokens-for-service-accounts/ for reference.
Once the service account exists:
- Go to admin.atlassian.com and select your organization.
- Go to Directory → Service accounts.
- Choose the service account → Actions → Create credentials.
- Configure:
- Authentication type: API token or OAuth2
- App & Scope: pick only what this integration needs (read / write / delete)
- Expiration: 1–365 days, aligned with your rotation policy
- Review and document the scope before creating it.
- Copy it and store/share it securely (password manager, secret manager, etc.)
💡
Atlassian recommends to use classic scopes. Some granular scopes are not part of any classic scope so they need to be granted specifically, if the endpoint requires them.
Best practise for scope: start with least privilege and create other access tokens when your integration proves it needs more.
Atlassian doesn’t store the raw token; if you lose it, you need to create a new one.
Also: You cannot view or edit the token scope after creation. Documentation is key for later troubleshooting.
💡
Step 4: Give it permissions in Jira and Confluence (Space Admin)
Now that the Service Account is created, you need to give it access on App level. Add it to your Confluence or Jira Space, your Compass team or wherever else it needs access to. This step can be completed by the respective Space Admins.
You can find and add Service Account like any other regular User and simply search for their name.
https://support.atlassian.com/confluence-cloud/docs/assign-space-permissions/
https://support.atlassian.com/jira-software-cloud/docs/add-users-to-space-roles-in-your-space/
Bonus Step: Update the Avatar
The wonderful @Darryl Lee commented this on part 1, but I thought it's worth mentioning it here. You can update the Service Account's avatar via an undocumented API.
Well, it's sort of documented in this JAC: https://jira.atlassian.com/browse/AX-278
Example:
<span data-testid="renderer-code-block-line-1" data-ds--code--row="">curl 'https://admin.atlassian.com/gateway/api/users/SERVICE_ACCOUNT_ID/manage/avatar' \
</span><span data-testid="renderer-code-block-line-2" data-ds--code--row=""> -X 'PUT' \
</span><span data-testid="renderer-code-block-line-3" data-ds--code--row=""> -H 'Authorization: Bearer OrgAdminToken' \<br> -F file=@botavatar.png</span>
💡
You'll find the Service Account ID in the url when you're viewing the Service Account:
https://admin.atlassian.com/o/{org-id}/service-accounts/SERVICE_ACCOUNT_ID
Note that you need an Organisation Admin Token.
💡
That's the Service Account all set. But how do we actually use it?
Up next:
Part 3: Atlassian Service Accounts in Practice
And in case you missed it. Part 1: What are they (for)
And check out Part 4: Token renewal