Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Using Jira Software API with service account

Jakob
April 20, 2026

We used to fetch some sprint details (e.g., Name and EndDate) using a personal token and then URL https://OURSITE.atlassian.net/rest/agile/1.0/board/1/sprint.

As this token is expired, I wanted to switch to a service account. I learned that this requires a different URL scheme, https://api.atlassian.com/ex/jira/CLOUD_ID/API_ENDPOINT. This works fine vor v2/3 stuff (like rest/api/3/project or even rest/api/3/issue/PRJ-1234), but as far as I can see, v2/3 offers no access to Jira Software specific data, so I have to stick with the 1.0 API. But is this possible?? The obvious variant, i.e. using rest/agile/1.0/board/1/sprint, just returns a "401: Unauthorized; scope does not match", but I guess that's just because the URL is wrong (it returns for the same for rest/api/agile/1.0/issue/PRJ-1234, which works using v2/3 api).

So, am I missing something or is really not possible to get sprint details using the service account API??

2 answers

1 accepted

0 votes
Answer accepted
Sebastian Krzewiński
Community Champion
April 20, 2026

Hi @Jakob 

 

Can you tell what error did you get? Service account should be able to use API v1.

 

Regards,

Seba

Jakob
April 20, 2026

Hi @Sebastian Krzewiński,

when requesting

https://api.atlassian.com/ex/jira/%CLOUD_ID%/rest/api/agile/1.0/issue/%ISSUE%

the http error is a simple

HTTP/1.1 401 Unauthorized

with the output 

{"code":401,"message":"Unauthorized; scope does not match"}

Same with rest/agile/1.0/board/1/sprint (from the personal token API) or any other 1.0 calls (and various combinations of rest, api, 1.0 vs. 1 etc.).

According to this post a possible reason is "it can’t find the route you are specifying", so maybe the URL is wrong or the agile/1.0 API is not supported, which would be a real pity and a serious limition of service accounts...

 

Sebastian Krzewiński
Community Champion
April 21, 2026

Hi @Jakob 

 

Please check doc what scopes need to be added to token - https://developer.atlassian.com/cloud/jira/software/rest/api-group-board/#api-rest-agile-1-0-board-boardid-get

 

I tested and it works for me when I will add right scopes selected.

 

Regards,

Seba

Jakob
April 21, 2026

Hi @Sebastian Krzewiński

thanks, after creating a token with the required scopes it actually works. I'm pretty sure I did the same before, but there must be something I did wrong along the way...

For future reference:

  1. Create a service account token with authentication type "API token" and scopes read:board-scope:jira-software, read:issue-details:jira and read:sprint:jira-software
  2. Get the current active sprint with something like this:

curl ^
--get ^
-H "Accept: application/json" ^
-H "Authorization: Bearer %TOKEN%" ^
-d "state=active" ^
--url "https://api.atlassian.com/ex/jira/%CLOUD_ID%/rest/agile/1.0/board/%BOARD_ID%/sprint"

0 votes
Marc -Devoteam-
Community Champion
April 20, 2026

Hi @Jakob 

The Jira Software API seems to not have "granular" (needed for service accounts or scoped tikens) options, so the endpoints, it only works with a personal API token.

Jakob
April 20, 2026

Hi @Marc -Devoteam- 

When creating a token for the service account, I can also specify a "classic" scope named "read:jira-work", with which I can get issue data, at least with v2/v3.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
TAGS
AUG Leaders

Atlassian Community Events