---
sourceDocument: Yokohama API Reference
sourceDocumentLink: https://www.servicenow.com/docs/r/yokohama/api-reference

 Release :

    - yokohama

ft:locale :

    - en-US

ft:publication_title :

    - Yokohama API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# Continuous Integration/Continuous Delivery (CICD) API

# Continuous Integration/Continuous Delivery (CICD) API {#ariaid-title1}

* Release version: Yokohama
* 
* Updated January 30, 2025
* 
* ![](https://www.servicenow.com/docs/portal-asset/ico-clock) 73 minutes to read

The CICD API provides endpoints that enable integration with common DevOps tools for building pipelines. These tools include Jenkins, Azure Pipelines, GitLab, GitHub Actions, Atlassian Bamboo/Pipelines, and more.
It provides integrators with the ability to build CICD pipelines for
ServiceNow AI Platform applications driven by pull/merge request workflows typical in
source-driven development. It leverages the Source Control, Application Repository, and Automated Test Framework features.

The CI/CD API provides the following product and feature areas:

* Source controlApply remote changes for an application linked to a remote Git
  repository through the Source Control feature in Studio, on a specific
  instance.

  Imports an application using the specified repository URL and branch
  name.
* Application repository: Available for scoped applications, global application, application customizations for scoped applications on the ServiceNow Store, and through plugins.
  * Publish an application from an instance to the connected application repository.
  * Install an application onto an instance from the connected application repository.
  * Rollback an application that was installed through rollback context.
* Batch
  * Define a JSON manifest file to batch install multiple applications together.
  * Rollback the entire batch install through rollback context.
  * Returns the results of a batch install based on a specified result identifier.
* Plugins
  * Activate a plugin.
  * Rollback a plugin through rollback context.
* Automated Test Framework (ATF)
  * Start an ATF test suite.
  * Obtain the pass/fail result of an ATF test suite.
* Instance scan
  * Start an instance scan (full, point scan on table, point scan on record, scoped application, update set, combination of these items.)
  * Obtain the pass/fail result of an instance scan run.
* ProgressObtain the percentage completion on an instance for processes initiated by
  other endpoint calls. You can use this feature to poll until progress completion before
  proceeding with the next step.

{#cicd-api__ul_rr4_fnq_spb}  
This API uses an asynchronous response model. When you call an endpoint, such as to run a test suite /sn_cicd/testsuite/run, the endpoint kicks off the associated function, such as starting the execution of the test suite. The endpoint then returns a response message that contains the execution status of the requested function, typically `Pending`, along with a unique identifier and link. Use this information to obtain additional information about the progress, source, results, and/or findings of the request. Depending on the function request, you can use one of the following means to obtain additional information about a request:

* Call the /sn_cicd/progress/{progress_id} endpoint using the links.progress.id parameter returned by the initiating endpoint.
* Call the /sn_cicd/testsuite/results/{result_id} endpoint using the links.result.id parameter returned by the initiating endpoint.
* Call the /sn_cicd/instance_scan/result/{progress_id} endpoint using the links.progress.id parameter returned by the initiating endpoint.
* Call the /sn_cicd/sc/apply_stash/{stash_id} endpoint using the links.stash.id parameter returned by the/sn_cicd/progress/{progress_id} endpoint.
* Link out to the links.\<progress/result/source/findings\>.url parameter returned by the initiating endpoint.  
Note:  
To install an application from a repository, the application must first be published to the repository using the /sn_cicd/app_repo/publish endpoint. Once published, any instance connected to that repository can then install and rollback the application. If the application is not first published, the installation request fails.

The sn_cicd.sys_ci_automation or admin role is required to use this API.

Beginning in Tokyo, the CICD API endpoints that need to obtain the instance wide lock / mutex to perform their requested operation will use a queue, rather than rejecting requests while the instance wide lock / mutex is occupied. Multiple CICD pipelines simultaneously make requests without detecting the rejection and retrying, and instead, can simply monitor the progress as they would for successful requests previously. This behavior is on by
default.  
The current queue can be inspected by a user with the admin role by navigating to the System Diagnostic -\>Application Operation Queue. From here the queue can be paused and resumed by the admin to allow for other manual operations that may require the instance wide lock / mutex.  
Note:  
When paused, any in progress operation will run to completion but no new operation will be started. The API will continue to accept and queue new requests. A pending operation can also be cancelled before it begins running by updating the listed execution tracker to a cancelled state. If for whatever reason, an operation cannot proceed after the time out specified in com.glide.update_operation.job_cancel_timeout_minutes (default: 48 hours), it will be cancelled.  
When an upgrade is scheduled, the queue will go into an upgrade paused state two hours prior to the upgrade unless overridden by the property com.glide.update_operation.queue_upgrade_window. This allows for any in progress operation to complete before the upgrade commences.  
Note:  
The queue automatically resumes when the upgrade is completed.  
For additional information on CICD, see:

* [Continuous Integration and
  Continuous Delivery (CICD) Spoke](https://www.servicenow.com/docs/access?context=cicd-spoke&version=yokohama&pubname=yokohama-integrate-applications&ft:locale=en-US)
* <https://plugins.jenkins.io/servicenow-cicd/>
* <https://marketplace.visualstudio.com/items?itemName=ServiceNow.vss-services-servicenow-cicd>
* [https://github.com/marketplace?type=actions\&query=servicenow](https://github.com/marketplace?type=actions&query=servicenow)
* <https://hub.docker.com/r/servicenowdevx/sncicd-gitlab-docker>

## CI/CD - GET /sn_cicd/app/batch/results/{result_id} {#ariaid-title2}

Returns the results of a batch install based on a specified result
identifier.
Call this method after calling the /sn_cicd/app/batch/install endpoint
to obtain the results of the batch install. Use the value returned in the
links.results.id parameter of the return results of
/sn_cicd/app/batch/install endpoint as the
result_id for this endpoint. You can also call the
/api/sn_cicd/progress/{progress_id} endpoint to obtain information on
the progress of the installation if it has not yet completed.

### URL format

Versioned URL:
/api/sn_cicd/{api_version}/app/batch/results/{result_id}

Default URL:
/api/sn_cicd/app/batch/results/{result_id}  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-GET-app-batch-results__entry__2}{#cicd-GET-app-batch-results__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| result_id | Sys_id of the batch installation for which to return results information. This value is returned in the links.results.id parameter of the /sn_cicd/app/batch/install endpoint. Data type: String |
[Table 1. Path parameters]

{#cicd-GET-app-batch-results__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 2. Query parameters]

{#cicd-GET-app-batch-results__entry__12}

| Name | Description |
|-|-|
| None |   |
[Table 3. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-GET-app-batch-results__entry__16}{#cicd-GET-app-batch-results__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 4. Request headers]

{#cicd-GET-app-batch-results__entry__20}

| Header | Description |
|-|-|
| None |   |
[Table 5. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-GET-app-batch-results__entry__24}{#cicd-GET-app-batch-results__entry-200-status-code}{#cicd-GET-app-batch-results__row-401-status-code}{#cicd-GET-app-batch-results__row-403-status-code}{#cicd-GET-app-batch-results__row-404-status-code}{#cicd-GET-app-batch-results__row-405-status-code}{#cicd-GET-app-batch-results__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 6. Status codes]

### Response body parameters (JSON or XML)

{#cicd-GET-app-batch-results__entry__38}{#cicd-GET-app-batch-results__row-error}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| batch_items | JSON array, where each object provides details of a package installation. Data type: Array "batch_items" [{ "customization_version": "String", "id": "String", "install_date": "String", "name": "String", "notes": "String", "state": "String", "status_message": "String", "type": "String", "url": "String", "version": "String" }] |
| batch_items.customization_version | Only applicable when the batch_items.type parameter is set to application or plugin and the requested_customization_version parameter is passed in the batch install request. Version of the store application or scoped ServiceNow plugin customization package to install, such as 1.0.2 or 2.3. Data type: String |
| batch_items.id | Sys_id of the application or identifier of the plugin to install. Same as the packages.id parameter in the initiating /sn_cicd/app/batch/install endpoint call. Data type: String |
| batch_items.install_date | Date and time that the package was installed. Empty if the request is still in progress. Data type: String |
| batch_items.name | Name of the package. Data type: String |
| batch_items.notes | User specified notes about the package. Same as the packages.notes parameter in the initiating /sn_cicd/app/batch/install endpoint call. Data type: String |
| batch_items.state | Current state of the associated package installation. Possible values: * Failed * In progress * Installed * Invalid * Ready * Rolled Back Data type: String |
| batch_items.status_message | Describes any errors that occurred during the installation of the package and/or customizations. Data type: String |
| batch_items.type | Type of application. Same as the packages.type parameter in the initiating /sn_cicd/app/batch/install endpoint call. Valid values: * application * plugin {#cicd-GET-app-batch-results__ul_pfk_sbq_2nb} Data type: String |
| batch_items.url | URL of the associated package installation record on your ServiceNow instance. Data type: String |
| batch_items.version | Version of the package to install, such as 1.0.2 or 2.3. Same as the packages.requested_version parameter in the initiating /sn_cicd/app/batch/install endpoint call. Data type: String |
| batch_plan | Describes the installation batch plan. Data type: Object "batch_plan": { "id": "String", "name": "String", "notes": "String", "state": "String", "url": "String" } |
| batch_plan.id | Sys_id of the return results information. Same value as what was passed in the result_id request parameter. Data type: String |
| batch_plan.name | User specified descriptive name for this batch request. Same as the name parameter in the initiating /sn_cicd/app/batch/install endpoint call. Data type: String |
| batch_plan.notes | Notes that were passed in when the batch install was invoked. Same as the notes parameter in the initiating /sn_cicd/app/batch/install endpoint call. Data type: String |
| batch_plan.state | Current state of the overall batch installation. Possible values: * Failed * In progress * Installed * Invalid * Partial Install * Ready * Rolled Back {#cicd-GET-app-batch-results__ul_dyj_sfy_2nb} Data type: String |
| batch_plan.url | URL of the batch installation plan record on your ServiceNow instance. Data type: String |
[ ]

### cURL request {#cicd-GET-app-batch-results__example_eyp_wdq_2nb}

This example checks the status of a batch installation plan called Release 2.0 IT
Operations.

    curl 'instance.servicenow.com/api/sn_cicd/app/batch/results/df24b1e9db2d0110b5e3f6c5ae97c561 \
    --request GET \
    --header 'Accept: application/json' \
    --user 'username':'password' 

    {
    "result": {
      "batch_plan": {
        "name":"Release 2.0 IT Operations",
        "id": "df24b1e9db2d0110b5e3f6c5ae97c561",
        "url": "https://instance.service-now.com/sys_batch_install_plan.do?sys_id=df24b1e9db2d0110b5e3f6c5ae97c561",
        "state": "Installed",
        "notes": "User specified notes for batch install plan",
      }
      "batch_items": [
        {
          "name": "com.sn_cicd_spoke",
          "type": "Application",
          "version": "7.0.0",
          "state": "Installed",
          "install_date": "2020-08-31 15:30:01",
          "id": "c159b1e9db1c0010b5e3f6c5ae961903",
          "url":"https://instance.service-now.com/sys_batch_install_item.do?sys_id=c159b1e9db1c0010b5e3f6c5ae961903",
          "notes" : ""
        },
        {
          "name": "Customization for CSM App1",
          "type": "Application",
          "version": "1.0.0",
          "state": "Installed",
          "install_date": "2020-08-31 15:32:01",
          "id": "e824b1e9db2d1001b5e3f6c5ae97d628",
          "url": "https://instance.service-now.com/sys_batch_install_item.do?sys_id=e824b1e9db2d1001b5e3f6c5ae97d628",
          "notes": "Customized headers.",
          "customization_version": "2.1.1",
          "status_message": ""

        }]
      }
    }

## CI/CD - GET /sn_cicd/instance_scan/result/{progress_id} {#ariaid-title3}

Returns the current progress and status of the CI/CD instance scan function associated
with a passed-in progress ID. Call this method after calling one of the other instance scan
CI/CD endpoints such as /sn_cicd/instance_scan/full_scan or
/sn_cicd/instance_scan/point_scan.
Note:  
This endpoint is part of the CICD Instance Scan Execution Service API and is used under the `sn_cicd` namespace.

### URL format

Versioned URL:
/api/sn_cicd/{api_version}/instance_scan/result/{progress_id}

Default URL:
/api/sn_cicd/instance_scan/result/{progress_id}  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-GET-instancescan-result__entry__2}{#cicd-GET-instancescan-result__version-not_optional-RESTAPI}

| Parameter | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| progress_id | Unique identifier of the function for which to return progress information. This value is returned in the links.progress.id parameter of the endpoint that initiated the action, such as /sn_cicd/instance_scan/full_scan or /sn_cicd/instance_scan/point_scan. Data type: String |
[Table 7. Parameters]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-GET-instancescan-result__entry__8}{#cicd-GET-instancescan-result__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 8. Request headers]

{#cicd-GET-instancescan-result__entry__12}

| Header | Description |
|-|-|
| None |   |
[Table 9. Response headers]

### Status codes

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-GET-instancescan-result__table_wwn_rhd_ct__entry__2}{#cicd-GET-instancescan-result__entry-200-status-code}{#cicd-GET-instancescan-result__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 10. Status codes]

{#cicd-GET-instancescan-result__table_wwn_rhd_ct}

### Request body

The API accepts these JSON or XML elements in the request body.
{#cicd-GET-instancescan-result__table_rm1_yjd_kv__entry__2}

| Element | Description |
|-|-|
| None |   |
[Table 11. Elements accepted in the request body]

{#cicd-GET-instancescan-result__table_rm1_yjd_kv}

### Response body

The API returns these JSON or XML elements in the response body.
{#cicd-GET-instancescan-result__table_mc1_pr1_tx__entry__2}{#cicd-GET-instancescan-result__entry-error}{#cicd-GET-instancescan-result__entry-link}{#cicd-GET-instancescan-result__entry-links_progress}{#cicd-GET-instancescan-result__entry-progress_url}{#cicd-GET-instancescan-result__entry-links_results}{#cicd-GET-instancescan-result__entry-links_results_id}{#cicd-GET-instancescan-result__entry-links_results_url}{#cicd-GET-instancescan-result__entry-status}{#cicd-GET-instancescan-result__entry-status_detail}{#cicd-GET-instancescan-result__entry-status_label}{#cicd-GET-instancescan-result__entry-healthscan_status_message}

| Element | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.findings | Object that contains information about the instance scan findings. |
| links.findings.label | Additional information about the instance scan findings. |
| links.findings.url | URL to use to retrieve a list of records that violated the checks. |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Unique identifier of the progress detail. |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| links.results | ID and URL of the execution results. Data type: Object "results": { "id": "String", "url": "String" } |
| links.results.id | Sys_id of the instance scan results record. |
| links.results.url | URL to use to obtain the results of the instance scan. |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional information about why the operation failed. Returns an empty string if the operation is successful. Data type: String |
[Table 12. Elements returned in the response body]

{#cicd-GET-instancescan-result__table_mc1_pr1_tx}  

### Sample cURL request

    curl 'instance.service-now.com/api/sn_cicd/instance_scan/result/a74c70a11b7800103d374087bc4bcb28' \
    --request GET \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
        "result": {
            "links": {
                "findings": {
                    "url": "https://instance.service-now.com/api/now/table/scan_finding?sysparm_query%3Dresult%3D6f4cf8651b7800103d374087bc4bcb41%5EORDERBYsys_id",
                    "label": "First 10,000 findings"
                },
                "progress": {
                    "id": "a74c70a11b7800103d374087bc4bcb28",
                    "url": "https://instance.service-now.com/api/sn_cicd/progress/a74c70a11b7800103d374087bc4bcb28"
                },
                "results": {
                    "id": "a74c70a11b7800103d374087bc4bcb28",
                    "url": "https://instance.service-now.com/api/sn_cicd/instance_scan/result/a74c70a11b7800103d374087bc4bcb28"
                }
            },
            "status": "2",
            "status_label": "Successful",
            "status_message": "",
            "status_detail": "",
            "error": ""
        }
    }

## CI/CD - GET /sn_cicd/progress/{progress_id} {#ariaid-title4}

Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function
associated with a specified progress ID.
Call this method after calling one of the asynchronous CICD endpoints such as
/sn_cicd/app_repo/publish,
/sn_cicd/app_repo/install, /sn_cicd/testsuite/run, or
/sn_cicd/sc/apply_stash.

### URL format {#cicd-GET-progress__section_jcv_cwv_ylb}

Versioned URL:
/api/sn_cicd/{api_version}/progress/{progress_id}

Default URL:
/api/sn_cicd/progress/{progress_id}  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-GET-progress__entry__2}{#cicd-GET-progress__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| progress_id | Unique identifier of the function for which to return progress information. This value is returned in the links.progress.id parameter of the endpoint that initiated the action, such as /sn_cicd/app_repo/publish, /sn_cicd/app_repo/install, /sn_cicd/testsuite/run, or /sn_cicd/sc/apply_stash. Data type: String |
[Table 13. Path parameters]

{#cicd-GET-progress__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 14. Query parameters]

{#cicd-GET-progress__entry__12}

| Name | Description |
|-|-|
| None |   |
[Table 15. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-GET-progress__entry__16}{#cicd-GET-progress__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 16. Request headers]

{#cicd-GET-progress__entry__20}

| Header | Description |
|-|-|
| None |   |
[Table 17. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-GET-progress__entry__24}{#cicd-GET-progress__entry-200-status-code}{#cicd-GET-progress__row-401-status-code}{#cicd-GET-progress__row-403-status-code}{#cicd-GET-progress__row-404-status-code}{#cicd-GET-progress__row-405-status-code}{#cicd-GET-progress__row-409-status-code}{#cicd-GET-progress__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 409 | Conflict. The requested item isn't unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 18. Status codes]

### Response body parameters (JSON or XML)

{#cicd-GET-progress__entry__40}{#cicd-GET-progress__row-error}{#cicd-GET-progress__row-link}{#cicd-GET-progress__row-links_progress}{#cicd-GET-progress__row-links_progress_id}{#cicd-GET-progress__row-links_progress_url}{#cicd-GET-progress__row-links_results}{#cicd-GET-progress__row-links_results_id}{#cicd-GET-progress__row-links_results_url}{#cicd-GET-progress__row-links_source}{#cicd-GET-progress__row-links_source_id}{#cicd-GET-progress__row-links_source_url}{#cicd-GET-progress__row-percent_complete}{#cicd-GET-progress__row-status}{#cicd-GET-progress__row-status_detail}{#cicd-GET-progress__row-status_label}{#cicd-GET-progress__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| links.results | ID and URL of the execution results. Data type: Object "results": { "id": "String", "url": "String" } |
| links.results.id | Sys_id of the results information. Use this value when calling the associated results endpoint. Data type: String |
| links.results.url | URL to use to obtain the results of the endpoint execution. Data type: String |
| links.source | Sys_id and URL information about the source record in the Execution Tracker \[sys_execution_tracker\] table. Data type: Object "source": { "id": "String", "url": "String" } |
| links.source.id | Unique identifier of the source record. Table: Execution Tracker \[sys_execution_tracker\] table Data type: String |
| links.source.url | URL to use to obtain the source information in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| links.stash | If a was created during an [apply_changes](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-POST-sc-apply_changes "Starts applying changes from a remote source control to a specified local application or application-customization.") operation, this object contains information about the stash. This object is not returned if a stash wasn't created. Data type: Object "stash": { "id": "String", "url": "String" } |
| links.stash.id | Unique identifier of the created stash. Use this value when calling the [CI/CD - POST /sn_cicd/sc/apply_stash/{stash_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-POST-sc-apply_stash "Starts applying a previously generated \"stash\" of changes from a remote source control to a specified local application or application-customization.") endpoint to apply the stash. Data type: String |
| links.stash.url | URL of the associated stash. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
[ ]

### Obtain the progress of a test suite run

    curl 'instance.servicenow.com/api/sn_cicd/progress/a4fae8911bdc00103d374087bc4bcbbd' \
    --request GET \
    --header 'Accept: application/json' \
    --user 'username':'password'

Progress of the apply changes call.

    {
        "result": {
            "links": {
                "progress": {
                    "id": "a4fae8911bdc00103d374087bc4bcbbd",
                    "url": "https://instance.servicenow.com/api/sn_cicd/progress/a4fae8911bdc00103d374087bc4bcbbd"
                },
                "source": {
                    "id": "59c4c4d11b5c00103d374087bc4bcb26",
                    "url": "https://instance.servicenow.com/api/now/table/sys_app/59c4c4d11b5c00103d374087bc4bcb26"
                }
            },
            "status": "2",
            "status_label": "Successful",
            "status_message": "This operation succeeded",
            "status_detail": "Successfully applied commit 1f14e11a7dedcbfa194beb5875fcdaa15ed8accb from source control",
            "error": "",
            "percent_complete": 100
        }
    }

### Obtain the progress of an apply changes call. In this case, there were
unsaved/uncommitted changes on the instance in Studio, so a stash was created to hold the
unsaved changes

    curl 'instance.servicenow.com/api/sn_cicd/progress/a4fae8911bdc00103d374087bc4bcbbd' \
    --request GET \
    --header 'Accept: application/json' \
    --user 'username':'password'

Progress providing information on the created stash.

    {
    "result": {
       "links": {
          "progress": {
             "id": "5b12eca4e0429110f8771827f8fd36a4",
             "url": "https://instance.servicenow.com/api/sn_cicd/progress/5b12eca4e0429110f8771827f8fd36a4"
           },
           "stash": {
             "id": "fc2224e4e0429110f8771827f8fd3634",
             "url": "https://instance.servicenow.com/api/sn_cicd/sc/apply_stash/fc2224e4e0429110f8771827f8fd3634"
    }
        },
        "status": "2",
        "status_label": "Successful",
        "status_message": "This operation succeeded",
        "status_detail": "Successfully applied commit fa5626f6f1f7fef677c16b4a0dd8b22ba8a6e311 from source control",
        "error": "",
        "percent_complete": 100
      }
    }

### cURL request {#cicd-GET-progress__example_k4r_rrk_z5b}

    curl 'instance.servicenow.com/api/sn_cicd/progress/5b12eca4e0429110f8771827f8fd36a4' \
    --request GET \
    --header 'Accept: application/json' \
    --user 'username':'password'

Progress of a test suite run (/sn_cicd/testsuite/run).

    {
    "result": {
       "links": {
          "progress": {
             "id": "e891389d1b1040103d374087bc4bcb75",
             "url": "https://instance.servicenow.com/api/sn_cicd/progress/e891389d1b1040103d374087bc4bcb75"
           },
           "results": {
             "id": "2891389d1b1040103d374087bc4bcb09",
             "url": "https://instance.servicenow.com/api/sn_cicd/testsuite/results/2891389d1b1040103d374087bc4bcb09"
           }
        },
        "status": "2",
        "status_label": "Successful",
        "status_message": "Suite passed",
        "status_detail": "Suite passed",
        "error": "",
        "percent_complete": 100
      }
    }

## CI/CD - GET /sn_cicd/testsuite/results/{result_id} {#ariaid-title5}

Returns the results of a test suite run based on a specified results identifier.
Call this endpoint after calling /sn_cicd/progress/{progress_id} to
obtain the result of the executed test suite.

### URL format {#cicd-GET-testsuite-results__section_od3_myv_ylb}

Versioned URL:
/api/sn_cicd/{api_version}/testsuite/results/{result_id}

Default URL:
/api/sn_cicd/testsuite/results/{result_id}  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-GET-testsuite-results__entry__2}{#cicd-GET-testsuite-results__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| result_id | Unique identifier of the test suite results to retrieve. The corresponding /sn_cicd/progress/{progress_id} endpoint call returns this information. Data type: String |
[Table 19. Path parameters]

{#cicd-GET-testsuite-results__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 20. Query parameters]

{#cicd-GET-testsuite-results__entry__12}

| Name | Description |
|-|-|
| None |   |
[Table 21. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-GET-testsuite-results__entry__16}{#cicd-GET-testsuite-results__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 22. Request headers]

{#cicd-GET-testsuite-results__entry__20}

| Header | Description |
|-|-|
| None |   |
[Table 23. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-GET-testsuite-results__entry__24}{#cicd-GET-testsuite-results__entry-200-status-code}{#cicd-GET-testsuite-results__row-401-status-code}{#cicd-GET-testsuite-results__row-403-status-code}{#cicd-GET-testsuite-results__row-404-status-code}{#cicd-GET-testsuite-results__row-405-status-code}{#cicd-GET-testsuite-results__row-409-status-code}{#cicd-GET-testsuite-results__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 409 | Conflict. The requested item isn't unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 24. Status codes]

### Response body parameters (JSON or XML)

{#cicd-GET-testsuite-results__entry__40}{#cicd-GET-testsuite-results__entry-error}{#cicd-GET-testsuite-results__entry-link}{#cicd-GET-testsuite-results__entry-links_results}{#cicd-GET-testsuite-results__entry-links_results_id}{#cicd-GET-testsuite-results__entry-links_results_url}{#cicd-GET-testsuite-results__entry-percent_complete}{#cicd-GET-testsuite-results__entry-status}{#cicd-GET-testsuite-results__entry-status_detail}{#cicd-GET-testsuite-results__entry-status_label}{#cicd-GET-testsuite-results__entry-status_message}

| Name | Description |
|-|-|
| child_suite_results | Results of nested test suites. The format of this content is the same as the parent test. |
| error | Error message. Data type: String |
| links | Object that contains all links and sys_ids associated with the response. Data type: Object |
| links.results | Object that contains the results information. Data type: Object |
| links.results.id | Unique identifier of the results information. Use this value when calling the endpoint /sn_cicd/testsuite/results/{result_id}. Data type: String |
| links.results.url | URL to use to obtain the results of the endpoint execution, such as results. Data type: String |
| percent_complete | Percentage of the request that is complete. |
| rolledup_test_error_count | Number of tests with errors. Data type: Number |
| rolledup_test_failure_count | Number of tests that failed. Data type: Number |
| rolledup_test_skip_count | Number of tests that were skipped. Data type: Number |
| rolledup_test_success_count | Number of tests that ran successfully. Data type: Number |
| status | Numeric execution state. Used with status_label, such as 0: Pending. Values: * 0 (Pending) * 1 (Running) * 2 (Successful) * 3 (Failed) * 4 (Canceled) {#cicd-GET-testsuite-results__ul_qm3_pzg_w3b} Data type: String |
| status_detail | Additional information about the current state. Data type: String |
| status_label | Execution state description. Used with status, such as 0: Pending. Values: * Pending * Running * Successful * Failed * Canceled {#cicd-GET-testsuite-results__ul_hhg_wzg_w3b} Data type: String |
| status_message | Description of the current state. Data type: String |
| test_suite_duration | Amount of time that it took to execute the test suite. Unit: Seconds Data type: String |
| test_suite_name | Name of the test suite. Data type: String |
| test_suite_status | State of the test suite. Data type: String |
[ ]

### cURL request

    curl 'instance.servicenow.com/api/sn_cicd/testsuite/results/2891389d1b1040103d374087bc4bcb09' \
    --request GET \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
    "result": {
       "links": {
           "results": {
               "id": "2891389d1b1040103d374087bc4bcb09",
               "url": "https://instance.servicenow.com/sys_atf_test_suite_result.do?sys_id=2891389d1b1040103d374087bc4bcb09"
           }
       },
       "status": "2",
       "status_label": "Successful",
       "status_message": "",
       "status_detail": "",
       "error": "",
       "test_suite_status": "success",
       "test_suite_duration": "1 Second",
       "rolledup_test_success_count": 1,
       "rolledup_test_failure_count": 0,
       "rolledup_test_error_count": 0,
       "rolledup_test_skip_count": 0,
       "test_suite_name": "Quick Test",
       "child_suite_results": []
     }
    }

## CI/CD - POST /sn_cicd/app/batch/install {#ariaid-title6}

Installs two or more packages in a single specified batch.
A batch can contain any combination of the following types:

* Application:
  * Scoped applications in the ServiceNow Store that are not owned by your company
  * Scoped or global applications in the application repository that are owned by your company
  * Your application customizations for Store applications in the application repository
  {#cicd-POST-app-batch-install__ul_plg_s4l_znb}
* ServiceNow plugin:

  Application customizations for scoped
  applications that were packaged in a plugin and were published to the application
  repository.
{#cicd-POST-app-batch-install__ul_f1s_kpp_2nb}  
Note:  
This endpoint uses an asynchronous response model. When you call an endpoint, it kicks off the associated function, such as starting the execution of the batch install plan. The endpoint then returns a response message that contains the execution status of the requested function, typically Pending, along with a unique identifier and link. Use this information to obtain additional information about the progress or results of the request.

### URL format

Versioned URL:
/api/sn_cicd/{api_version}/app/batch/install

Default URL:
/api/sn_cicd/app/batch/install  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-app-batch-install__entry__2}{#cicd-POST-app-batch-install__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
[Table 25. Path parameters]

{#cicd-POST-app-batch-install__entry__6}

| Name | Description |
|-|-|
| None |   |
[Table 26. Query parameters]

{#cicd-POST-app-batch-install__entry__10}

| Name | Description |
|-|-|
| name | Required. User specified descriptive name for this batch request. Data type: String |
| notes | User specified additional notes about the batch install plan. Data type: String Default: Null |
| packages | Required. JSON array, where each object specifies details of a package to install. Data type: Array "packages": [{ "id": "String", "load_demo_data": Boolean, "notes": "String", "requested_customization_version": "String", "requested_version": "String", "type": "String" }] |
| packages.id | Required. Sys_id of the application or identifier of the plugin to install. Data type: String |
| packages.load_demo_data | Flag that indicates whether demo data is loaded when installing the package. Valid values: * true: Demo data should be loaded. * false: Demo data should not be loaded. Data type: Boolean Default: false |
| packages.notes | User specified notes about the package. Data type: String Default: Null |
| packages.requested_customization_version | Version of the application customization to the store application or to the scoped ServiceNow plugin to install, such as 1.0.2 or 2.3. Data type: String Default: None. If this parameter is not set, then the system does not look for customizations for the application. |
| packages.requested_version | Required if packages.type is set to application; ignored if set to plugin. Version of the package to install, such as 1.0.2 or 2.3. Data type: String |
| packages.type | Required. Type of package. Valid values: * application * plugin {#cicd-POST-app-batch-install__ul_pfk_sbq_2nb} Data type: String |
[Table 27. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-app-batch-install__entry__30}{#cicd-POST-app-batch-install__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 28. Request headers]

{#cicd-POST-app-batch-install__entry__34}

| Header | Description |
|-|-|
| None |   |
[Table 29. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-app-batch-install__entry__38}{#cicd-POST-app-batch-install__entry-200-status-code}{#cicd-POST-app-batch-install__entry-405-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 405 | Invalid method. The functionality is disabled. |
[Table 30. Status codes]

### Response body parameters (JSON or XML)

{#cicd-POST-app-batch-install__entry__48}{#cicd-POST-app-batch-install__row-error}{#cicd-POST-app-batch-install__row-link}{#cicd-POST-app-batch-install__row-links_progress}{#cicd-POST-app-batch-install__row-links_progress_id}{#cicd-POST-app-batch-install__row-links_progress_url}{#cicd-POST-app-batch-install__row-percent_complete}{#cicd-POST-app-batch-install__row-status}{#cicd-POST-app-batch-install__row-status_detail}{#cicd-POST-app-batch-install__row-status_label}{#cicd-POST-app-batch-install__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | All links and sys_ids associated with the response. Data type: Object "links": { "progress": {Object}, "results": {Object}, "rollback": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| links.results | Describes the results link information. Data type: Object "results": { "id": "String", "url": "String" } |
| links.results.id | Sys_id of the results of the batch endpoint call. Use this value when calling the endpoint specified in links.results.url to query the batch install results. Data type: String |
| links.results.url | URL to use to retrieve the results of the batch install. Data type: String |
| links.rollback | Describes the batch install rollback information. Data type: Object "rollback": { "id": "String" } |
| links.rollback.id | Sys_id of the rollback details for the installed packages. Use this parameter to rollback the installation of the specified packages to their previous versions using the /sn_cicd/app/batch/rollback/{rollback_id} endpoint. Note: The rollback capability is only available after the installation is complete. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
[ ]

### cURL request {#cicd-POST-app-batch-install__example_eyp_wdq_2nb}

This example initiates a batch installation called Release 2.2 Deployment that contains
three packages (one of each type) to install.

    curl 'instance.servicenow.com/api/sn_cicd/app/batch/install \
    --request POST \
    --header 'Accept: application/json' \
    --user 'username':'password' \
    --data { "name": "Release 2.2 Deployment",
     "packages": [
       {
         "id": "syd_id_abcefghi",
         "type": "application",
         "load_demo_data": false,
         "requested_version": "1.0.2",
         "notes": "User specific text to describe this application install"
       },
       { 
         "id": "syd_id_defabcde",
         "type": "application",
         "requested_version": "1.0.0",
         "requested_customization_version": "2.0.7",
         "notes": "Customization for CSM App1"
       },
       {
         "id": "com.glide.some.plugin",
         "type": "plugin",
         "load_demo_data": true,
         "notes": "Plugin related notes"
       }]
     }

    {
    "result": {
       "links": {
         "progress": {
           "id": "c159b1e9db1c0010b5e3f6c5ae961903",
           "url": "https://instance.servicenow.com/api/sn_cicd/progress/c159b1e9db1c0010b5e3f6c5ae961903"
         },
         "results": {
           "id": "df24b1e9db2d0110b5e3f6c5ae97c561",
           "url": "https://instance.servicenow.com/api/sn_cicd/app/batch/results/df24b1e9db2d0110b5e3f6c5ae97c561"
         },
         "rollback":{
           "id": "a329f82e871da64c724ba21c82a764f2"
         },
       },
       "status": "0",
       "status_label": "Pending",
       "status_message": "",
       "status_detail": "",
       "error": "",
       "percent_complete": 0
      }
    }

## CI/CD - POST /sn_cicd/app/batch/rollback/{rollback_id} {#ariaid-title7}

Rolls back all of the packages associated with a specific batch installation to their
previous versions.
This endpoint works in conjunction with the /sn_cicd/app/batch/install
endpoint. The rollback_id is provided in the return results of this
endpoint. When this endpoint is called, it rolls back all packages specified in the
associated install; you cannot rollback individual packages. If there is no previous
version, the endpoint uninstalls the associated package.  
Note:  
This endpoint uses an asynchronous response model. When you call an endpoint, it kicks off the associated function, such as starting the execution of the batch install plan. The endpoint then returns a response message that contains the execution status of the requested function, typically Pending, along with a unique identifier and link. Use this information to obtain additional information about the progress or results of the request.

### URL format

Versioned URL: /api/sn_cicd/{api_version}/app/batch/rollback/{rollback_id}

Default URL: /api/sn_cicd/app/batch/rollback/{rollback_id}  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-app-batch-rollback__entry__2}{#cicd-POST-app-batch-rollback__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| rollback_id | Sys_id of the batch installation plan for which to rollback the installed packages to their previous versions. This value is returned in the links.rollback.id parameter of the /sn_cicd/app/batch/install endpoint. Data type: String |
[Table 31. Path parameters]

{#cicd-POST-app-batch-rollback__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 32. Query parameters]

{#cicd-POST-app-batch-rollback__entry__12}

| Name | Description |
|-|-|
| None |   |
[Table 33. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-app-batch-rollback__entry__16}{#cicd-POST-app-batch-rollback__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 34. Request headers]

{#cicd-POST-app-batch-rollback__entry__20}

| Header | Description |
|-|-|
| None |   |
[Table 35. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-app-batch-rollback__entry__24}{#cicd-POST-app-batch-rollback__entry-200-status-code}{#cicd-POST-app-batch-rollback__row-401-status-code}{#cicd-POST-app-batch-rollback__row-403-status-code}{#cicd-POST-app-batch-rollback__row-404-status-code}{#cicd-POST-app-batch-rollback__row-405-status-code}{#cicd-POST-app-batch-rollback__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 36. Status codes]

### Response body parameters (JSON or XML)

{#cicd-POST-app-batch-rollback__entry__38}{#cicd-POST-app-batch-rollback__row-error}{#cicd-POST-app-batch-rollback__row-link}{#cicd-POST-app-batch-rollback__row-links_progress}{#cicd-POST-app-batch-rollback__row-links_progress_id}{#cicd-POST-app-batch-rollback__row-links_progress_url}{#cicd-POST-app-batch-rollback__row-percent_complete}{#cicd-POST-app-batch-rollback__row-status}{#cicd-POST-app-batch-rollback__row-status_detail}{#cicd-POST-app-batch-rollback__row-status_label}{#cicd-POST-app-batch-rollback__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | All links and sys_ids associated with the response. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
[ ]

### cURL request {#cicd-POST-app-batch-rollback__example_eyp_wdq_2nb}

This example rolls back all the packages within the specified installation batch plan to
their previous version.

    curl 'instance.servicenow.com/api/sn_cicd/app/batch/rollback/a329f82e871da64c724ba21c82a764f2 \
    --request POST \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
    "result": {
       "links": {
         "progress": {
           "id": "c159b1e9db1c0010b5e3f6c5ae961903",
           "url": "https://instance.servicenow.com/api/sn_cicd/progress/c159b1e9db1c0010b5e3f6c5ae961903"
         },
       "status": "0",
       "status_label": "Pending",
       "status_message": "",
       "status_detail": "",
       "error": "",
       "percent_complete": 0
      }
    }

## CI/CD - POST /sn_cicd/app_repo/install {#ariaid-title8}

Installs the specified application from the application repository onto the instance
making the endpoint call.
Using this endpoint you are able to install both unaltered and customized ServiceNow base system and ServiceNow Store applications,
customized ServiceNow plugins, and your own ServiceNow applications.

The following outlines the parameters that you need to pass to implement specific use
cases. All parameters that are not specified are not passed in and use the associated
defaults.  
* To only install the base application and not the corresponding application customizations.
  * sys_id: Sys_id of the base application that has been customized.
  * base_app_version: Version of the base application to install.
  {#cicd-POST-app_repo-install__ul_mwp_zly_hnb}
* To install a specified version of application customizations and automatically install the recommended base application version. The recommended base application version is the version of the base application that was installed on the instance at the time that the customizations were last published. Every version of application customizations has a corresponding recommended base application version.
  * sys_id: Sys_id of the application that has been customized.
  * auto_upgrade_base_app: true
  * version: Version of the application customizations to install.
  {#cicd-POST-app_repo-install__ul_c5t_wly_hnb}
* To install the latest version of the application customizations and its corresponding recommended base application version.
  * sys_id: Sys_id of the application that has been customized.
  * auto_upgrade_base_app: true
  {#cicd-POST-app_repo-install__ul_iwh_dmy_hnb}
* To install the latest version of the application customizations, but not upgrade the base application to the application customizations recommended base application version.
  * sys_id: Sys_id of the application that has been customized.
  * auto_upgrade_base_app: false
  {#cicd-POST-app_repo-install__ul_hp1_bny_hnb}
* To install application customizations along with the scoped ServiceNow plugin of the current release.
  * scope: Scope of the plugin that has been customized OR
  * sys_id: Sys_id of the application that has been customized. This is not the ID of the plugin.
  * version: Version of the application customizations to install.
  {#cicd-POST-app_repo-install__ul_qs4_vvq_spb}
* To install application customizations for an already installed and activated scoped plugin.
  * sys_id: Sys_id of the application that has been customized. This is not the ID of the plugin.
  * auto_upgrade_base_app: false
  * version: Version of the application customizations to install.
  {#cicd-POST-app_repo-install__ul_ubt_jh5_mpb}

Since base plugins can have only one version per family release, the auto_upgrade_base_app and base_app_version parameters don't apply to application customization installs for plugins.
To activate a plugin for the first time on an instance, use the /sn_cicd/plugin/{plugin_id}/activate endpoint instead.  
Note:  
This endpoint uses an asynchronous response model. When you call an endpoint, it kicks off the associated function, such as starting the execution of the batch install plan. The endpoint then returns a response message that contains the execution status of the requested function, typically Pending, along with a unique identifier and link. Use this information to obtain additional information about the progress or results of the request.

### URL format {#cicd-POST-app_repo-install__section_jrg_tbw_ylb}

Versioned URL:
/api/sn_cicd/{api_version}/app_repo/install

Default URL:
/api/sn_cicd/app_repo/install  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-app_repo-install__entry__2}{#cicd-POST-app_repo-install__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
[Table 37. Path parameters]

{#cicd-POST-app_repo-install__entry__6}

| Name | Description |
|-|-|
| auto_upgrade_base_app | Only applicable if you intend to install application customizations and the base application was built on a version that is later than the currently installed version. Flag that indicates whether the associated base application should be automatically upgraded to a later version. Valid values: * true: Automatically upgrade the associated base application. * false: Leave the base application as the version currently installed on the instance. {#cicd-POST-app_repo-install__ul_nm2_rgx_2nb} Data type: Boolean Default: false |
| base_app_version | Version of the base application to install. A base application is any third-party application that is available in theServiceNow Store. If the application has no application customizations, or if the application has application customizations and you are only updating the base application, then enter the updated version of the application in this parameter. If you are updating application customizations, don't pass this parameter, but rather pass the version parameter. Data type: String Default: Null |
| scope | Required if sys_id is not specified. Scope name of the application, such as x_aah_custom_app. Data type: String Table: In the scope field in the Custom Application \[sys_app\] table or Store Application \[sys_store_app\] table. |
| sys_id | Required if scope is not specified. Sys_id of the application to install. Data type: String Table: In the Sys ID field in the Custom Application \[sys_app\] table or Store Application \[sys_store_app\] table. |
| version | Version of the application to install. Data type: String Default: If the base_app_version parameter is empty and the auto_upgrade_base_app parameter is set to true, installs the latest application customizations and its recommended base application version (as long as it doesn't downgrade the base application.) If the auto_upgrade_base_app parameter is false, installs the application customizations, but the base application is not upgraded. If the base_app_version parameter is defined, only installs the base application. |
[Table 38. Query parameters]

{#cicd-POST-app_repo-install__entry__18}

| Name | Description |
|-|-|
| None |   |
[Table 39. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-app_repo-install__entry__22}{#cicd-POST-app_repo-install__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 40. Request headers]

{#cicd-POST-app_repo-install__entry__26}

| Header | Description |
|-|-|
| None |   |
[Table 41. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-app_repo-install__entry__30}{#cicd-POST-app_repo-install__entry-200-status-code}{#cicd-POST-app_repo-install__row-401-status-code}{#cicd-POST-app_repo-install__row-403-status-code}{#cicd-POST-app_repo-install__row-404-status-code}{#cicd-POST-app_repo-install__row-405-status-code}{#cicd-POST-app_repo-install__row-409-status-code}{#cicd-POST-app_repo-install__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 409 | Conflict. The requested item isn't unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 42. Status codes]

### Response body parameters (JSON or XML)

{#cicd-POST-app_repo-install__entry__46}{#cicd-POST-app_repo-install__row-error}{#cicd-POST-app_repo-install__row-link}{#cicd-POST-app_repo-install__row-links_progress}{#cicd-POST-app_repo-install__row-links_progress_id}{#cicd-POST-app_repo-install__row-links_progress_url}{#cicd-POST-app_repo-install__row-percent_complete}{#cicd-POST-app_repo-install__row-status}{#cicd-POST-app_repo-install__row-status_detail}{#cicd-POST-app_repo-install__row-status_label}{#cicd-POST-app_repo-install__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| rollback_version | If available, the previously installed version. If not available, null. Data type: String |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
[ ]

### cURL request

    curl 'instance.servicenow.com/api/sn_cicd/app_repo/install?sys_id=2d146921dbd80010caf55268dc9619d8' \
    --request POST \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
    "result": {
       "links": {
         "progress": {
            "id": "c159b1e9db1c0010b5e3f6c5ae961903",
            "url": "https://instance.servicenow.com/api/sn_cicd/progress/c159b1e9db1c0010b5e3f6c5ae961903"
          }
       },
       "status": "0",
       "status_label": "Pending",
       "status_message": "",
       "status_detail": "",
       "error": "",
       "percent_complete": 0,
       "rollback_version": "1.1.0"
      }
    }

## CI/CD - POST /sn_cicd/app_repo/publish {#ariaid-title9}

Publishes the specified application and all of its artifacts to the application
repository.
Note:  
If there are uncommitted changes to tracked files when you call this endpoint, it returns a 400 Bad Request status code. You can either commit the changes manually in Studio or call the [CI/CD - POST /sn_cicd/sc/apply_changes](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-POST-sc-apply_changes "Starts applying changes from a remote source control to a specified local application or application-customization.") endpoint to stash the changes. Changes that aren't tracked in the Customer Updates \[sys_update_xml\] table are committed automatically after publishing to the application repository. For information about the layout of the changes in the Customer Updates table and a description of the changes that aren't represented in this table, see [Customer Updates table](https://www.servicenow.com/docs/access?context=r_CustomerUpdatesTable&version=yokohama&pubname=yokohama-platform-security&ft:locale=en-US).

### URL format {#cicd-POST-app_repo-publish__section_zbt_tpb_zlb}

Versioned URL: /api/sn_cicd/{api_version}/app_repo/publish

Default URL:
/api/sn_cicd/app_repo/publish  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-app_repo-publish__entry__2}{#cicd-POST-app_repo-publish__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
[Table 43. Path parameters]

{#cicd-POST-app_repo-publish__entry__6}

| Name | Description |
|-|-|
| dev_notes | Developer notes to store with the application. Data type: String |
| scope | Required if sys_id isn't specified. The scope of the application. Data type: String Table: In the scope field of the Custom Application \[sys_app\] table. |
| sys_id | Required if scope isn't specified. The sys_id of the application to store in the repository. Data type: String Table: In the Sys ID field of the Custom Application \[sys_app\] table. |
| version | Version under which to store the application. If the version number is passed, the publish process uses that version and updates the local application version if different. If the version number isn't passed, the publish process uses the current version of the local application and fails if that version exists in the application repository. Data type: String |
[Table 44. Query parameters]

{#cicd-POST-app_repo-publish__entry__16}

| Name | Description |
|-|-|
| None |   |
[Table 45. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-app_repo-publish__entry__20}{#cicd-POST-app_repo-publish__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 46. Request headers]

{#cicd-POST-app_repo-publish__entry__24}

| Header | Description |
|-|-|
| None |   |
[Table 47. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-app_repo-publish__entry__28}{#cicd-POST-app_repo-publish__entry-200-status-code}{#cicd-POST-app_repo-publish__row-401-status-code}{#cicd-POST-app_repo-publish__row-403-status-code}{#cicd-POST-app_repo-publish__row-404-status-code}{#cicd-POST-app_repo-publish__row-405-status-code}{#cicd-POST-app_repo-publish__row-409-status-code}{#cicd-POST-app_repo-publish__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Request failed. Possible issues: * The application version isn't correct or is a downgrade. * The application is connected to source control and contains uncommitted changes that must be resolved. Consult the returned error message for additional information. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 409 | Conflict. The requested item isn't unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 48. Status codes]

### Response body parameters (JSON or XML)

{#cicd-POST-app_repo-publish__entry__46}{#cicd-POST-app_repo-publish__row-error}{#cicd-POST-app_repo-publish__row-link}{#cicd-POST-app_repo-publish__row-links_progress}{#cicd-POST-app_repo-publish__row-links_progress_id}{#cicd-POST-app_repo-publish__row-links_progress_url}{#cicd-POST-app_repo-publish__row-percent_complete}{#cicd-POST-app_repo-publish__row-status}{#cicd-POST-app_repo-publish__row-status_detail}{#cicd-POST-app_repo-publish__row-status_label}{#cicd-POST-app_repo-publish__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
[ ]

The following example shows how to publish the application with the specified sys_id and all of its artifacts to the application repository.

    curl 'instance.servicenow.com/api/sn_cicd/app_repo/publish?sys_id=4dd9686d1b9800103d374087bc4bcb3d' \
    --request POST \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
    "result": {
       "links": {
           "progress": {
               "id": "d174f8e11bd800103d374087bc4bcbd9",
               "url": "https://instance.service-now.com/api/sn_cicd/progress/d174f8e11bd800103d374087bc4bcbd9"
            }
        },
        "status": "0",
        "status_label": "Pending",
        "status_message": "",
        "status_detail": "",
        "error": "",
        "percent_complete": 0
      }
    }

## CI/CD - POST /sn_cicd/app_repo/rollback {#ariaid-title10}

Initiates a rollback of a specified application to a specified version.
Note:  
The rollback functionality is only available after the installation is complete.

### URL format {#cicd-POST-app_repo-rollback__section_hhk_brb_zlb}

Versioned URL:
/api/sn_cicd/{api_version}/app_repo/rollback

Default URL:
/api/sn_cicd/app_repo/rollback  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-app_repo-rollback__entry__2}{#cicd-POST-app_repo-rollback__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
[Table 49. Path parameters]

{#cicd-POST-app_repo-rollback__entry__6}

| Name | Description |
|-|-|
| scope | Required if sys_id is not specified. The scope name of the application to rollback. Data type: String |
| sys_id | Required if scope is not specified. The sys_id of the application to rollback. Data type: String |
| version | Required. Version of the application that is expected after the rollback operation. If the request is to rollback an App Customization install, then set this field to the version of the base application that the system is expected to have after the rollback operation. Data type: String |
[Table 50. Query parameters]

{#cicd-POST-app_repo-rollback__entry__14}

| Name | Description |
|-|-|
| None |   |
[Table 51. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-app_repo-rollback__entry__18}{#cicd-POST-app_repo-rollback__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 52. Request headers]

{#cicd-POST-app_repo-rollback__entry__22}

| Header | Description |
|-|-|
| None |   |
[Table 53. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-app_repo-rollback__entry__26}{#cicd-POST-app_repo-rollback__entry-200-status-code}{#cicd-POST-app_repo-rollback__row-401-status-code}{#cicd-POST-app_repo-rollback__row-403-status-code}{#cicd-POST-app_repo-rollback__row-405-status-code}{#cicd-POST-app_repo-rollback__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 405 | Invalid method. The functionality is inactive. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 54. Status codes]

### Response body parameters (JSON or XML)

{#cicd-POST-app_repo-rollback__entry__38}{#cicd-POST-app_repo-rollback__row-error}{#cicd-POST-app_repo-rollback__row-link}{#cicd-POST-app_repo-rollback__row-links_progress}{#cicd-POST-app_repo-rollback__row-links_progress_id}{#cicd-POST-app_repo-rollback__row-links_progress_url}{#cicd-POST-app_repo-rollback__row-percent_complete}{#cicd-POST-app_repo-rollback__row-status}{#cicd-POST-app_repo-rollback__row-status_detail}{#cicd-POST-app_repo-rollback__row-status_label}{#cicd-POST-app_repo-rollback__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
[ ]

### cURL request

    curl 'instance.servicenow.com/api/sn_cicd/app_repo/rollback?sys_id=2d146921dbd80010caf55268dc9619d8&version=1.1.0' \
    --request POST \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
    "result": {
       "links": {
          "progress": {
              "id": "f7ddb1eddb1c0010b5e3f6c5ae9619c1",
              "url": "https://instance.service-now.com/api/sn_cicd/progress/f7ddb1eddb1c0010b5e3f6c5ae9619c1"
           }
       },
       "status": "0",
       "status_label": "Pending",
       "status_message": "",
       "status_detail": "",
       "error": "",
       "percent_complete": 0
      }
    }

## CI/CD - POST /sn_cicd/instance_scan/full_scan {#ariaid-title11}

Runs all active checks present in your instance.
You can run checks that are provided with Instance Scan
or you can create your own checks. For more information, see [Instance Scan](https://www.servicenow.com/docs/access?context=hs-landing-page&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US).  
Note:  
This endpoint is part of the CICD Instance Scan Execution Service API and is used under the `sn_cicd` namespace.

### URL format

Versioned URL:
/api/sn_cicd/{api_version}/instance_scan/full_scan

Default URL:
/api/sn_cicd/instance_scan/full_scan  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-instancescan-fullscan__entry__2}{#cicd-POST-instancescan-fullscan__version-not_optional-RESTAPI}

| Parameter | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
[Table 55. Parameters]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-instancescan-fullscan__entry__6}{#cicd-POST-instancescan-fullscan__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 56. Request headers]

{#cicd-POST-instancescan-fullscan__entry__10}

| Header | Description |
|-|-|
| None |   |
[Table 57. Response headers]

### Status codes

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-instancescan-fullscan__table_wwn_rhd_ct__entry__2}{#cicd-POST-instancescan-fullscan__entry-200-status-code}{#cicd-POST-instancescan-fullscan__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 58. Status codes]

{#cicd-POST-instancescan-fullscan__table_wwn_rhd_ct}

### Request body

The API accepts these JSON or XML elements in the request body.
{#cicd-POST-instancescan-fullscan__table_rm1_yjd_kv__entry__2}

| Element | Description |
|-|-|
| None |   |
[Table 59. Elements accepted in the request body]

{#cicd-POST-instancescan-fullscan__table_rm1_yjd_kv}

### Response body

The API returns these JSON or XML elements in the response body.
{#cicd-POST-instancescan-fullscan__table_mc1_pr1_tx__entry__2}{#cicd-POST-instancescan-fullscan__entry-error}{#cicd-POST-instancescan-fullscan__entry-link}{#cicd-POST-instancescan-fullscan__entry-links_progress}{#cicd-POST-instancescan-fullscan__entry-progress_url}{#cicd-POST-instancescan-fullscan__entry-status}{#cicd-POST-instancescan-fullscan__entry-status_detail}{#cicd-POST-instancescan-fullscan__entry-status_label}{#cicd-POST-instancescan-fullscan__entry-healthscan_status_message}

| Element | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Unique identifier of the progress detail. Use this value when calling the endpoint /sn_cicd/instance_scan/result/{progress_id}. |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional information about why the operation failed. Returns an empty string if the operation is successful. Data type: String |
[Table 60. Elements returned in the response body]

{#cicd-POST-instancescan-fullscan__table_mc1_pr1_tx}  

### Sample cURL request

    curl 'instance.service-now.com/api/sn_cicd/instance_scan/full_scan' \
    --request POST \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
    "result": {
       "links": {
           "progress": {
               "id": "a4fae8911bdc00103d374087bc4bcbbd",
               "url": "https://instance.service-now/api/sn_cicd/progress/a4fae8911bdc00103d374087bc4bcbbd"
            }
        },
        "status": "0",
        "status_label": "Pending",
        "status_message": "",
        "status_detail": "",
        "error": ""
      }
    }

## CI/CD - POST /sn_cicd/instance_scan/point_scan {#ariaid-title12}

Executes all applicable checks against a specified record.
For example, if you execute a point scan against a Catalog Item, only the checks applicable
to the Catalog Item table run, and only the specified record is scanned.

You can run checks that are provided with Instance Scan
or you can create your own checks. For more information, see [Instance Scan](https://www.servicenow.com/docs/access?context=hs-landing-page&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US).  
Note:  
This endpoint is part of the CICD Instance Scan Execution Service API and is used under the `sn_cicd` namespace.

### URL format

Versioned URL:
/api/sn_cicd/{api_version}/instance_scan/point_scan

Default URL:
/api/sn_cicd/instance_scan/point_scan  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-instancescan-pointscan__entry__2}{#cicd-POST-instancescan-pointscan__version-not_optional-RESTAPI}

| Parameter | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| target_table | Required. Name of the table in which the record to scan resides, such as "Incident." Data type: String |
| target_sys_id | Required. The sys_id of the record within the specified table to scan. Data type: String |
[Table 61. Parameters]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-instancescan-pointscan__entry__10}{#cicd-POST-instancescan-pointscan__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 62. Request headers]

{#cicd-POST-instancescan-pointscan__entry__14}

| Header | Description |
|-|-|
| None |   |
[Table 63. Response headers]

### Status codes

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-instancescan-pointscan__table_wwn_rhd_ct__entry__2}{#cicd-POST-instancescan-pointscan__entry-200-status-code}{#cicd-POST-instancescan-pointscan__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 400 | Bad Request. Invalid or empty query parameters. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 64. Status codes]

{#cicd-POST-instancescan-pointscan__table_wwn_rhd_ct}

### Request body

The API accepts these JSON or XML elements in the request body.
{#cicd-POST-instancescan-pointscan__table_rm1_yjd_kv__entry__2}

| Element | Description |
|-|-|
| None |   |
[Table 65. Elements accepted in the request body]

{#cicd-POST-instancescan-pointscan__table_rm1_yjd_kv}

### Response body

The API returns these JSON or XML elements in the response body.
{#cicd-POST-instancescan-pointscan__table_mc1_pr1_tx__entry__2}{#cicd-POST-instancescan-pointscan__entry-error}{#cicd-POST-instancescan-pointscan__entry-link}{#cicd-POST-instancescan-pointscan__entry-links_progress}{#cicd-POST-instancescan-pointscan__entry-progress_url}{#cicd-POST-instancescan-pointscan__entry-status}{#cicd-POST-instancescan-pointscan__entry-status_detail}{#cicd-POST-instancescan-pointscan__entry-status_label}{#cicd-POST-instancescan-pointscan__entry-healthscan_status_message}

| Element | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Unique identifier of the progress detail. Use this value when calling the endpoint /sn_cicd/instance_scan/result/{progress_id}. |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional information about why the operation failed. Returns an empty string if the operation is successful. Data type: String |
[Table 66. Elements returned in the response body]

{#cicd-POST-instancescan-pointscan__table_mc1_pr1_tx}  

### Sample cURL request

    curl 'instance.service-now.com/api/sn_cicd/instance_scan/point_scan?target_table=incident&target_sys_id=2d146921dbd80010caf55268dc9619d8' \
    --request POST \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
    "result": {
       "links": {
           "progress": {
               "id": "a4fae8911bdc00103d374087bc4bcbbd",
               "url": "https://instance.service-now/api/sn_cicd/progress/a4fae8911bdc00103d374087bc4bcbbd"
            }
        },
        "status": "0",
        "status_label": "Pending",
        "status_message": "",
        "status_detail": "",
        "error": ""
      }
    }

## CI/CD - POST /sn_cicd/instance_scan/suite_scan/combo/{combo_sys_id} {#ariaid-title13}

Runs a scan using a suite and target (scoped apps or update sets) that have already run
previously.
Before calling this endpoint, you must call the /sn_cicd/instance_scan/suite_scan/{suite_sys_id}/scoped_apps or
/sn_cicd/instance_scan/suite_scan/{suite_sys_id}/update_sets endpoints,
or [execute a suite scan](https://www.servicenow.com/docs/access?context=hc-execute-suite-scan&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US) in the
UI.  
Note:  
This endpoint is part of the CICD Instance Scan Execution Service API and is used under the `sn_cicd` namespace.

### URL format {#cicd-POST-instancescan-ss-combo__section_yhg_mkk_fpb}

Versioned URL:
/api/sn_cicd/{api_version}/instance_scan/suite_scan/combo/{combo_sys_id}

Default URL:
/api/sn_cicd/instance_scan/suite_scan/combo/{combo_sys_id}  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-instancescan-ss-combo__entry__2}{#cicd-POST-instancescan-ss-combo__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| combo_sys_id | Sys_id of the scan to run. The scan must be an existing scan that you want to re-run. Data type: String Table: Combo \[scan_combo\] |
[Table 67. Path parameters]

{#cicd-POST-instancescan-ss-combo__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 68. Query parameters]

{#cicd-POST-instancescan-ss-combo__entry__12}

| Name | Description |
|-|-|
| None |   |
[Table 69. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-instancescan-ss-combo__entry__16}{#cicd-POST-instancescan-ss-combo__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 70. Request headers]

{#cicd-POST-instancescan-ss-combo__entry__20}

| Header | Description |
|-|-|
| None |   |
[Table 71. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-instancescan-ss-combo__table_wwn_rhd_ct__entry__2}{#cicd-POST-instancescan-ss-combo__entry-200-status-code}{#cicd-POST-instancescan-ss-combo__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 72. Status codes]

{#cicd-POST-instancescan-ss-combo__table_wwn_rhd_ct}

### Response body parameters (JSON or XML)

{#cicd-POST-instancescan-ss-combo__entry__34}{#cicd-POST-instancescan-ss-combo__entry-error}{#cicd-POST-instancescan-ss-combo__entry-link}{#cicd-POST-instancescan-ss-combo__entry-links_progress}{#cicd-POST-instancescan-ss-combo__entry-progress_url}{#cicd-POST-instancescan-ss-combo__entry-status}{#cicd-POST-instancescan-ss-combo__entry-status_detail}{#cicd-POST-instancescan-ss-combo__entry-status_label}{#cicd-POST-instancescan-ss-combo__entry-healthscan_status_message}

| Element | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Unique identifier of the progress detail. Use this value when calling the endpoint /sn_cicd/instance_scan/result/{progress_id}. Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional information about why the operation failed. Returns an empty string if the operation is successful. Data type: String |
[ ]

### cURL request

<br />

    curl "https://instance.servicenow.com/api/sn_cicd/instance_scan/suite_scan/combo/245d29cc1bd32010178aed72604bcb4b" \
    --request POST \
    --header "Accept:application/json" \
    --user 'username':'password'

Response body - success.

    {
      "result": {
        "links": {
          "progress": {
            "id": "c08be5c71b1b2010178aed72604bcb6e",
            "url": "https://instance.servicenow.com/api/sn_cicd/progress/c08be5c71b1b2010178aed72604bcb6e"
          }
        },
        "status": "0",
        "status_label": "Pending",
        "status_message": "",
        "status_detail": "",
        "error": ""
      }
    }

## CI/CD - POST /sn_cicd/instance_scan/suite_scan/{suite_sys_id}/scoped_apps {#ariaid-title14}

Runs all active checks inside a suite against a list of scoped apps.
Note:  
This endpoint is part of the CICD Instance Scan Execution Service API and is used under the `sn_cicd` namespace.

### URL format

Versioned URL:
/api/sn_cicd/{api_version}/instance_scan/suite_scan/{suite_sys_id}/scoped_apps

Default URL:
/api/sn_cicd/instance_scan/suite_scan/{suite_sys_id}/scoped_apps  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-instancescan-ss-sa__entry__2}{#cicd-POST-instancescan-ss-sa__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| suite_sys_id | Sys_id of the [suite](https://www.servicenow.com/docs/access?context=hc-suites-mgmt&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US) to run. Data type: String Table: Suite \[scan_check_suite\] |
[Table 73. Path parameters]

{#cicd-POST-instancescan-ss-sa__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 74. Query parameters]

{#cicd-POST-instancescan-ss-sa__entry__12}

| Name | Description |
|-|-|
| app_scope_sys_ids | Required. A list of sys_ids of the scoped applications to scan. Can't be an empty array. Data type: Array app_scope_sys_ids: ["String", "String", "String"] Table: Application \[sys_scope\] |
[Table 75. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-instancescan-ss-sa__entry__16}{#cicd-POST-instancescan-ss-sa__accept-RESTAPI}{#cicd-POST-instancescan-ss-sa__content_type-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
| Content-Type | Data format of the request body. Only supports application/json. |
[Table 76. Request headers]

{#cicd-POST-instancescan-ss-sa__entry__22}

| Header | Description |
|-|-|
| None |   |
[Table 77. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-instancescan-ss-sa__table_wwn_rhd_ct__entry__2}{#cicd-POST-instancescan-ss-sa__entry-200-status-code}{#cicd-POST-instancescan-ss-sa__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 78. Status codes]

{#cicd-POST-instancescan-ss-sa__table_wwn_rhd_ct}

### Response body parameters (JSON or XML)

{#cicd-POST-instancescan-ss-sa__entry__36}{#cicd-POST-instancescan-ss-sa__entry-error}{#cicd-POST-instancescan-ss-sa__entry-link}{#cicd-POST-instancescan-ss-sa__entry-links_progress}{#cicd-POST-instancescan-ss-sa__entry-progress_url}{#cicd-POST-instancescan-ss-sa__entry-status}{#cicd-POST-instancescan-ss-sa__entry-status_detail}{#cicd-POST-instancescan-ss-sa__entry-status_label}{#cicd-POST-instancescan-ss-sa__entry-healthscan_status_message}

| Element | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Unique identifier of the progress detail. Use this value when calling the endpoint /sn_cicd/instance_scan/result/{progress_id}. Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional information about why the operation failed. Returns an empty string if the operation is successful. Data type: String |
[ ]

### cURL request

This example runs all active checks inside a suite against one scoped application.

    curl "https://instance.servicenow.com/api/sn_cicd/instance_scan/suite_scan/833655cc1b94101046e87733cd4bcb4e/scoped_apps" \
    --request POST \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data "{app_scope_sys_ids: [\"078e8020950f12a215a92e8ad9b346e0\"]}" \
    --user 'username':'password'

Response body - success.

    {
      "result": {
        "links": {
          "progress": {
            "id": "147fc14b1b572010178aed72604bcbca",
            "url": "https://instance.servicenow.com/api/sn_cicd/progress/147fc14b1b572010178aed72604bcbca"
          }
        },
        "status": "0",
        "status_label": "Pending",
        "status_message": "",
        "status_detail": "",
        "error": ""
      }
    }

## CI/CD - POST /sn_cicd/instance_scan/suite_scan/{suite_sys_id}/update_sets {#ariaid-title15}

Runs all active checks inside a suite against a list of update sets.
Note:  
This endpoint is part of the CICD Instance Scan Execution Service API and is used under the `sn_cicd` namespace.

### URL format {#cicd-POST-instancescan-ss-us__section_yhg_mkk_fpb}

Versioned URL:
/api/sn_cicd/{api_version}/instance_scan/suite_scan/{suite_sys_id}/update_sets

Default URL:
/api/sn_cicd/instance_scan/suite_scan/{suite_sys_id}/update_sets  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-instancescan-ss-us__entry__2}{#cicd-POST-instancescan-ss-us__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| suite_sys_id | Sys_id of the [suite](https://www.servicenow.com/docs/access?context=hc-suites-mgmt&version=yokohama&pubname=yokohama-platform-administration&ft:locale=en-US) to run. Data type: String Table: Suite \[scan_check_suite\] |
[Table 79. Path parameters]

{#cicd-POST-instancescan-ss-us__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 80. Query parameters]

{#cicd-POST-instancescan-ss-us__entry__12}

| Name | Description |
|-|-|
| update_set_sys_ids | Required. List of sys_ids of the update sets to scan. Can't be an empty array. Data type: Array update_set_sys_ids: ["String", "String", "String"] Table: Update Set \[sys_update_set\] |
[Table 81. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-instancescan-ss-us__table_dm1_1pk_fpb__entry__2}{#cicd-POST-instancescan-ss-us__accept-RESTAPI}{#cicd-POST-instancescan-ss-us__content_type-JSON-only-entry-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
| Content-Type | Data format of the request body. Only supports application/json. |
[Table 82. Request headers]

{#cicd-POST-instancescan-ss-us__table_dm1_1pk_fpb} {#cicd-POST-instancescan-ss-us__entry__22}

| Header | Description |
|-|-|
| None |   |
[Table 83. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-instancescan-ss-us__table_wwn_rhd_ct__entry__2}{#cicd-POST-instancescan-ss-us__entry-200-status-code}{#cicd-POST-instancescan-ss-us__entry-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 84. Status codes]

{#cicd-POST-instancescan-ss-us__table_wwn_rhd_ct}

### Response body parameters (JSON or XML)

{#cicd-POST-instancescan-ss-us__entry__36}{#cicd-POST-instancescan-ss-us__entry-error}{#cicd-POST-instancescan-ss-us__entry-link}{#cicd-POST-instancescan-ss-us__entry-links_progress}{#cicd-POST-instancescan-ss-us__entry-progress_url}{#cicd-POST-instancescan-ss-us__entry-status}{#cicd-POST-instancescan-ss-us__entry-status_detail}{#cicd-POST-instancescan-ss-us__entry-status_label}{#cicd-POST-instancescan-ss-us__entry-healthscan_status_message}

| Element | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Unique identifier of the progress detail. Use this value when calling the endpoint /sn_cicd/instance_scan/result/{progress_id}. Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional information about why the operation failed. Returns an empty string if the operation is successful. Data type: String |
[ ]

### cURL request

This example runs all active checks inside a suite against one update set.

    curl "https://instance.servicenow.com/api/sn_cicd/instance_scan/suite_scan/833655cc1b94101046e87733cd4bcb4e/update_sets" \
    --request POST \
    --header "Accept:application/json" \
    --header "Content-Type:application/json" \
    --data "{update_set_sys_ids: [\"7abef63c1b572010178aed72604bcbfd\"]}" \
    --user 'username':'password'

Response body - success.

    {
      "result": {
        "links": {
          "progress": {
            "id": "d27511031b972010178aed72604bcb72",
            "url": "https://instance.servicenow.com/api/sn_cicd/progress/d27511031b972010178aed72604bcb72"
          }
        },
        "status": "0",
        "status_label": "Pending",
        "status_message": "",
        "status_detail": "",
        "error": ""
      }
    }

## CI/CD - POST /sn_cicd/plugin/{plugin_id}/activate {#ariaid-title16}

Activates the specified plugin.

### URL format {#cicd-POST-plugin-activate__section_ufb_vrk_zlb}

Versioned URL:
/api/sn_cicd/{api_version}/plugin/{plugin_id}/activate

Default URL:
/api/sn_cicd/plugin/{plugin_id}/activate  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-plugin-activate__entry__2}{#cicd-POST-plugin-activate__version-not_optional-RESTAPI}{#cicd-POST-plugin-activate__entry-plugin_id}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| plugin_id | Unique identifier of the plugin. You can locate this identifier on the Plugins page within the card of the desired plugin; identified with the name "ID". Data type: String |
[Table 85. Path parameters]

{#cicd-POST-plugin-activate__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 86. Query parameters]

{#cicd-POST-plugin-activate__entry__12}

| Name | Description |
|-|-|
| None |   |
[Table 87. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-plugin-activate__entry__16}{#cicd-POST-plugin-activate__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 88. Request headers]

{#cicd-POST-plugin-activate__entry__20}

| Header | Description |
|-|-|
| None |   |
[Table 89. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-plugin-activate__entry__24}{#cicd-POST-plugin-activate__entry-200-status-code}{#cicd-POST-plugin-activate__row-401-status-code}{#cicd-POST-plugin-activate__row-403-status-code}{#cicd-POST-plugin-activate__row-404-status-code}{#cicd-POST-plugin-activate__row-405-status-code}{#cicd-POST-plugin-activate__row-409-status-code}{#cicd-POST-plugin-activate__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 409 | Conflict. The requested item isn't unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 90. Status codes]

### Response body parameters (JSON or XML)

{#cicd-POST-plugin-activate__entry__40}{#cicd-POST-plugin-activate__row-error}{#cicd-POST-plugin-activate__row-link}{#cicd-POST-plugin-activate__row-links_progress}{#cicd-POST-plugin-activate__row-links_progress_id}{#cicd-POST-plugin-activate__row-links_progress_url}{#cicd-POST-plugin-activate__row-links_results}{#cicd-POST-plugin-activate__row-links_results_id}{#cicd-POST-plugin-activate__row-links_results_url}{#cicd-POST-plugin-activate__row-percent_complete}{#cicd-POST-plugin-activate__row-status}{#cicd-POST-plugin-activate__row-status_detail}{#cicd-POST-plugin-activate__row-status_label}{#cicd-POST-plugin-activate__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| links.results | ID and URL of the execution results. Data type: Object "results": { "id": "String", "url": "String" } |
| links.results.id | Sys_id of the results information. Use this value when calling the associated results endpoint. Data type: String |
| links.results.url | URL to use to obtain the results of the endpoint execution. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
[ ]

### cURL request

    curl 'instance.servicenow.com/api/sn_cicd/plugin/com.glide.web_service_aggregate/activate' \
    --request POST \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
    "result": {
       "links": {
          "progress": {
              "id": "5b3f052ddb580010caf55268dc961963",
              "url": "https://instance.service-now.com/api/sn_cicd/progress/5b3f052ddb580010caf55268dc961963"
           }
       },
       "status": "0",
       "status_label": "Pending",
       "status_message": "",
       "status_detail": "",
       "error": "",
       "percent_complete": 0
      }
    }

## CI/CD - POST /sn_cicd/plugin/{plugin_id}/rollback {#ariaid-title17}

Rolls back the specified plugin to the previous installed version. If no prior version
has been installed, returns an error.
<br />

### URL format {#cicd-POST-plugin-rollback__section_zrh_q5k_zlb}

Versioned URL:
/api/sn_cicd/{api_version}plugin/{plugin_id}/rollback

Default URL:
/api/sn_cicd/plugin/{plugin_id}/rollback  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-plugin-rollback__entry__2}{#cicd-POST-plugin-rollback__version-not_optional-RESTAPI}{#cicd-POST-plugin-rollback__entry-plugin_id}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| plugin_id | Unique identifier of the plugin. You can locate this identifier on the Plugins page within the card of the desired plugin; identified with the name "ID". Data type: String |
[Table 91. Path parameters]

{#cicd-POST-plugin-rollback__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 92. Query parameters]

{#cicd-POST-plugin-rollback__entry__12}

| Name | Description |
|-|-|
| None |   |
[Table 93. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-plugin-rollback__entry__16}{#cicd-POST-plugin-rollback__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 94. Request headers]

{#cicd-POST-plugin-rollback__entry__20}

| Header | Description |
|-|-|
| None |   |
[Table 95. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-plugin-rollback__entry__24}{#cicd-POST-plugin-rollback__entry-200-status-code}{#cicd-POST-plugin-rollback__row-401-status-code}{#cicd-POST-plugin-rollback__row-403-status-code}{#cicd-POST-plugin-rollback__row-404-status-code}{#cicd-POST-plugin-rollback__row-405-status-code}{#cicd-POST-plugin-rollback__row-409-status-code}{#cicd-POST-plugin-rollback__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 409 | Conflict. The requested item isn't unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 96. Status codes]

### Response body parameters (JSON or XML)

{#cicd-POST-plugin-rollback__entry__40}{#cicd-POST-plugin-rollback__row-error}{#cicd-POST-plugin-rollback__row-link}{#cicd-POST-plugin-rollback__row-links_progress}{#cicd-POST-plugin-rollback__row-links_progress_id}{#cicd-POST-plugin-rollback__row-links_progress_url}{#cicd-POST-plugin-rollback__row-percent_complete}{#cicd-POST-plugin-rollback__row-status}{#cicd-POST-plugin-rollback__row-status_detail}{#cicd-POST-plugin-rollback__row-status_label}{#cicd-POST-plugin-rollback__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
[ ]

### cURL request

    curl 'instance.servicenow.com/api/sn_cicd/plugin/com.glide.web_service_aggregate/rollback' \
    --request POST \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
    "result": {
       "links": {
          "progress": {
             "id": "6185dd61db980010caf55268dc961916",
              "url": "https://instance.service-now.com/api/sn_cicd/progress/6185dd61db980010caf55268dc961916"
            }
        },
        "status": "0",
        "status_label": "Pending",
        "status_message": "",
        "status_detail": "",
        "error": "",
        "percent_complete": 0
      }
    }

## CI/CD - POST /sn_cicd/sc/apply_changes {#ariaid-title18}

Starts applying changes from a remote source control to a specified local application
or application-customization.

### URL format

Versioned URL:
/api/sn_cicd/{api_version}/sc/apply_changes

Default URL:
/api/sn_cicd/sc/apply_changes  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-sc-apply_changes__entry__2}{#cicd-POST-sc-apply_changes__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
[Table 97. Path parameters]

{#cicd-POST-sc-apply_changes__entry__6}

| Name | Description |
|-|-|
| auto_upgrade_base_app | Only applicable when changes are applied for app-customization and the latest commit on the Git repository is built on a version that is later than that of the base application that is currently installed on the local instance. Flag that indicates whether the system should auto upgrade the base application to a later version. Data type: Boolean Default: true |
| branch_name | Name of the branch in the source control system from which to acquire the application. Data type: String Default: Default branch specified on the source control system. |
| scope | Required if sys_id is not specified. The scope name of the application for which to apply the changes, such as x_aah_custom_app. You can locate this value in the scope field in the Custom Application \[sys_app\] table or Store Application \[sys_store_app\] table for the app-customization. Data type: String |
| sys_id | Required if scope is not specified. The sys_id of the application for which to apply the changes. You can locate this value in the Sys ID field in the Custom Application \[sys_app\] table or Store Application \[sys_store_app\] table for the app-customization. Data type: String |
[Table 98. Query parameters]

{#cicd-POST-sc-apply_changes__entry__16}

| Name | Description |
|-|-|
| None |   |
[Table 99. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-sc-apply_changes__entry__20}{#cicd-POST-sc-apply_changes__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 100. Request headers]

{#cicd-POST-sc-apply_changes__entry__24}

| Header | Description |
|-|-|
| None |   |
[Table 101. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-sc-apply_changes__entry__28}{#cicd-POST-sc-apply_changes__entry-200-status-code}{#cicd-POST-sc-apply_changes__row-401-status-code}{#cicd-POST-sc-apply_changes__row-403-status-code}{#cicd-POST-sc-apply_changes__row-404-status-code}{#cicd-POST-sc-apply_changes__row-405-status-code}{#cicd-POST-sc-apply_changes__row-409-status-code}{#cicd-POST-sc-apply_changes__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 409 | Conflict. The requested item isn't unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 102. Status codes]

### Response body parameters (JSON or XML)

{#cicd-POST-sc-apply_changes__entry__44}{#cicd-POST-sc-apply_changes__row-error}{#cicd-POST-sc-apply_changes__row-link}{#cicd-POST-sc-apply_changes__row-links_progress}{#cicd-POST-sc-apply_changes__row-links_progress_id}{#cicd-POST-sc-apply_changes__row-links_progress_url}{#cicd-POST-sc-apply_changes__row-percent_complete}{#cicd-POST-sc-apply_changes__row-status}{#cicd-POST-sc-apply_changes__row-status_detail}{#cicd-POST-sc-apply_changes__row-status_label}{#cicd-POST-sc-apply_changes__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional information about why the operation failed. Returns an empty string if the operation is successful. Data type: String |
[ ]

### cURL request

    curl 'https://instance.servicenow.com/api/sn_cicd/sc/apply_changes?app_sys_id=043db024db737300a9a754e4dc961915' \
    --request POST \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
    "result": {
       "links": {
           "progress": {
               "id": "a4fae8911bdc00103d374087bc4bcbbd",
               "url": "https://instance.service-now/api/sn_cicd/progress/a4fae8911bdc00103d374087bc4bcbbd"
            }
        },
        "status": "0",
        "status_label": "Pending",
        "status_message": "",
        "status_detail": "",
        "error": "",
        "percent_complete": 0
      }
    }

## CI/CD - POST /sn_cicd/sc/apply_stash/{stash_id} {#ariaid-title19}

Starts applying a previously generated "stash" of changes from a remote source control
to a specified local application or application-customization.
This endpoint works in conjunction with the [POST/api/sn_cicd/sc/apply_changes](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-POST-sc-apply_changes "Starts applying changes from a remote source control to a specified local application or application-customization.") and [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID.") endpoints. When the POST /api/sn_cicd/sc/apply_changes endpoint is called, any unsaved or uncommitted changes in App Engine Studio on the associated instance are saved into the database as a [stash](https://www.servicenow.com/docs/access?context=stash-changes&version=yokohama&pubname=yokohama-application-development&ft:locale=en-US).

The way to determine whether a stash was created when the changes were initially applied is
to call the GET /sn_cicd/progress/{progress_id} endpoint. If a stash was
created, the sys_id (stash_id) and URL of the stash are returned. To
apply the stashed changes to the associated application, call this
apply_stash endpoint using the stash_id returned
by the progress endpoint.

### URL format {#cicd-POST-sc-apply_stash__section_nw2_lth_y5b}

Versioned URL:
/api/sn_cicd/{api_version}/sc/apply_stash/{stash_id}

Default URL:
/api/sn_cicd/sc/apply_stash/{stash_id}  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-sc-apply_stash__entry__2}{#cicd-POST-sc-apply_stash__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
| stash_id | Unique identifier of the stash to apply. This value is returned in the links.stash.id parameter in the corresponding [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID.") endpoint call. Data type: String |
[Table 103. Path parameters]

{#cicd-POST-sc-apply_stash__entry__8}

| Name | Description |
|-|-|
| None |   |
[Table 104. Query parameters]

{#cicd-POST-sc-apply_stash__entry__12}

| Name | Description |
|-|-|
| None |   |
[Table 105. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-sc-apply_stash__entry__16}{#cicd-POST-sc-apply_stash__accept-RESTAPI}{#cicd-POST-sc-apply_stash__content_type-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
| Content-Type | Data format of the request body. Supported types: application/json or application/xml. Default: application/json |
[Table 106. Request headers]

{#cicd-POST-sc-apply_stash__entry__22}

| Header | Description |
|-|-|
| None |   |
[Table 107. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-sc-apply_stash__entry__26}{#cicd-POST-sc-apply_stash__entry-200-status-code}{#cicd-POST-sc-apply_stash__row-401-status-code}{#cicd-POST-sc-apply_stash__row-403-status-code}{#cicd-POST-sc-apply_stash__row-404-status-code}{#cicd-POST-sc-apply_stash__row-405-status-code}{#cicd-POST-sc-apply_stash__row-409-status-code}{#cicd-POST-sc-apply_stash__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 409 | Conflict. The requested item isn't unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 108. Status codes]

### Response body parameters (JSON or XML)

{#cicd-POST-sc-apply_stash__entry__42}{#cicd-POST-sc-apply_stash__row-error}{#cicd-POST-sc-apply_stash__row-link}{#cicd-POST-sc-apply_stash__row-links_progress}{#cicd-POST-sc-apply_stash__row-links_progress_id}{#cicd-POST-sc-apply_stash__row-links_progress_url}{#cicd-POST-sc-apply_stash__row-percent_complete}{#cicd-POST-sc-apply_stash__row-status}{#cicd-POST-sc-apply_stash__row-status_detail}{#cicd-POST-sc-apply_stash__row-status_label}{#cicd-POST-sc-apply_stash__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
[ ]

### cURL request

The following code example shows how to call the apply_stash endpoint
for stash_id fc2224e4e0429110f8771827f8fd3634.

    curl "https://instance.servicenow.com/api/sn_cicd/sc/apply_stash/fc2224e4e0429110f8771827f8fd3634"\
    --request POST \
    --header "Accept:application/json" \
    --header "Content_Type:application/json" \
    --user 'username':'password'

The stash is pending, so not yet applied.

    {
      "result": {
        "links": {
          "progress": {
            "id": "6b04ec28e0429110f8771827f8fd36a4",
            "url": "https://instance.servicenow.com/api/sn_cicd/progress/6b04ec28e0429110f8771827f8fd36a4"
          }
        },
        "status": "0",
        "status_label": "Pending",
        "status_message": "",
        "status_detail": "",
        "error": "",
        "percent_complete": 0
      }
    }

## CI/CD - POST /sn_cicd/sc/import {#ariaid-title20}

Imports an application using the specified repository URL and branch name.
Use this endpoint to import an application from source control in the calling instance so
you can then use Continuous Integration and Continuous Delivery (CICD) endpoints, such as [/sn_cicd/sc/apply_changes](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-POST-sc-apply_changes "Starts applying changes from a remote source control to a specified local application or application-customization."), to deploy the
application to upper environments.  
Note:  
Before using this endpoint, a Git repository that has been setup by another instance using Link to source control must be available.

### URL format

Versioned URL: /api/sn_cicd/{api_version}/sc/import

Default URL: /api/sn_cicd/sc/import  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-sc-import__entry__2}{#cicd-POST-sc-import__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
[Table 109. Path parameters]

{#cicd-POST-sc-import__entry__6}

| Name | Description |
|-|-|
| auto_upgrade_base_app | Only applicable when the application being imported is an app-customization and the latest commit on the Git repository is built on a version that is later than that of the base application that is currently installed on the local instance. Flag that indicates whether the system should auto-upgrade the base application to a later version. Valid values: * true: Auto-upgrade the base application. * false: Do not auto-upgrade the base application. Data type: Boolean Default: True |
| branch_name | Required. Name of the branch in the source control system to import the application from. Data type: String |
| credential_sys_id | Sys_id of the credentials that have access to the Git repository. Data type: String Default: Sys_id set in the system properties glide.source_control.default_basic_auth_credential_sys_id or glide.source_control.default_ssh_private_key_credential_sys_id, depending on whether the repo_url parameter is an https or ssh repository. By default, this property is empty. |
| mid_server_sys_id | Sys_id of the MID server to use for source control operations for this application. Data type: String Default: Empty string/NULL |
| repo_url | Required. URL of the Git repository to import the application from. Data type: String |
[Table 110. Query parameters]

{#cicd-POST-sc-import__entry__18}

| Name | Description |
|-|-|
| None |   |
[Table 111. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-sc-import__entry__22}{#cicd-POST-sc-import__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 112. Request headers]

{#cicd-POST-sc-import__entry__26}

| Header | Description |
|-|-|
| None |   |
[Table 113. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-sc-import__entry__30}{#cicd-POST-sc-import__entry-200-status-code}{#cicd-POST-sc-import__row-401-status-code}{#cicd-POST-sc-import__row-403-status-code}{#cicd-POST-sc-import__row-405-status-code}{#cicd-POST-sc-import__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 409 | Conflict. The requested item isn't unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 114. Status codes]

### Response body parameters (JSON or XML)

{#cicd-POST-sc-import__entry__46}{#cicd-POST-sc-import__row-error}{#cicd-POST-sc-import__row-link}{#cicd-POST-sc-import__row-links_progress}{#cicd-POST-sc-import__row-links_progress_id}{#cicd-POST-sc-import__row-links_progress_url}{#cicd-POST-sc-import__row-percent_complete}{#cicd-POST-sc-import__row-status}{#cicd-POST-sc-import__row-status_detail}{#cicd-POST-sc-import__row-status_label}{#cicd-POST-sc-import__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
[ ]

### cURL request

The following example shows how to import the application located at
`https://code.devsnc.com/some-user/ncRegrApp1.git` in the
`main_branch`.

    curl "https://instance.servicenow.com/api/sn_cicd/sc/import?repo_url=https%3A%2F%2Fcode.devsnc.com%2Fsome-user%2FncRegrApp1.git&branch_name=main_branch&credential_sys_id=af9b6d6180feb010f8779c30d4dd6b6b" \
    --request POST \
    --header "Accept:application/json" \
    --user 'admin':'admin'

Returns the progress of the import.

    {
      "result": {
        "links": {
          "progress": {
            "id": "a18c06ea64f23010f87769cd983d4574",
            "url": "https://instance.servicenow.com/api/sn_cicd/progress/a18c06ea64f23010f87769cd983d4574"
          }
        },
        "status": "0",
        "status_label": "Pending",
        "status_message": "",
        "status_detail": "",
        "error": "",
        "percent_complete": 0
      }
    }

## CI/CD - POST /sn_cicd/testsuite/run {#ariaid-title21}

Starts a specified automated test suite. The test suite runs on the instance from which
the endpoint was called.
Note:  
If the suite you are running contains UI tests, you must have either a scheduled Client Test Runner open, or be able to configure headless Test Runner execution. To learn more, see [Headless browser for Automated Test Framework](https://www.servicenow.com/docs/access?context=atf-headless-browser&version=yokohama&pubname=yokohama-application-development&ft:locale=en-US).

### URL format {#cicd-POST-testsuite-run__section_mvk_l2s_zlb}

Versioned URL:
/api/sn_cicd/{api_version}/testsuite/run

Default URL:
/api/sn_cicd/testsuite/run  
Note:  
Available versions are specified in the [REST API Explorer](https://www.servicenow.com/docs/VV5d3pcHRv4pFxM~yEJQZA "In this tutorial you will use the REST API Explorer to test the ServiceNow REST APIs."). For scripted REST APIs there is additional version information on the [Scripted REST Service form](https://www.servicenow.com/docs/cpRBis~pwSIJPZVsP8Hkxw "The scripted REST API feature allows application developers to build custom web service APIs.").

### Supported request parameters

{#cicd-POST-testsuite-run__entry__2}{#cicd-POST-testsuite-run__version-not_optional-RESTAPI}

| Name | Description |
|-|-|
| api_version | Optional. Version of the endpoint to access. For example, <kbd class="ph userinput">v1</kbd> or <kbd class="ph userinput">v2</kbd>. Only specify this value to use an endpoint version other than the latest. Data type: String |
[Table 115. Path parameters]

{#cicd-POST-testsuite-run__entry__6}

| Name | Description |
|-|-|
| browser_name | Name of the browser to use to run the client test. This value must match what is specified in the scheduled client test runner. For additional information on scheduled client test runners, see [Scheduled Client Test Runners](https://developer.servicenow.com/app.do#!/training/article/app_store_learnv2_atf_rome_using_the_automated_test_framework/app_store_learnv2_atf_rome_scheduled_client_test_runners?v=utah). Data type: String Valid values: (must be all lower-case) * any * chrome * firefox * edge * ie * safari {#cicd-POST-testsuite-run__ul_thd_qln_3jb} Default: any |
| browser_version | Starting value of the version of the browser specified in browser_name to use to run the test. For example, if you enter "9", that would enable all 9.x.x.x versions. This value must match what is specified in the scheduled client test runner. Data type: String |
| is_performance_run | Optional. Flag that indicates whether to execute the test suite as a performance test (Performance Run). Valid values: * true: Runs the test suite as a performance test. * false: Runs the test suite with the default behavior of a standard, functional test of the instance. {#cicd-POST-testsuite-run__ul_lcr_c45_lbc} Default: false |
| os_name | Name of the operating system under which to run the test suite. This value must match what is specified in the scheduled client test runner. Data type: String |
| os_version | Starting value of the version of the operating system under which to run the test suite. For example, if you enter "8", that would enable all 8.x.x.x versions. This value must match what is specified in the scheduled client test runner. Data type: String |
| run_in_cloud | Optional. Flag that indicates whether to execute the test suite in Cloud Runner or manually. Valid values: * true: Runs the test suite using the Cloud Runner. * false: Runs the test suite using the manual test runner. {#cicd-POST-testsuite-run__ul_jqw_145_lbc} Default: false |
| test_suite_sys_id | Required if test_suite_name is not specified. The sys_id of the test suite to run. Data type: String Table: Test \[sys_atf_test_suite\] |
| test_suite_name | Required if test_suite_sys_id is not specified. The name of the test suite to run. Data type: String Table:Test \[sys_atf_test_suite\] |
[Table 116. Query parameters]

{#cicd-POST-testsuite-run__entry__24}

| Name | Description |
|-|-|
| None |   |
[Table 117. Request body parameters (XML or JSON)]

### Headers

The following request and response headers apply to this HTTP
action only, or apply to this action in a distinct way. For a list of general headers used
in the REST API, see [Supported REST API headers](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-testsuite-run__entry__28}{#cicd-POST-testsuite-run__accept-RESTAPI}

| Header | Description |
|-|-|
| Accept | Data format of the response body. Supported types: application/json or application/xml. Default: application/json |
[Table 118. Request headers]

{#cicd-POST-testsuite-run__entry__32}

| Header | Description |
|-|-|
| None |   |
[Table 119. Response headers]

### Status codes

The following status codes apply to this HTTP action. For a
list of possible status codes used in the REST API, see [REST API HTTP response
codes](https://www.servicenow.com/docs/aXidvjgEVmS~V~ZL0h85lQ "REST (REpresentational State Transfer) is a simple stateless architecture that provides standards between computer systems on the web, making it easier for them to communicate with each other.").
{#cicd-POST-testsuite-run__entry__36}{#cicd-POST-testsuite-run__entry-200-status-code}{#cicd-POST-testsuite-run__row-401-status-code}{#cicd-POST-testsuite-run__row-403-status-code}{#cicd-POST-testsuite-run__row-404-status-code}{#cicd-POST-testsuite-run__row-405-status-code}{#cicd-POST-testsuite-run__row-409-status-code}{#cicd-POST-testsuite-run__row-500-status-code}

| Status code | Description |
|-|-|
| 200 | Successful. The request was successfully processed. |
| 401 | The user credentials are incorrect. |
| 403 | Forbidden. The user isn't an admin or doesn't have the sn_cicd.sys_ci_automation role. |
| 404 | Not found. The requested item wasn't found. |
| 405 | Invalid method. The functionality is inactive. |
| 409 | Conflict. The requested item isn't unique. |
| 500 | Internal server error. An unexpected error occurred while processing the request. |
[Table 120. Status codes]

### Response body parameters (JSON or XML)

{#cicd-POST-testsuite-run__entry__52}{#cicd-POST-testsuite-run__row-error}{#cicd-POST-testsuite-run__row-link}{#cicd-POST-testsuite-run__row-links_progress}{#cicd-POST-testsuite-run__row-links_progress_id}{#cicd-POST-testsuite-run__row-links_progress_url}{#cicd-POST-testsuite-run__row-links_results}{#cicd-POST-testsuite-run__row-links_results_id}{#cicd-POST-testsuite-run__row-links_results_url}{#cicd-POST-testsuite-run__row-percent_complete}{#cicd-POST-testsuite-run__row-status}{#cicd-POST-testsuite-run__row-status_detail}{#cicd-POST-testsuite-run__row-status_label}{#cicd-POST-testsuite-run__row-status_message}

| Name | Description |
|-|-|
| error | Error message with details about the error. Data type: String |
| links | Information about any links and sys_ids associated with the update set. Data type: Object "links": { "progress": {Object} } |
| links.progress | Progress information about the operation performed on the update set. Data type: Object "progress": { "id": "String", "url": "String" } |
| links.progress.id | Sys_id containing progress details for the operation. You can use this value when calling the endpoint [CI/CD - GET /sn_cicd/progress/{progress_id}](https://www.servicenow.com/docs/k8N5YufePYyF4MVZbJ7Dfg#cicd-GET-progress "Returns the current progress and status of the Continuous Integration and Continuous Delivery (CICD) function associated with a specified progress ID."). Data type: String |
| links.progress.url | URL to use to retrieve the progress details about the operation performed on the update set. Data type: String |
| links.results | ID and URL of the execution results. Data type: Object "results": { "id": "String", "url": "String" } |
| links.results.id | Sys_id of the results information. Use this value when calling the associated results endpoint. Data type: String |
| links.results.url | URL to use to obtain the results of the endpoint execution. Data type: String |
| percent_complete | Percentage of the request that is complete. Data type: Number |
| status | Number representing the execution state of the action performed on the update set. Corresponds with the status_label descriptor. Possible values: * 0: Pending * 1: Running * 2: Successful * 3: Failed * 4: Canceled Data type: String |
| status_detail | Detailed message about the execution status, if available. Corresponds to the detailed_message field in the Execution Tracker \[sys_execution_tracker\] table. Data type: String |
| status_label | Execution status of the update set action. Corresponds with the status number. Possible values: * Canceled * Failed * Pending * Running * Successful Data type: String |
| status_message | Additional description of the action's current state, if available. Data type: String |
[ ]

### cURL request

    curl 'https://instance.servicenow.com/api/sn_cicd/testsuite/run?test_suite_sys_id=632e43900b20220050192f15d6673a7e' \
    --request POST \
    --header 'Accept: application/json' \
    --user 'username':'password'

    {
    "result": {
       "links": {
           "progress": {
               "id": "0578a8d91bdc00103d374087bc4bcbcc",
               "url": "https://instance.service-now.com/api/sn_cicd/progress/0578a8d91bdc00103d374087bc4bcbcc"
            }
       },
       "status": "0",
       "status_label": "Pending",
       "status_message": "",
       "status_detail": "",
       "error": "",
       "percent_complete": 0
      }
    }

Failure response:

    {
    "result": {
        "status": "3",
        "status_label": "Failed",
        "status_message": "",
        "status_detail": "",
        "error": "Scheduled test/suite execution is disabled. Change the value of property 'sn_atf.schedule.enabled' to true to enable it"
      }
    }


