> ## Documentation Index
> Fetch the complete documentation index at: https://koreai.mintlify.app/llms.txt
> Use this file to discover all available pages before exploring further.

# Undeploy a Workflow API

<Badge icon="arrow-left" color="gray">[Back to API List](/ai-for-process/apis/apis)</Badge>

This API undeploys a workflow that's deployed in an environment.

The API response includes the workflow ID, dock status ID and the workflow undeployment status. After receiving the response, use the `dockStatusId` to call the [Get Dock Status API](/ai-for-process/apis/apis-list/get-dock-status) and verify the status of the task.

|                   |                                                             |
| ----------------- | ----------------------------------------------------------- |
| **Method**        | POST                                                        |
| **Endpoint**      | `https://{host}/api/public/workflow/:{workflowId}/undeploy` |
| **Content Type**  | application/json                                            |
| **Authorization** | **`X-api-key`** - The API key used for authentication.      |

**Where can I find the API key?**

To use the API, you will need an API key. [Learn more](/ai-for-process/workflows/triggers-and-access#create-an-api-key).

## Path Parameters

| PARAMETER      | DESCRIPTION                                                           | TYPE   | REQUIRED/OPTIONAL |
| -------------- | --------------------------------------------------------------------- | ------ | ----------------- |
| **host**       | The environment URL. For example, `https://ai-for-process.domain.ai/` | String | Required          |
| **workflowId** | The unique identifier of the workflow being undeployed.               | String | Required          |

## Sample Request

```js theme={null}
curl --location --request POST 'https://{host}/api/public/workflows/a-0xxxxxxxxxxxxxxxxxxe/undeploy' \
--header 'x-api-key: kg-axxxxxxx-5xx3-5xx8-bxxb-9xxxxxxxxxx-ebxxxxxxxxxxx3'
```

## Body Parameters

No parameters are passed.

## Sample Response

```js theme={null}
{
   "dockStatusId": "ds-exxxxxx7-2xx8-5xxc-axx7-cxx73xxxxxx1",
   "toolId": "a-4xxxxxx9-fxx9-5xx7-axx7-9xxfdxxxxxxb",
   "jobType": "WORKFLOWS",
   "action": "UNDEPLOY",
   "status": "SUCCESS"
}
```

## Response Parameters

| PARAMETER        | DESCRIPTION                                                      | TYPE   |
| ---------------- | ---------------------------------------------------------------- | ------ |
| **dockStatusId** | The unique identifier for tracking the tool undeployment status. | String |
| **workflowId**   | The unique identifier of the workflow being undeployed.          | String |
| **jobType**      | The type of job being performed (WORKFLOWS).                     | String |
| **action**       | The action being performed (UNDEPLOY).                           | String |
| **status**       | The undeployment status (SUCCESS, IN\_PROGRESS, or FAILED).      | String |
