Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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

Basics of API in Jira, Confluence and Bitbucket

How many times have you thought in your mind the tasks that were given to you or the tasks that you would do via User Interface in your company whether they can be achieved via API/Automation?
Here's an article that will get you started on the basics of the API journey in Atlassian products.

We will look at creating basic elements in Jira, Confluence, and Bitbucket

Let me start with Jira, it's the issue
To create an issue

curl --request POST \
--url '' \
--user 'your-email:api-token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"fields" : {"summary" : "Issue Summary - Test",
"issuetype" : {"id" : "10000"},
"project" : {"id" : "10000"},
"assignee" : {"id" : "5d36b583beedf60c26aa372d"} } }'

Where to get the details like token, issue type ID, a project ID, assignee ID?

The token can be generated here

Here's the link that will help you in getting Project ID

With API, to get project ID it goes like this

curl --request GET \
--url '{projectKey}' \
--user 'your-email:api-token' \
--header 'Accept: application/json'

Issue ID

curl --request GET \
--url '' \
--user 'your-email:api-token' \
--header 'Accept: application/json'

Get Account ID of Users

curl --request GET \
--url '' \
--user 'your-email:api-token' \
--header 'Accept: application/json'

Now that you have all the fields to create an issue, fill in the values and create an issue!

Explore more and master yourself in API!
The link to API documentation is here

How to create Confluence pages using API?
To create an empty page

curl --request POST \
--url '' \
--user 'your-email:api-token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"title": "Page title", "type": "page", "space": {"key": "spaceKey"}, "status": "current"}'

Here's how you would add the data in API

curl --request POST \
--url '' \
--user 'your-email:api-token' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{"title": "Page title", "type": "page", "space": {"key": "spaceKey"}, "status": "current", "body":{"storage":{"value":"<p>This is a new page</p>", "representation":"storage" }}}'

The confluence REST API documentation is here

Now let's go with Bitbucket
Creating a Private Repository

curl -X POST \
--url '{workspace}/{repo-name}' \
--user 'bitbucket-username:app-password' \
--header "Content-Type: application/json" \
--data '{"scm": "git", "project": {"key": "projectKey"}, "is_private": true }'

The Bitbucket API Documentation is here

I hope you find this article gets a motivation to start with API in your instance. Please share your thoughts in the comments.



Tamanna Godara Community Manager Feb 02, 2021

Great going @Pramodh !!!!! 

Like # people like this
Pramodh Community Leader Feb 02, 2021

Thank you @Tamanna Godara !

This article is really informative! Great work!!@Pramodh 

Like Pramodh likes this
Vero Rivas Community Leader Feb 02, 2021

Thanks @Pramodh 

Like Pramodh likes this

I have promoted this approach quiet often for our customers and especially when it comes to bulk update or bulk insert. On top of your great article I would like to add to the discussion that it is easy to populate curl commands with excel, copy-paste them into a text file and execute it from the terminal (e.g sh 

View an example from our documentation here.


Like Pramodh likes this

Great sum-up @Pramodh I will use it as a starting point when answering REST API questions :).

Like Pramodh likes this
Taranjeet Singh Community Leader Feb 24, 2021

Thanks @Pramodh ! This is really useful for beginners in Atlassian REST API, like me.

Like Pramodh likes this

Really cool stuff, thanks! 

Like Pramodh likes this


Log in or Sign up to comment
Community showcase
Published in Marketplace Apps & Integrations

How to log work and track time in Jira when a person is part of multiple teams

  The manager’s daily activities include a list of challenges to reach high levels of efficiency for their teams. Part of these challenges is related to how to deal with the worklog systems sin...

111 views 2 2
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