Cancel a workflow run
curl --request POST \
--url https://api.metal.ai/v1/workflow-runs/{id}/cancel \
--header 'x-metal-api-key: <api-key>' \
--header 'x-metal-client-id: <api-key>'import requests
url = "https://api.metal.ai/v1/workflow-runs/{id}/cancel"
headers = {
"x-metal-client-id": "<api-key>",
"x-metal-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-metal-client-id': '<api-key>', 'x-metal-api-key': '<api-key>'}
};
fetch('https://api.metal.ai/v1/workflow-runs/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.metal.ai/v1/workflow-runs/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-metal-client-id", "<api-key>")
req.Header.Add("x-metal-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "665f1c2a9b1e4a0012a3b4c6",
"workflowId": "665f1c2a9b1e4a0012a3b4c5",
"status": "running",
"title": "Acme diligence memo",
"input": {},
"output": {},
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "invalid api key or clientId"
}{
"error": "not found"
}Cancel a workflow run
Cancels a running or queued workflow run.
POST
/
v1
/
workflow-runs
/
{id}
/
cancel
Cancel a workflow run
curl --request POST \
--url https://api.metal.ai/v1/workflow-runs/{id}/cancel \
--header 'x-metal-api-key: <api-key>' \
--header 'x-metal-client-id: <api-key>'import requests
url = "https://api.metal.ai/v1/workflow-runs/{id}/cancel"
headers = {
"x-metal-client-id": "<api-key>",
"x-metal-api-key": "<api-key>"
}
response = requests.post(url, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {'x-metal-client-id': '<api-key>', 'x-metal-api-key': '<api-key>'}
};
fetch('https://api.metal.ai/v1/workflow-runs/{id}/cancel', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://api.metal.ai/v1/workflow-runs/{id}/cancel"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("x-metal-client-id", "<api-key>")
req.Header.Add("x-metal-api-key", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}{
"data": {
"id": "665f1c2a9b1e4a0012a3b4c6",
"workflowId": "665f1c2a9b1e4a0012a3b4c5",
"status": "running",
"title": "Acme diligence memo",
"input": {},
"output": {},
"createdAt": "2023-11-07T05:31:56Z",
"completedAt": "2023-11-07T05:31:56Z"
}
}{
"error": "invalid api key or clientId"
}{
"error": "not found"
}Authorizations
The Client ID of your API key.
The secret value of your API key.
Path Parameters
The workflow run id.
Response
The run was cancelled.
Show child attributes
Show child attributes

