curl --request PUT \
--url https://app.kardinal.ai/api/v2/plans/{planId}/running \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data falseimport requests
url = "https://app.kardinal.ai/api/v2/plans/{planId}/running"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}
};
fetch('https://app.kardinal.ai/api/v2/plans/{planId}/running', 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.kardinal.ai/api/v2/plans/{planId}/running",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "false",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.kardinal.ai/api/v2/plans/{planId}/running"
payload := strings.NewReader("false")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.kardinal.ai/api/v2/plans/{planId}/running")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("false")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.kardinal.ai/api/v2/plans/{planId}/running")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "false"
response = http.request(request)
puts response.read_bodyStop or restart the optimization of a plan
Stops or restarts optimization on the current version of the plan, without changing its data or version.
A restart (body true) consumes credits like an update, by the same 24-hour rule (see Pricing and credits), and it counts as one optimization against your agency’s daily and monthly optimization quota (see Limits and quotas). A stop (body false) consumes no credits, isn’t checked against the quota, and isn’t counted.
An archived plan (one with archivedAt set) refuses a stop and a restart with a 403 NOT_ALLOWED whose properties.details reads Cannot update an archived plan, except with the 'force' query param. Add ?force=true to unarchive it. An archived plan is more than 24 hours old, so a forced restart bills every stop again. A forced stop (body false) also unarchives the plan.
curl --request PUT \
--url https://app.kardinal.ai/api/v2/plans/{planId}/running \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data falseimport requests
url = "https://app.kardinal.ai/api/v2/plans/{planId}/running"
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.put(url, headers=headers)
print(response.text)const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'}
};
fetch('https://app.kardinal.ai/api/v2/plans/{planId}/running', 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.kardinal.ai/api/v2/plans/{planId}/running",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => "false",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"strings"
"net/http"
"io"
)
func main() {
url := "https://app.kardinal.ai/api/v2/plans/{planId}/running"
payload := strings.NewReader("false")
req, _ := http.NewRequest("PUT", url, payload)
req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.put("https://app.kardinal.ai/api/v2/plans/{planId}/running")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("false")
.asString();require 'uri'
require 'net/http'
url = URI("https://app.kardinal.ai/api/v2/plans/{planId}/running")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Put.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "false"
response = http.request(request)
puts response.read_bodyAuthorizations
JWT bearer token, sent as Authorization: Bearer <token>. Two kinds of token are accepted:
- A session token (1 hour), obtained through the interactive Console login flow. Used to sign in to the Console; not meant to be used against this API.
- A long-term API token (366 days), obtained once via the Console and meant to be stored by your integration. It is the credential recommended for backend use, since it does not depend on repeating the interactive login flow.
Path Parameters
The plan UUID. Universally Unique Identifier.
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"cd4ce4e3-0208-4b10-b346-25f235214e4f"
Query Parameters
If true, on an archived item, the requested action is forced and the item is unarchived. Without it, an archived plan refuses an update, a stop and a restart with a 403 NOT_ALLOWED. On a plan that isn't archived, force has no effect.
Modelling pitfall. On an archived plan,
force=truebills every stop again, on an update as on a restart. An update withforce=truealways creates a new version, even if its content is identical. Don't setforceby default. See Pricing and credits.
true
Body
A boolean value: false stops the optimization, true restarts it.
The body is of type boolean.
false
Response
The request succeeded.
An envelope carrying no item, only the reference of the plan the request acted on.
Identifier of the Kardinal tenant/account the plan is scoped to, derived automatically from the access token used to make the request.
Modelling pitfall. Not a physical-depot or site partition key. A single fleet based at several physical depots is still one
Plan; do not split it into severalPlanobjects just because resources have differentdeparture/arrivalpositions.
^BLD[0-9]{7}_[a-zA-Z0-9-._~:@!$,]+$"BLD1234567_production"
The plan id.
^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$"4cbd0ab8-282c-4b30-b981-29e1ed8a2016"
The plan's current version: unchanged by this request.
x >= 142
Amendments applied while processing this request, if any.
Show child attributes
Show child attributes
Was this page helpful?

