---
title: "REST API: Configuration Manager"
canonical: "https://support.appfire.com/space/CMJ/197955929/REST%20API%3A%20Configuration%20Manager"
format: markdown
---
> Macro (aura-html)

> 📝 **For details and examples, take a look at the REST API reference:**
> 📝 
> 📝 Documentation for [REST API 1.7](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/2506653789) - available with Configuration Manager 9.0.0 or later.

## URI structure

Configuration Manager's REST API provides means to manage snapshots via URI paths. URIs for Configuration Manager's REST API resource have the following structure:

```
http://host:port/context/rest/configuration-manager/api/api-version/resource-name
```

The **current API version** is 1.7.

For example, you would use the following path to access the snapshots' API on a locally run instance of Jira with a context path of /jira:

```
http://localhost:2990/jira/rest/configuration-manager/api/1.7/snapshots
```

> ℹ️ **Context Path**
> ℹ️ 
> ℹ️ The example above specifies a context path of “/jira”. Keep in mind that **the context path may be different or not present** for your installation of Jira.

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

---

---

This snapshot endpoint creates a new snapshot. 

**Request**

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

> ℹ️ The query parameters vary based on the value of the **"scope" parameter. **

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| **PARAMETERS FOR ALL SCOPES** |
| name | *string*<br>**Required** | The name of the snapshot. |
| scope | *string*<br>**Required** | **Accepted values**: `"system"`, `"project"` or `"projectWithIssues"`. |
| description | *string*<br>Optional | The description of the  snapshot. |
| **PARAMETERS FOR SCOPES: PROJECT, PROJECT WITH ISSUES** |
| projectKey | *array of strings*<br>**Required** | Includes one or more selected projects.<br>**Example**:<br>For single-project snapshots:<br>```
"projectKey" : "PRJ"
```<br>For multi-project snapshots:<br>```json
"projectKey" : [
    "PRJA",
    "PRJB"
]
``` |
| filters | *array of objects*<br>Optional | Includes the filters that match the provided `"filterId"`.<br>**Example**:<br>```json
"filters" : [{
  "filterId" : 1
}]
``` |
| includeProjectFilters | *boolean*<br>Optional<br>Default value: *false* | Includes all filters referenced by the projects in the snapshot.<br>[Learn more](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/198117100). |
| agileBoards | *array of objects*<br>Optional | Includes the agile boards that match the provided `"boardId"`.<br>**Example**:<br>```json
"agileBoards" : [{
  "boardId" : 1
}]
``` |
| includeProjectBoards | *boolean*<br>Optional<br>Default value: *false* | Includes all boards of the projects exported with the snapshot.<br>[Learn more](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/198247358). |
| includeProjectAutomationRules | *boolean*<br>Default value:  
*false*<br>Optional | Includes all automation rules associated with the selected projects.<br>[Learn more](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/2192608406). |
| includeGlobalAutomationRules | *boolean*<br>Default value:  
*false*<br>Optional | Includes all global automation rules.<br>[Learn more](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/2192608406). |
| dashboards | *array of objects*<br>Optional | Includes the dashboards that match the provided `"dashboardId"`.<br>**Example**:<br>```json
"dashboards" : [{
  "dashboardId" : 1
}]
``` |
| appsWithGlobalData | *array of objects*<br>Optional | Includes the global configuration and/or data objects of all specified Jira apps integrated with the respective Service Provider Interface (SPI) integration points. [Learn more](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/198279999).<br>**Available objects**:<br>- `"key" `- specifies the app's key;
- `"includeGlobalConfiguration"` -* *includes the global app configuration settings of the app specified by the `"key"` parameter. The app must be integrated with CMJ via the SPI [global configuration integration point](https://appfire.atlassian.net/wiki/spaces/AppIn/pages/197858762).
- `"appDataIds"` - includes custom functionality of an app that extends standard Jira functions. The selected app must be integrated with CMJ via the SPI [app data integration point](https://appfire.atlassian.net/wiki/spaces/AppIn/pages/197924825).
  - `"typeId"` - specifies the app's selected types of objects (functionality);
  - `"objectIds"` - includes specific app data objects of the selected types.<br>**Example**:<br>```json
"appsWithGlobalData" : [
  { 
    "key": "com.botronsoft.jira.rollout.spi-test-plugin", 
    "includeGlobalConfiguration": "true",
    "appDataIds": [
      { 
        "typeId" : "typeOneId",
        "objectIds" : ["id1", "id2", "id3"]
      },
      { 
        "typeId" : "typeTwoId",
        "objectIds" : ["id3"]
      }
    ]
  }
]
``` |
| filter  
***Only applicable to the Project with issues scope.*** | *string*<br>Optional | Includes only issues filtered by a JQL query.<br>**Example**:<br>```json
"filter":"issueType = Bug"
``` |
| includeOnlyArchivedIssues | *boolean*<br>Optional<br>Default value: *false* | Includes only archived issues. |
| options | *object*<br>Optional | Specifies additional data that can be included in the snapshot.<br>**Available options**:<br>- `"includeAttachmentFiles"` (***only applicable to project with issues scope***) - includes issue attachment files for the selected projects. If the value is *false*, during snapshot deployment there's an option to provide the path where the attachment files reside on the target system.
- `"checkCustomFieldValues"` (***only applicable to project scope***)- includes custom fields with value in at least one issue in the project. If the value is *false*, only custom fields referenced by the project configuration will be included.<br>The default value of both options is *false *if not else specified* *or if the `"options"` parameter is not used.<br>**Example**:<br>```json
"options" : {
  "includeAttachmentFiles" : true,
  "checkCustomFieldValues" : true
}
``` |
| **PARAMETERS FOR SCOPE: SYSTEM** |
| includeGlobalAppData | *boolean*<br>Default value: *false*<br>Optional | Includes the global configuration data of all Jira apps integrated with CMJ. |
| includeAllFilters | *boolean*<br>Default value: *false*<br>Optional | Includes all filters. |
| includeAllBoards | *boolean*<br>Default value: *false*<br>Optional | Includes all agile boards. |
| includeAllDashboards | *boolean*<br>Default value: *false*<br>Optional | Includes all dashboards. |
| includeAllAutomationRules | *boolean*<br>Default value:  
*false*<br>Optional | Includes all automation rules. |
</details>


**Unix/macOS request **

<details>
<summary>EXAMPLE</summary>

```json
curl -u admin:admin -i -H "Content-Type: application/json" -X POST <jira-base-url>/rest/configuration-manager/api/1.7/snapshots -d '
	{
		"name" : "My snapshot",
		"description" : "Very nice snapshot",
		"scope" : "system"
	}
	'
```
</details>

**Windows request**

<details>
<summary>EXAMPLE</summary>

> ℹ️ **Note** that on Windows machines, single quotes around JSON might not work. Try escaping them like: "{\"name\":\"My snapshot\"...

```
curl -u admin:admin -i -H "Content-Type: application/json" -X POST <jira-base-url>/rest/configuration-manager/api/1.7/snapshots -d^
"{^
    \"name\" : \"My snapshot\",^
    \"description\" : \"Very nice snapshot\",^
    \"scope\" : \"system\"^
}"
```
</details>

**Responses**

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

<span style="color: #006644">**STATUS 201**</span> *application/json -  *Returns a JSON representation of snapshot metadata (includes the *id* of the new snapshot and the *count of objects*). 

The** Location** header contains the URI pointing to the newly created snapshot.

```json
HTTP/1.1 201 Created
...
Location: <jira-base-url>/rest/configuration-manager/api/1.7/snapshots/1
Content-Type: application/json;charset=UTF-8
...
{
  "id" : 1,
  "objectCount" : 86
}
```

<span style="color: #bf2600">**STATUS 400 **</span>- Returned if a required parameter is not provided or a snapshot with the same name already exists. 

<span style="color: #bf2600">**STATUS 403 **</span>- Returned if the user does not have permissions to create a snapshot.
</details>

---

---

This snapshot endpoint returns all snapshots' metadata attributes (i.e., no actual snapshot files, just the snapshot metadata).

**Request**

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

```json
curl -u admin:admin -H "Content-Type: application/json" -X GET <jira-base-url>/rest/configuration-manager/api/1.7/snapshots
```
</details>

**Responses**

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

<span style="color: #006644">**STATUS 200 **</span>*application/json* - Metadata successfully fetched.

<span style="color: #bf2600">**STATUS 400**</span> - Returned if the request is invalid.

<span style="color: #bf2600">**STATUS 403**</span> - Returned if the user does not have the necessary permissions to get all snapshots' metadata.
</details>

---

---

This snapshot endpoint returns a specified snapshot as a ZIP containing a snapshot file in a binary format.

**Request**

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

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| id | *integer*<br>**Required** | The id of the snapshot to be returned as a ZIP. |
</details>

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

```json
curl -u admin:admin -H "Content-Type: application/json" -X GET <jira-base-url>/rest/configuration-manager/api/1.7/snapshots/1 > snapshot.zip
```
</details>

**Responses**

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

<span style="color: #006644">**STATUS 200 **</span>*application/octet-stream - *Returns as a ZIP containing a snapshot file in a binary format:

```xml
HTTP/1.1 200 OK
...
Content-Type: application/octet-stream
...
<?xml version="1.1" encoding="UTF-8"?>
<jiraconfiguration:JiraConfigurationRoot xmi:version="2.0" type="System" name="My snapshot">
...
</jiraconfiguration:JiraConfigurationRoot>
```

<span style="color: #bf2600">**STATUS 400**</span> - Returned if the request is invalid.

<span style="color: #bf2600">**STATUS 401 **</span>- Returned if authentication credentials are missing. 

<span style="color: #bf2600">**STATUS 403**</span> - Returned if the user does not have permissions to create a snapshot.

<span style="color: #bf2600">**STATUS 404**</span> - Returned if no snapshot with the given id is found. 

<span style="color: #bf2600">**STATUS 405 **</span>- Returned if the *id* parameter is not provided in the request body.
</details>

---

---

This snapshot endpoint deletes a specified snapshot. 

**Request**

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

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| id | *integer*<br>**Required** | The id of the snapshot to be deleted. |
</details>

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

```json
curl -u admin:admin -i -H "Content-Type: application/json" -X DELETE <jira-base-url>/rest/configuration-manager/api/1.7/snapshots/1
```
</details>

**Responses**

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

<span style="color: #006644">**STATUS 204 **</span>- Returned if successfully deleted. 

```json
HTTP/1.1 204 No Content
...
```

<span style="color: #bf2600">**STATUS 400**</span> - Returned if the *id *parameter is not provided.

<span style="color: #bf2600">**STATUS 403**</span> - Returned if the user does not have permissions to create a snapshot.

<span style="color: #bf2600">**STATUS 404**</span> - Returned if no snapshot with the given id is found.
</details>

---

---

Deployment is a two-step process:

1. **Meta information** is provided.
2. A **snapshot file** is uploaded.

A separate REST endpoint is used for tracking deployment progress.

The “*Start a deployment operation*” is the first step of the deployment process. The request parameters provide the **meta information **required.

**Request**

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

> ℹ️ The query parameters vary based on the value of the `"scope"`** parameter. **

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| **PARAMETERS FOR ALL SCOPES** |
| scope | *string*<br>**Required** | Accepted values: `"system"` and `"project"`. |
| **PARAMETERS FOR SCOPE: PROJECT** |
| mode | *string*<br>**Required** | Accepted values: `"singleProject"` and `"multiProject"`. Value depends on the number of projects in the deployed snapshot.<br>Learn more about deploying [single-project](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/197857553) and [multi-project](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/197825512) snapshots. |
| projectKey | *string*<br>**Required** | ***Only applicable to ***`"singleProject"`*** mode.***<br>The key of the project with which to merge, usually the same as the project in the snapshot. |
| options | *object*<br>Some of the objects are **required **for `singleProject` mode.<br>Optional for `multiProject` mode. | Specifies the behavior during deployment.<br>There are two main possibilities during deployment:<br>- **merging** **the project(s) **in the snapshot with the project(s) on target, or
- **creating a new project *****(only applicable to ***`"singleProject"`*** mode)**** *on target identical to the project in the snapshot.<br>**Available options**:<br>- `"createNewProject"` - **required **when creating a new project in** **`"singleProject"`** **mode.** **Default value: *false*.
- `"newProjectKey"`/`"newProjectName"` - **required** if `"createNewProject"` = *true*.
- `"projectKey"` - **required** when merging the project in `"singleProject"` mode. This is the key of the project to merge into.
- `"modifyProjectVersions"` - optional. Default value: *true.*
- `"modifyProjectComponents"` - optional. Default value: *true.*
- `"modifyProjectRoles"` - optional. Default value: *true*.
- `"modifyProjectShortcuts"` - optional. Default value: *true*.
- `"attachmentFilesPath"` - optional.
- `"modifyFieldDefaultValues"` - optional. Default value: *true*.
- `"modifyFieldOptions"` - optional. Default value: *true*.
- `"modifyObjectDescriptions"` - optional. Default value: *true*.
- `"modifyObjectTranslations"` - optional. Default value: *true*.
- `"modifyStatusCategories"` - optional. Default value: *true*.
- `"modifyPriorityColors"` - optional. Default value: *true*.
- `"modifyAvatars"` - optional. Default value: *true*.
- `"skipReindexing"` - optional. Default value: *false*.
- `"modifyAutomationRules"` - optional. Default value: *false*.<br>Learn more about the options in the [Advanced Options document](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/198021794).<br>**Example**:<br>```json
"options" : {
    "createNewProject" : true,
    "newProjectKey" : "PRJ",
    "newProjectName" : "My Project",
    "modifyProjectVersions" : false,
    "modifyProjectComponents" : false,
    "modifyProjectRoles": true,
    "attachmentFilesPath" : "C:\\attachments"
  }
``` |
| **PARAMETERS FOR SCOPE: SYSTEM** |
| mode | *string*<br>**Required** | **Accepted values: **<br>- `"systemRestore"` - replaces the configuration on target with the configuration in the deployed snapshot.
- `"systemMerge"` - keeps the configuration of objects on target that are not present in the snapshot.<br>The value depends on the deployment strategy.   
Learn more about [deploying system snapshots](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/198181573). |
| options | *object*<br>Optional | Specifies the behavior during deployment.<br>**Available options: **<br>- `"modifyProjectVersions"` - default value: *true*.
- `"modifyProjectComponents"` - default value: *true*.
- `"modifyProjectRoles"` - default value: *true*.
- `"modifyProjectShortcuts"` - default value: *true*.
- `"modifyGlobalPermissions"` - default value: *true*.
- `"modifyFieldDefaultValues"` - default value: *true*.
- `"modifyFieldOptions"` - default value: *true*.
- `"modifyObjectDescriptions"` - default value: *true*.
- `"modifyObjectTranslations"` - default value: *true*.
- `"modifyStatusCategories"` - default value: *true*.
- `"modifyPriorityColors"` - default value: *true*.
- `"modifyAvatars"` - default value: *true*.
- `"modifyAutomationRules"` - default value: *false*.<br>Learn more about the options in the [Advanced Options document](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/198021794).<br>**Example**:<br>```json
"options" : {
  "modifyProjectVersions" : false,
  "modifyProjectComponents" : true,
  "modifyProjectRoles" : true,
  "modifyProjectShortcuts" : false,
  "modifyGlobalPermissions" : false,
  "modifyFieldDefaultValues" : true,
  "modifyFieldOptions" : true,
  "modifyAvatars" : true,
  "modifyAutomationRules" : false,
  "modifyObjectDescriptions" : true,
  "modifyObjectTranslations" : true,
  "modifyStatusCategories" : false,
  "modifyPriorityColors" : false,
  "skipReindexing" : true
}
``` |
</details>

**Unix/macOS request **

<details>
<summary>EXAMPLE</summary>

```json
curl -u admin:admin -i -H "Content-Type: application/json" -X POST <jira-base-url>/rest/configuration-manager/api/1.7/deployments -d '
	{
		"scope" : "system",
		"mode" : "systemRestore"
	}
	'
```
</details>

**Windows request**

<details>
<summary>EXAMPLE</summary>

> ℹ️ **Note** that on Windows machines, single quotes around JSON might not work. Try escaping them like "{\"name\":\"My snapshot\"...

```json
curl -u admin:admin -i -H "Content-Type: application/json" -X POST <jira-base-url>/rest/configuration-manager/api/1.7/deployments -d^
"{^
    \"scope\" : \"system\",^
    \"mode\" : \"systemRestore\"^
}"
```
</details>

**Responses**

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

<span style="color: #006644">**STATUS 201 **</span>- Returns the id of the operation.   
The** Location** header contains the URI for checking the progress of the deployment operation.

```json
HTTP/1.1 201 Created
...
Location: <jira-base-url>/rest/configuration-manager/api/1.7/deployments/1
Content-Type: application/json;charset=UTF-8
...
{
  "id" : 1
}
```

<span style="color: #bf2600">**STATUS 400**</span> - Returned if a required* *parameter is not provided.

<span style="color: #bf2600">**STATUS 403**</span> - Returned if the user does not have permissions to create a snapshot.
</details>

---

---

This endpoint uploads the snapshot content during deployment. 

The snapshot content must be provided in a part named '*file*' within a **multipart/form-data** body. After the content is successfully uploaded, the deployment process will start.

> ℹ️ Uploading a snaphot zip file is a **required step** after starting the deployment operation.

**Request**

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

| **Parameter** | **Type** | **Description** |
| --- | --- | --- |
| file | *string*<br>**Required** | The snapshot file to be uploaded. |
| id  
(**URI Parameter**) | *integer*<br>**Required** | The deployment operation id. |
</details>

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

```json
curl -u admin:admin -i -X PUT <jira-base-url>/rest/configuration-manager/api/1.7/deployments/1/content -F file=@snapshot.zip
```
</details>

**Responses**

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

<span style="color: #006644">**STATUS 200 **</span>- Returned when the snapshot is successfully uploaded and parsed.

<span style="color: #bf2600">**STATUS 400**</span> - Returned if the type of the snapshot does not match the type of deployment operation.

<span style="color: #bf2600">**STATUS 403**</span> - Returned if the user does not have permissions to create a snapshot.
</details>

---

---

Returns the status of the deployment operation with the given id.   
This `"id"` is received as a response to the “*Start a deployment operation*” request. 

**Request**

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

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

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

```json
curl -u admin:admin -i -H "Content-Type: application/json" -X GET <jira-base-url>/rest/configuration-manager/api/1.7/deployments/1
```
</details>

**Responses**

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

<span style="color: #006644">**STATUS 200 **</span>- Returns a status: `"waiting"`, `"running"`, `"failed"`, `"succeeded"`.

```json
HTTP/1.1 200 OK
...
Content-Type: application/json;charset=UTF-8
...
{
  "id" : 1,
  "status" : "running"
}
```

<span style="color: #bf2600">**STATUS 400**</span> - Returned if the id is not provided.

<span style="color: #bf2600">**STATUS 403**</span> - Returned if the user does not have permissions to create a snapshot.

<span style="color: #bf2600">**STATUS 404 **</span>- Returned if no deployment operation with the given id is found.
</details>

> ⚠️ **Status: “waiting” **
> ⚠️ 
> ⚠️ You will receive the `"waiting"` status as a response in the following cases: 
> ⚠️ 
> ⚠️ - the snapshot zip file you want to deploy is still uploading;
> ⚠️ - you haven’t uploaded a snapshot zip file.
> ⚠️ 
> ⚠️ Uploading a snapshot zip file is a **required** step in the deployment operation and the `"waiting"` status will not change until you provide a file.

## Issue migration

In certain situations deploying a **configuration snapshot** may require migration of issues (e.g., when a workflow status is deleted and there are issues with this status). Note that this is different than deploying a **snapshot with issues**. This is not supported by the REST API, as migration requires user input. The following response will be returned:

```
{
  "id" : 1,
  "status" : "failed",
  "message" : "Data migration is required - automated deployment cannot continue."
}
 
```

In this case, the deployment will have to be performed through the user interface.

More information on issue migration can be found [here](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/197923086).

## Conflicting custom fields

Due to the fact that Jira allows the existence of multiple custom fields with the same name and type on a single system, it is not always possible to directly match custom fields on the snapshot to fields on the target system. More information on duplicate custom fields can be found [here](https://appfire.atlassian.net/wiki/display/CMJ/Duplicate+Custom+Fields). CMJ allows these conflicts to be resolved from the GUI, as described [here](https://appfire.atlassian.net/wiki/display/CMJ/Resolving+Custom+Field+Conflicts).

When using the REST API for deployment and such a case is detected, the deployment stops, and an error message is shown.

- You can perform the deployment through the [GUI](https://appfire.atlassian.net/wiki/spaces/CMJ/pages/198116696) and select the proper matching.
- If you want to perform the deployment anyway, the error severity type can be reduced to a warning showing the same message, which doesn't stop the deployment. This is controlled by the [General ](https://appfire.atlassian.net/wiki/display/CMJ/General+Settings)Settings' "Stop deployment in case of possible data loss".
- The duplicate fields on the source Jira can be temporarily renamed before creating the snapshot. The duplicate fields on the target instance can be temporarily renamed before deploying the snapshot in order to get properly matched.

## Status code 500 while creating a snapshot

If there are Integrity Check errors present, CMJ will return status code 500 with the **first***** *****error** in the body. To find all errors, use Integrity Check through the UI or REST API.

##### **Error body**

```javascript
{
  "messages": [
    "com.botronsoft.jira.rollout.integrity.IntegrityViolationException: Workflow <a href=\"/jira/secure/admin/workflows/ViewWorkflowSteps.jspa?workflowMode=live&workflowName=Sales+Workflow\" target=\"_blank\">'Sales Workflow'</a> refers to the missing custom field <b>customfield_10201</b>."
  ]
}
```