Model Runs
Delete a model run
Delete a model run. The delete is refused with 422 while the run is still processing, while a downstream model run reads its outputs, while it produces a batch, and while a score set references it. Each refusal carries a code and names the records in the way, the same entries deletion_blockers returns on Retrieve a model run.
DELETE
/
model_runs
/
{model_run_id}
Delete a model run
curl --request DELETE \
--url https://app.gomangrove.com/api/v1/model_runs/{model_run_id} \
--header 'Authorization: <api-key>'import requests
url = "https://app.gomangrove.com/api/v1/model_runs/{model_run_id}"
headers = {"Authorization": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<api-key>'}};
fetch('https://app.gomangrove.com/api/v1/model_runs/{model_run_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.gomangrove.com/api/v1/model_runs/{model_run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.gomangrove.com/api/v1/model_runs/{model_run_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.gomangrove.com/api/v1/model_runs/{model_run_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/model_runs/{model_run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"errors": [
{
"message": "Cannot delete model run mr_AbCd1234567890Ef: it produces batch ba_AbCd1234567890Ef; delete that batch instead.",
"field": "base",
"code": "batch_producing",
"blocking": [
{
"type": "batch",
"friendly_id": "ba_AbCd1234567890Ef"
}
],
"blocking_count": 1
}
]
}⌘I
Delete a model run
curl --request DELETE \
--url https://app.gomangrove.com/api/v1/model_runs/{model_run_id} \
--header 'Authorization: <api-key>'import requests
url = "https://app.gomangrove.com/api/v1/model_runs/{model_run_id}"
headers = {"Authorization": "<api-key>"}
response = requests.delete(url, headers=headers)
print(response.text)const options = {method: 'DELETE', headers: {Authorization: '<api-key>'}};
fetch('https://app.gomangrove.com/api/v1/model_runs/{model_run_id}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_URL => "https://app.gomangrove.com/api/v1/model_runs/{model_run_id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "DELETE",
CURLOPT_HTTPHEADER => [
"Authorization: <api-key>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://app.gomangrove.com/api/v1/model_runs/{model_run_id}"
req, _ := http.NewRequest("DELETE", url, nil)
req.Header.Add("Authorization", "<api-key>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.delete("https://app.gomangrove.com/api/v1/model_runs/{model_run_id}")
.header("Authorization", "<api-key>")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.gomangrove.com/api/v1/model_runs/{model_run_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Delete.new(url)
request["Authorization"] = '<api-key>'
response = http.request(request)
puts response.read_body{
"errors": [
{
"message": "Cannot delete model run mr_AbCd1234567890Ef: it produces batch ba_AbCd1234567890Ef; delete that batch instead.",
"field": "base",
"code": "batch_producing",
"blocking": [
{
"type": "batch",
"friendly_id": "ba_AbCd1234567890Ef"
}
],
"blocking_count": 1
}
]
}