# Deployment request

The [Options](/navigation/options.md#deployment-request) feature in Spark allows users to submit a deployment request that will initiate a Continuous Integration / Continuous Deployment process ([CI/CD](https://www.redhat.com/en/topics/devops/what-is-ci-cd)). The request triggers a downstream application to initiate the process.

In order to make use of this capability, the following functionalities are required:

* Webhooks must be enabled, see [Webhooks: Connect Spark with external systems to automate workflows](/integrations/webhooks-connect-spark-with-external-systems-to-automate-workflows.md).
* Downstream web application that is capable of accepting [`POST`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Methods/POST) method requests.
* We recommend the use of the [ImpEx APIs](/spark-apis/impex-apis.md) that facilitate moving Spark services between environments and tenants.

## Implement a deployment to production

The diagram and steps below describe how the [Options](/navigation/options.md#deployment-request) feature can be used with the required functionalities as part of a [CI/CD](https://www.redhat.com/en/topics/devops/what-is-ci-cd) process to deploy a Spark service from the `UAT` to `PROD` environment.

<figure><img src="/files/zW8RoFjjQvLuaLjMXwP4" alt=""><figcaption></figcaption></figure>

1. User permissions to make a deployment request can be managed in [Options](/navigation/options.md#tenant-configuration).
2. In the UAT environment, a user submits an [Options](/navigation/options.md#deployment-request) by selecting the *Folder*, *Service*, and *Service version*.
3. Spark sends a notification to the downstream application via a `POST` method using a webhook.
4. The downstream application receives the notification and conducts the following processing on the `UAT` environment:
   1. Check that the notification relates to a deployment request by checking the request body for `"UserAction": "DeploymentRequest“`.
   2. Acquire an access token via the [Client Credentials](/identity-and-access-management/client-credentials.md) grant.
   3. Generate the export package using the [Export](/spark-apis/impex-apis/export.md) API, download and store it.
5. The downstream application then performs the remaining actions on the `PROD` environment.
   1. Acquire an access token via the [Client Credentials](/identity-and-access-management/client-credentials.md) grant.
   2. Publish the previously exported package using the [Import](/spark-apis/impex-apis/import.md) API.

## Demo video

This short video demonstrates the use of a Deployment request to copy a service version between environments.

{% file src="/files/pDgyOtPSnrGk3xNsO2eS" %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.coherent.global/ci-cd/deployment-request.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
