---
title: "REST API: Integrity Check"
canonical: "https://support.appfire.com/space/IC/198475944/REST%20API%3A%20Integrity%20Check"
format: markdown
---
> Macro (aura-html)

> 📝 **For details and examples, take a look at the REST API reference:**
> 📝 
> 📝 Documentation for [Integrity Check REST API 1.4](https://docs.botronsoft.com/cmj/api/rest/integrity/1.4/index.html) - available with CMJ 6.6.6 or later.

## URI structure

Integrity Check for Jira’s REST API provides means to run integrity checks, track their progress, and get the results as json/csv. URIs for Integrity Check's REST API resource have the following structure:

```
http://yourjira.com/jira/rest/integrity-check/api/1.4/integrity
```

## Step-by-step guide for using the API

---

---

Use this request to run an integrity check of your Jira configuration. For details, please refer to the documentation of the [latest REST API version 1.4](https://docs.botronsoft.com/cmj/api/rest/integrity/1.4/index.html).

> ⚠️ On Windows, single quotes around JSON code might not work. Try escaping them like so:  
> ⚠️ “{\"scope\":\"system\"...

**Request**

<details>
<summary>QUERY PARAMETERS</summary>

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| scope | *string*<br>**Required** | **Accepted values**: `"system"`, `"project"` or `"projectWithIssues"`.<br>**Examples:**<br>```
{
  "scope" : "system"
}
```<br>or<br>```
{
  "scope" : "system",
  "includeAllFilters" : true,
  "includeAllBoards" : true,
  "includeAllDashboards" : true
}
```<br>or<br>```
{
  "scope": "project",
  "projectKey": "PRJA",
  "includeProjectBoards": false,
  "includeProjectFilters": true
}
``` |
</details>

<details>
<summary>REQUEST EXAMPLE</summary>

```
curl -u admin:admin -i -H "Content-Type: application/json" -X POST http://localhost:2990/jira/rest/integrity-check/api/1.4/integrity -d '{"scope" : "system"}'
```
</details>

**Responses**

<details>
<summary>BY STATUS CODE</summary>

<span style="color: #006644">**STATUS 201 **</span>- *application/json* - Returns the id of the operation.  
**Headers**

- **Location**: *required(string)*
  The URI pointing to the started Integrity Check operation. The operation id can be used for getting operation progress, downloading results as .csv, or canceling the operation.

**Example**:

```
{
 "id":2
}
```

<span style="color: #bf2600">**STATUS 400**</span> - The value 'exampleValue' is not a valid enumerator of 'SnapshotType'.
</details>

---

---

Get the progress or end result of the Integrity Check operation with the given id.

For running operations, the response contains the progress of the operation, which is between 0 and 1, and the operation status.

For completed operations, the response contains an integrityModel property, which includes any integrity violations.

**Request**

<details>
<summary>QUERY PARAMETERS</summary>

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| id | *integer*<br>**Required** | The id of the operation. |
</details>

<details>
<summary>REQUEST EXAMPLE</summary>

```
curl -u admin:admin -i -H "Content-Type: application/json" -X GET http://localhost:2990/jira/rest/integrity-check/api/1.4/integrity/1
```
</details>

**Responses**

<details>
<summary>BY STATUS CODE</summary>

<span style="color: #006644">**STATUS 200**</span> - *application/json - *Returns the status of the progress of the operation.

**Example**:

```
{"id":8,"message":"Integrity Check in progress. Checking Filters: 56 of 492.",
"progressMessages":[...],"progressDouble":0.4227642276422765,"status":"Running"} 
```

or

```
{"id":14,"integrityModel":{"maxSeverity":"Warning","containsUnknownErrors":false,
"objectCount":227,"hasValidLicense":false,"quickfixablePathsCount":0},
"message":"Integrity check succeeded","progressDouble":1.0,"status":"Succeeded"}
```

or

```
{integrityModel={objectCount=914, hasValidLicense=false, 
violations=[{severity=Warning, solution=Modify the objects to point to an existing project or remove the reference to the missing project., 
paths=[{elements=[{name=Engineering Stories Sprint 16 (mwoodbu), id=null, type=Filter, url=http://localhost:2990/jira/issues/?filter=10001},
{name=project = ABGF AND issuetype = Story...
```

<span style="color: #bf2600">**STATUS 400**</span> - Request is invalid.

<span style="color: #bf2600">**STATUS 404**</span> - No Integrity check operation with the given id.
</details>

---

---

Get a .csv file with the end result of the Integrity Check operation with the given id.

> ✅ The .csv file will be empty if no integrity violations are detected.

**Request**

<details>
<summary>QUERY PARAMETERS</summary>

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| id | *integer*<br>**Required** | The id of the operation. |
</details>

<details>
<summary>REQUEST EXAMPLE</summary>

```
curl -u admin:admin -i -H "Content-Type: application/json" -X GET http://localhost:2990/jira/rest/integrity-check/api/1.4/integrity/1/csv
```
</details>

**Responses**

<details>
<summary>BY STATUS CODE</summary>

<span style="color: #006644">**STATUS 200**</span> - *text/csv - *Returns a .csv file.

<span style="color: #bf2600">**STATUS 400**</span> - Request is invalid.

<span style="color: #bf2600">**STATUS 404**</span> - No Integrity check operation with the given id.
</details>

---

---

Cancel a running Integrity Check operation.

**Request**

<details>
<summary>QUERY PARAMETERS</summary>

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| id | *integer*<br>**Required** | The id of the operation. |
</details>

<details>
<summary>REQUEST EXAMPLE</summary>

```
curl -u admin:admin -i -H "Content-Type: application/json" -X PUT http://localhost:2990/jira/rest/integrity-check/api/1.4/integrity/1/cancel
```
</details>

**Responses**

<details>
<summary>BY STATUS CODE</summary>

<span style="color: #006644">**STATUS 200**</span> - Cancellation request received.

<span style="color: #bf2600">**STATUS 400**</span> - An error occurred while canceling the Integrity Check operation.

<span style="color: #bf2600">**STATUS 404**</span> - No Integrity check operation with the given id.
</details>

---

---

Start an Integrity Check operation on the last unsuccessful snapshot. After successfully completing the operation, use "/integrity/{id}" to get the result.

**Responses**

<details>
<summary>BY STATUS CODE</summary>

<span style="color: #006644">**STATUS 200**</span> - Operation successfully completed.

**Headers**

- **Location**: *required(string)*
  Contains the operation Id.

<span style="color: #bf2600">**STATUS 500**</span> - Could not retrieve snapshot metadata, i.e. unsuccessful snapshot is missing.
</details>