> ## 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.

# Export a Workflow API

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

This API exports a workflow's configuration and associated data, including its flow for backup, sharing, or reuse. It allows users to generate an export of a specific workflow along with its deployed call flow.

When an export request is initiated, the API triggers the export process and returns a `dockStatusId`, which can be used with the [Get Dock Status API](/ai-for-process/apis/apis-list/get-dock-status) to track the export progress. The API response also includes an `exportJobId` for tracking the specific export job.

Additionally, the response provides a **download URL**. Copy and paste this URL into a browser or API client to download the exported workflow file.

|                   |                                                                               |
| ----------------- | ----------------------------------------------------------------------------- |
| **Method**        | POST                                                                          |
| **Endpoint**      | `https://{host}/api/public/workflow/:{workflowId}/export?flowId={callflowId}` |
| **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).

**How to obtain workflowId or callflowId for the API?**

1. Follow the steps mentioned [here](/ai-for-process/workflows/import-export-workflows#export-a-workflow) to export a workflow.
2. Open developer workflows.
3. Select the **Network** tab.
4. Monitor the Export API to capture `workflowId` and `callflowId`.

## Query Parameters

| PARAMETER      | DESCRIPTION                                                           | TYPE   | REQUIRED/OPTIONAL |
| -------------- | --------------------------------------------------------------------- | ------ | ----------------- |
| **host**       | The environment URL. For example, `https://ai-for-process.domain.ai/` | String | Required          |
| **workflowId** | The workflow ID of the workflow being exported.                       | String | Required          |
| **callflowId** | The callflow ID for the deployed workflow.                            | String | Required          |

## Sample Request

```js theme={null}
curl --location --request POST 'https://{host}/api/public/workflows/a-3xxxxxxxxxxxxxxxxxx3/export' 
--header 'x-api-key: kg-axxxxxxx-5xx3-5xx8-bxxb-9xxxxxxxxxx-ebxxxxxx-5xxb-4xxxxxxx3' 
--header 'Content-Type: application/json'
```

## Body Parameters

No parameters are passed.

## Sample Response

```js theme={null}
{
   "dock-statusId": "ds-cxxxxxxf-8xx7-5xx9-8xxd-c2xxxxxxxxxd",
   "workflowId": "a-4xxxxxx9-fxx9-5xx7-axx7-9xxxxxxxxxxb",
   "jobType": "WORKFLOWS",
   "action": "EXPORT",
   "status": "IN_PROGRESS",
   "exportJobId": "workflow-ej-25xxxxx2-bxx3-5xxc-8xx4-edxxxxxxxxxf"
"response": {
       "downloadUrl": " https://{host}/api/v1/account/xxxxxx"
  }
}
```

## Response Parameters

| PARAMETER        | DESCRIPTION                                                               | TYPE   |
| ---------------- | ------------------------------------------------------------------------- | ------ |
| **dockStatusId** | The unique identifier to track the status of the workflow export process. | String |
| **workflowId**   | The unique identifier for the workflow.                                   | String |
| **jobType**      | The type of job being performed.                                          | String |
| **action**       | The action that is performed on the workflow.                             | String |
| **status**       | The current status of the job.                                            | String |
| **exportJobId**  | The unique identifier to track the specific export job.                   | String |
| **downloadURL**  | The URL to download the exported workflow file.                           | String |
