Forums

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

How to authenticate with a service account and then a curl request.

kevin defoi September 2, 2025

How to authenticate with a service account and then a curl request. I have the following error message {"error": "Failed to parse Connect Session Auth Token" when I did

export JIRA_API_TOKEN="token jira"
export JIRA_SITE="xxxxx.atlassian.net"
export PROJECT_KEY="XXXXID"

 curl --request GET \
--url "https://${JIRA_SITE}/rest/api/3/project/${PROJECT_KEY}" \
--header "Authorization: Bearer ${JIRA_API_TOKEN}" \
--header "Accept: application/json"

 

 

 

 

1 answer

1 accepted

0 votes
Answer accepted
Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2025

Hi @kevin defoi 

Welcome to the community.

What call are you making, and are you on cloud or DC?

What if you use an basic authentication?

https://developer.atlassian.com/cloud/jira/platform/basic-auth-for-rest-apis/ 

kevin defoi September 2, 2025

Hi @Marc - Devoteam I'm on DC

When I enter this command

curl -D- \
-u myuser-service account@serviceaccount.atlassian.com:api_token \
-X GET \
-H "Content-Type: application/json" \
https://mydomain.atlassian.net/rest/api/2/issue/createmeta

 

I have this response

HTTP/2 200
content-type: application/json;charset=UTF-8
date: Tue, 02 Sep 2025 11:54:13 GMT
server: AtlassianEdge
timing-allow-origin: *
x-arequestid: d3125c7d19688fab1028a6c6fc6e8832
x-seraph-loginreason: AUTHENTICATED_FAILED
set-cookie: atlassian.xsrf.token=cxxxxxxxxxxxxxxxxxxxxxxaad3b_lout; Path=/; SameSite=None; Secure
cache-control: no-cache, no-store, no-transform
warning: The issue create meta endpoint has been deprecated. (Deprecation start date: June 03, 2024)

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2025

Hi @kevin defoi 

You are not clear, you mention you are on DE, but the API endpoint you provide is from the Cloud API

And also the service account option doesn't exist on DC., this is a Cloud only option.

So it seems you are on Cloud.

As the endpoint you are trying to use is deprecated, its place we are introducing two endpoints:

Get create metadata issue types for a project: fetches all Issue Types for a specific Project; it will support pagination on the Issue Types, but not include expanded fields.

Get create field metadata for a project and issue type id: fetches a specific Issue Type for a specific Project via issueTypeId. This endpoint will have expanded fields by default and will support pagination on the Fields.

The above is shared here; https://developer.atlassian.com/cloud/jira/platform/changelog/#CHANGE-1304 (2023)

The endpoint you specify can't be used since 03-06-2024, you need to use one of the replacement API calls.

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 2, 2025

Also Service Accounts can't execute towards all API endpoints yet.

kevin defoi September 2, 2025

Sorry @Marc - Devoteam , I made a mistake in my answer. I'm using Jira Cloud.

Andrea_Lawrence
Contributor
September 4, 2025

Also Service Accounts can't execute towards all API endpoints yet.

@Marc - Devoteam - do you know which API endpoints CAN be executed by Service Accounts? is this listed somewhere?

Marc - Devoteam
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 5, 2025

HI @Andrea_Lawrence 

To my knowledge this is currently not listed somewhere?

Like Andrea_Lawrence likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events