Update schedule
Pause with { "enabled": false }, resume with { "enabled": true }, or change the time, timezone, overlap, name or spec. Sending run_at makes it a one-off and cron makes it repeating.
curl --request PATCH \
--url https://www.runcrate.ai/api/v1/schedules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"run_at": "2023-11-07T05:31:56Z",
"cron": "<string>",
"timezone": "<string>",
"name": "<string>",
"spec": {}
}
'import requests
url = "https://www.runcrate.ai/api/v1/schedules/{id}"
payload = {
"enabled": True,
"run_at": "2023-11-07T05:31:56Z",
"cron": "<string>",
"timezone": "<string>",
"name": "<string>",
"spec": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
run_at: '2023-11-07T05:31:56Z',
cron: '<string>',
timezone: '<string>',
name: '<string>',
spec: {}
})
};
fetch('https://www.runcrate.ai/api/v1/schedules/{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://www.runcrate.ai/api/v1/schedules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'run_at' => '2023-11-07T05:31:56Z',
'cron' => '<string>',
'timezone' => '<string>',
'name' => '<string>',
'spec' => [
]
]),
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://www.runcrate.ai/api/v1/schedules/{id}"
payload := strings.NewReader("{\n \"enabled\": true,\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\",\n \"name\": \"<string>\",\n \"spec\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://www.runcrate.ai/api/v1/schedules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\",\n \"name\": \"<string>\",\n \"spec\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.runcrate.ai/api/v1/schedules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\",\n \"name\": \"<string>\",\n \"spec\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "instance",
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"spec": {},
"max_runtime_minutes": 2,
"timezone": "UTC",
"overlap": "skip",
"enabled": true,
"run_count": 1,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"run_as": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"run_as_credential": "user",
"run_at": "2023-11-07T05:31:56Z",
"cron": "<string>",
"next_run_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"last_status": "launched",
"last_error": "<string>",
"last_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}Authorizations
Use a Runcrate API key with the rc_live_* prefix as the bearer token. Create one at https://www.runcrate.ai/dashboard/api-keys.
Path Parameters
Body
Send any of these. run_at turns the schedule into a one-off (clears cron); cron makes it repeating (clears run_at). spec replaces the whole spec, so send environment variable values again.
false pauses. true resumes and makes the schedule run as you from now on: a repeating schedule runs at its next occurrence from now; a one-off runs at its run_at, which must still be in the future.
skip, allow 1 - 63Response
Updated schedule.
Starts an instance or a job later: once at run_at, or on every occurrence of cron in timezone. Runcrate checks schedules every 2 minutes, so a run starts within about 2 minutes of its time, as run_as through run_as_credential, in the environment it was created in. When many schedules are due at once, each workspace gets its turn.
Show child attributes
Show child attributes
curl --request PATCH \
--url https://www.runcrate.ai/api/v1/schedules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"enabled": true,
"run_at": "2023-11-07T05:31:56Z",
"cron": "<string>",
"timezone": "<string>",
"name": "<string>",
"spec": {}
}
'import requests
url = "https://www.runcrate.ai/api/v1/schedules/{id}"
payload = {
"enabled": True,
"run_at": "2023-11-07T05:31:56Z",
"cron": "<string>",
"timezone": "<string>",
"name": "<string>",
"spec": {}
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
enabled: true,
run_at: '2023-11-07T05:31:56Z',
cron: '<string>',
timezone: '<string>',
name: '<string>',
spec: {}
})
};
fetch('https://www.runcrate.ai/api/v1/schedules/{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://www.runcrate.ai/api/v1/schedules/{id}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PATCH",
CURLOPT_POSTFIELDS => json_encode([
'enabled' => true,
'run_at' => '2023-11-07T05:31:56Z',
'cron' => '<string>',
'timezone' => '<string>',
'name' => '<string>',
'spec' => [
]
]),
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://www.runcrate.ai/api/v1/schedules/{id}"
payload := strings.NewReader("{\n \"enabled\": true,\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\",\n \"name\": \"<string>\",\n \"spec\": {}\n}")
req, _ := http.NewRequest("PATCH", 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.patch("https://www.runcrate.ai/api/v1/schedules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"enabled\": true,\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\",\n \"name\": \"<string>\",\n \"spec\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://www.runcrate.ai/api/v1/schedules/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"enabled\": true,\n \"run_at\": \"2023-11-07T05:31:56Z\",\n \"cron\": \"<string>\",\n \"timezone\": \"<string>\",\n \"name\": \"<string>\",\n \"spec\": {}\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"name": "<string>",
"kind": "instance",
"environment_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"created_by": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"spec": {},
"max_runtime_minutes": 2,
"timezone": "UTC",
"overlap": "skip",
"enabled": true,
"run_count": 1,
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"run_as": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"run_as_credential": "user",
"run_at": "2023-11-07T05:31:56Z",
"cron": "<string>",
"next_run_at": "2023-11-07T05:31:56Z",
"last_run_at": "2023-11-07T05:31:56Z",
"last_status": "launched",
"last_error": "<string>",
"last_instance_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"last_job_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a"
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}{
"error": {
"code": "<string>",
"message": "<string>",
"details": {}
}
}