Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to get logged in users email when running pipeline


How do I get the email of the logged in user in bitbucket pipelines so that I can send email to the user with email-notify (

I tried this:

curl -X GET -g "" | jq --raw-output '.values[0].email'

but it does not work. It seems it does not return anything

I also tried this endpoint but it does not contain the email address{selected_user}

What is the context that the pipeline is run, it is not the logged in user ?


1 answer

1 accepted

0 votes
Answer accepted

Hi Jani,

I'm not really sure what you mean by 'logged in user in bitbucket pipelines'. Do you mean the user who triggered that build?

At the moment, I'm afraid that it is not possible to retrieve emails of other users via API.

Emails of workspace members are visible to workspace admins in workspace Settings >> User groups >> after selecting a specific User group.

However, they cannot be retrieved via API yet. We have an open feature request for this, you can add yourself as a watcher if you'd like to get notified via email on updates:

The API call you mention in your question:

curl -X GET -g "" | jq --raw-output '.values[0].email'

needs authentication.

You'll need to include in the call -u username:password with the credentials of your user. You could create repository variables for the username and password and then execute this call from the build, but it will return the email of your own user (that endpoint returns all the authenticated user's email addresses)

Kind regards,

Yes, the user that is running the build. I was kind hoping that I could just call

and it would return me my email address since I am the one running the pipeline but I realized that I need to authenticate separately for that (with the same credentials that I logged in to bitbucket :-))

I assume you get the email from somewhere since if the pipeline fails I get an email that it has failed

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Bitbucket

📣 Calling Bitbucket Data Center customers to participate in research

Hi everyone, Are you Bitbucket DC customer? If so, we'd love to talk to you! Our team wants to dive deep to understand your long-term plans regarding Bitbucket DC and Atlassian Cloud. Do you plan...

190 views 2 4
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you