Schedules
Update a schedule
Change a schedule’s cadence, timezone, inputs, or switch it on or off.
PATCH
/
v1
/
schedules
/
{schedule_id}
Update a schedule
curl --request PATCH \
--url https://api.valendata.com/v1/schedules/{schedule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cron": "<string>",
"every": "<string>",
"timezone": "<string>",
"inputs": {},
"enabled": true,
"max_results": 250
}
'import requests
url = "https://api.valendata.com/v1/schedules/{schedule_id}"
payload = {
"cron": "<string>",
"every": "<string>",
"timezone": "<string>",
"inputs": {},
"enabled": True,
"max_results": 250
}
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({
cron: '<string>',
every: '<string>',
timezone: '<string>',
inputs: {},
enabled: true,
max_results: 250
})
};
fetch('https://api.valendata.com/v1/schedules/{schedule_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://api.valendata.com/v1/schedules/{schedule_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([
'cron' => '<string>',
'every' => '<string>',
'timezone' => '<string>',
'inputs' => [
],
'enabled' => true,
'max_results' => 250
]),
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://api.valendata.com/v1/schedules/{schedule_id}"
payload := strings.NewReader("{\n \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"<string>\",\n \"inputs\": {},\n \"enabled\": true,\n \"max_results\": 250\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://api.valendata.com/v1/schedules/{schedule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"<string>\",\n \"inputs\": {},\n \"enabled\": true,\n \"max_results\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valendata.com/v1/schedules/{schedule_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 \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"<string>\",\n \"inputs\": {},\n \"enabled\": true,\n \"max_results\": 250\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"workflow_id": "<string>",
"workflow_slug": "<string>",
"enabled": true,
"frequency": "<string>",
"kind": "workflow",
"cron": "<string>",
"every": "<string>",
"timezone": "UTC",
"inputs": {},
"next_run_at": "<string>",
"last_run_at": "<string>",
"created_at": "<string>"
}{
"detail": "The request is malformed: the body is not JSON, the cursor or Idempotency-Key is not valid.",
"code": "invalid_json",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "The API key is missing, malformed, revoked, or expired.",
"code": "unauthorized",
"type": "authentication_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "The key lacks a scope, is limited to other skills or workflows, or you may not do this.",
"code": "permission_denied",
"type": "permission_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "It does not exist, or it is not yours to see.",
"code": "not_found",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "A conflict with the current state, or a request with this Idempotency-Key is still running.",
"code": "conflict",
"type": "conflict_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "Invalid request — name: Field required",
"code": "validation_error",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e",
"param": "name",
"errors": [
{
"type": "missing",
"loc": [
"body",
"name"
],
"msg": "Field required"
}
]
}{
"detail": "Too many requests for this key, or too many runs in progress. Wait `Retry-After` seconds.",
"code": "rate_limited",
"type": "rate_limit_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "Something broke on our side. Retry; runs that fail on our side are refunded.",
"code": "internal_error",
"type": "api_error",
"request_id": "3f9a1c2b7d4e"
}Send only what you want to change:
cron or every, timezone, inputs, enabled, and, for a skill schedule only, max_results. enabled: false pauses it; runs missed while paused are not made up later.
Needs skills:write (skill schedule) or workflows:write (workflow schedule). Switching a workflow schedule on also needs workflows:invoke. MCP tool: update_schedule.Authorizations
ApiKeyAuthApiKeyHeader
API key with the vd_sk_ prefix, as Authorization: Bearer vd_sk_.... Create keys in Settings → API Keys.
Headers
Any unique string (such as your order id). Resending the same request with the same key within 24 hours returns the first answer (with Idempotent-Replayed: true) and does nothing twice; the same key with a different request is a 422 idempotency_key_reused.
Required string length:
1 - 255Path Parameters
Body
application/json
PATCH /v1/schedules/{id}: only what is sent changes. max_results is for a skill's
schedule (rows per run); a workflow schedule refuses it.
Response
The schedule after the change.
- ScheduleView
- SkillSchedule
The canonical frequency, e.g. cron:0 9 * * 1 or daily:02:00.
⌘I
Update a schedule
curl --request PATCH \
--url https://api.valendata.com/v1/schedules/{schedule_id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"cron": "<string>",
"every": "<string>",
"timezone": "<string>",
"inputs": {},
"enabled": true,
"max_results": 250
}
'import requests
url = "https://api.valendata.com/v1/schedules/{schedule_id}"
payload = {
"cron": "<string>",
"every": "<string>",
"timezone": "<string>",
"inputs": {},
"enabled": True,
"max_results": 250
}
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({
cron: '<string>',
every: '<string>',
timezone: '<string>',
inputs: {},
enabled: true,
max_results: 250
})
};
fetch('https://api.valendata.com/v1/schedules/{schedule_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://api.valendata.com/v1/schedules/{schedule_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([
'cron' => '<string>',
'every' => '<string>',
'timezone' => '<string>',
'inputs' => [
],
'enabled' => true,
'max_results' => 250
]),
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://api.valendata.com/v1/schedules/{schedule_id}"
payload := strings.NewReader("{\n \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"<string>\",\n \"inputs\": {},\n \"enabled\": true,\n \"max_results\": 250\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://api.valendata.com/v1/schedules/{schedule_id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"<string>\",\n \"inputs\": {},\n \"enabled\": true,\n \"max_results\": 250\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.valendata.com/v1/schedules/{schedule_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 \"cron\": \"<string>\",\n \"every\": \"<string>\",\n \"timezone\": \"<string>\",\n \"inputs\": {},\n \"enabled\": true,\n \"max_results\": 250\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"workflow_id": "<string>",
"workflow_slug": "<string>",
"enabled": true,
"frequency": "<string>",
"kind": "workflow",
"cron": "<string>",
"every": "<string>",
"timezone": "UTC",
"inputs": {},
"next_run_at": "<string>",
"last_run_at": "<string>",
"created_at": "<string>"
}{
"detail": "The request is malformed: the body is not JSON, the cursor or Idempotency-Key is not valid.",
"code": "invalid_json",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "The API key is missing, malformed, revoked, or expired.",
"code": "unauthorized",
"type": "authentication_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "The key lacks a scope, is limited to other skills or workflows, or you may not do this.",
"code": "permission_denied",
"type": "permission_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "It does not exist, or it is not yours to see.",
"code": "not_found",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "A conflict with the current state, or a request with this Idempotency-Key is still running.",
"code": "conflict",
"type": "conflict_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "Invalid request — name: Field required",
"code": "validation_error",
"type": "invalid_request_error",
"request_id": "3f9a1c2b7d4e",
"param": "name",
"errors": [
{
"type": "missing",
"loc": [
"body",
"name"
],
"msg": "Field required"
}
]
}{
"detail": "Too many requests for this key, or too many runs in progress. Wait `Retry-After` seconds.",
"code": "rate_limited",
"type": "rate_limit_error",
"request_id": "3f9a1c2b7d4e"
}{
"detail": "Something broke on our side. Retry; runs that fail on our side are refunded.",
"code": "internal_error",
"type": "api_error",
"request_id": "3f9a1c2b7d4e"
}
