How to reindex Jira Server and Data Center using REST API via cURL command

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

This KB describes how to use the REST API to trigger a reindex in Jira. The examples below uses cURL, however you can use the REST client of your choice.

To trigger a Full re-index (Lock Jira and Reindex):

1 2 3 4 5 curl -D- \ -X POST \ -H "Authorization: Bearer <token>" \ -H 'Accept: application/json' \ '$BASEURL/rest/api/2/reindex?type=FOREGROUND'

ℹ️ When type is not specified, the default value will be BACKGROUND_PREFERRED

ℹ️For all of the following procedures, you must use an account with the Jira Administrators global permission.

ℹ️For more information on generating Using Personal Access Tokens check the documentation.

Solution

Data Center

For Jira Data Center a better approach than background indexing is to take one node out of the cluster and run FOREGROUND reindexing. See JRASERVER-66969 - Discourage Background Indexing for Datacenter instances in Indexing Page

When using the Jira Base URL, the request can be routed to any node in your cluster, making that node unavailable until the reindex is finished. To choose a specific node, replace Jira's Base URL with the IP address of that node:

1 2 3 4 5 curl -D- \ -X POST \ -H "Authorization: Bearer <token>" \ -H 'Accept: application/json' \ '$NODEIP/rest/api/2/reindex?type=FOREGROUND'

Notes

Type of re-indexing available:

  • FOREGROUND - runs a lock/full reindexing

  • BACKGROUND - runs a background reindexing. If Jira fails to finish the background reindexing, respond with 409 Conflict (error message).

  • BACKGROUND_PREFERRED  - If possible do a background reindexing. If it's not possible (due to an inconsistent index), do a foreground reindexing.

More information on this REST endpoint can be found in https://docs.atlassian.com/software/jira/docs/api/REST/latest

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.