Forums

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

How to get session information in using REST API in JIRA Cloud?

Kshitij Nirgude March 21, 2025

Hi,

I want to fetch session information for the logged in user using rest api in Jira Cloud. I tried using folowing end point.

<domain>/jira/rest/auth/1/session, but it is not fetching me the required info. Can you please help?

Thanks!

2 answers

1 vote
Jim Knepley - ReleaseTEAM
Atlassian Partner
March 21, 2025

Hi @Kshitij Nirgude 

You're not specific as to what information isn't being returned, but I wonder if you're looking for the "Myself" family of calls:

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-myself/#api-group-myself

 

Philipp Sendek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2025

Oh, that's actually what I was searching for but I couldn't remember the magic word "myself". Thank you for adding that!

1 vote
Philipp Sendek
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 21, 2025

Hi @Kshitij Nirgude ,

which information are you looking for exactly?
As REST itself is stateless, there are no session information when interacting with the API.
Inofficially there is POST https://$ALIAS.atlassian.net/gateway/api/session/heartbeat which will probably need a cookie as authencation and returns the information "nextCallTimestamp" and "sessionExpiryTime".

Maybe this helps. Otherwise, I'm looking forward to hearing what exact information you're looking for and hopefully can help you dig out the correct endpoint for that.

Greetings
Philipp

Kshitij Nirgude March 23, 2025

I wanted to get the value of cookie "cloud.session.token", which I can use in subsequent REST API calls.

Jim Knepley - ReleaseTEAM
Atlassian Partner
March 24, 2025

@Kshitij Nirgude your original idea of using <domain>/jira/rest/auth/1/session is correct and should return a session ID suitable for use as a cookie in future API calls.

Is that call not returning the session token you expect in the response headers or payload?

ref: https://developer.atlassian.com/server/jira/platform/cookie-based-authentication/

Kshitij Nirgude March 25, 2025

I would like to get this information for Jira Cloud and not for Jira Server/Data Center. It isn't working for Jira Cloud. Do we have any equivalent url for jira cloud?

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