Import Workflow Version
Import Workflow Version
Supports uploading a .flow file to replace the current Workflow configuration and save it as a new version.
This endpoint authenticates with the target Workflow's own API Key, and can only be called by a Workflow that has version management permission enabled.
Request Method
POST
Request URL
https://api.${endpoint}/v1/workflow/version/import
Request Authentication
For details, see the authentication description in the API Overview. Please use the target Workflow's API Key as the token.
Request
Request Example
curl -X POST 'https://api.${endpoint}/v1/workflow/version/import' \
-H 'Authorization: Bearer ${token}' \
-F 'file=@/path/to/workflow.flow' \
-F 'versionDesc=Update workflow nodes'
curl -X POST 'https://api.${endpoint}/v1/workflow/version/import' \
-H 'Authorization: Bearer ${token}' \
-F 'file=@/path/to/workflow.flow' \
-F 'versionDesc=Update workflow nodes'
This code block in the floating window
Request Headers
| Field | Type | Description |
|---|---|---|
| Authorization | Bearer ${token} | Use the target Workflow's API Key for call authentication. |
| Content-Type | multipart/form-data | File upload form. |
Request Parameters (Form Data)
| Parameter | Type | Description | required |
|---|---|---|---|
| file | File | .flow file. |
true |
| versionDesc | String | Version description. | false |
Response
Response Body
{
"code": 0,
"message": "OK",
"data": {
"botId": "workflow-xxxx",
"botType": "FLOW_AGENT",
"version": "v2",
"warning": null
}
}
{
"code": 0,
"message": "OK",
"data": {
"botId": "workflow-xxxx",
"botType": "FLOW_AGENT",
"version": "v2",
"warning": null
}
}
This code block in the floating window
Success Response
| Field | Type | Description |
|---|---|---|
| botId | String | Target Workflow ID. |
| botType | String | Bot type. |
| version | String | The saved version number, which also becomes the current version. |
| warning | String | Import warning message; null if none. |
Failure Response
| Field | Type | Description |
|---|---|---|
| code | int | Error code. |
| message | string | Error message. |
Status Codes
| Status Code | Description |
|---|---|
| 200 | Success |
| 400 | Parameter error |
| 401 | Unauthorized |
| 403 | Insufficient permissions, or the API Key does not have version management permission enabled |
| 429 | Too many requests |
| 500 | Server error |
