Update a schedule
curl --request PATCH \
--url https://api.hq.zone/v1/api/schedules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"args": {},
"trigger": {},
"description": "<string>",
"max_duration_secs": 123,
"name": "<string>"
}
'import requests
url = "https://api.hq.zone/v1/api/schedules/{id}"
payload = {
"args": {},
"trigger": {},
"description": "<string>",
"max_duration_secs": 123,
"name": "<string>"
}
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({
args: {},
trigger: {},
description: '<string>',
max_duration_secs: 123,
name: '<string>'
})
};
fetch('https://api.hq.zone/v1/api/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://api.hq.zone/v1/api/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([
'args' => [
],
'trigger' => [
],
'description' => '<string>',
'max_duration_secs' => 123,
'name' => '<string>'
]),
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.hq.zone/v1/api/schedules/{id}"
payload := strings.NewReader("{\n \"args\": {},\n \"trigger\": {},\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"name\": \"<string>\"\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.hq.zone/v1/api/schedules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"args\": {},\n \"trigger\": {},\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hq.zone/v1/api/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 \"args\": {},\n \"trigger\": {},\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"next_fire_at": "2023-11-07T05:31:56Z"
}Schedules
Update a schedule
Updates an existing schedule’s name, description, trigger, or run arguments; only the fields supplied are changed, and an explicit null description clears it while omitting it keeps the current value. Only the schedule’s owner or an admin may update it (others receive 403). Returns an acknowledgement that includes the recomputed next fire time when the trigger changed. Requires the schedules:write scope.
PATCH
/
v1
/
api
/
schedules
/
{id}
Update a schedule
curl --request PATCH \
--url https://api.hq.zone/v1/api/schedules/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"args": {},
"trigger": {},
"description": "<string>",
"max_duration_secs": 123,
"name": "<string>"
}
'import requests
url = "https://api.hq.zone/v1/api/schedules/{id}"
payload = {
"args": {},
"trigger": {},
"description": "<string>",
"max_duration_secs": 123,
"name": "<string>"
}
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({
args: {},
trigger: {},
description: '<string>',
max_duration_secs: 123,
name: '<string>'
})
};
fetch('https://api.hq.zone/v1/api/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://api.hq.zone/v1/api/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([
'args' => [
],
'trigger' => [
],
'description' => '<string>',
'max_duration_secs' => 123,
'name' => '<string>'
]),
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.hq.zone/v1/api/schedules/{id}"
payload := strings.NewReader("{\n \"args\": {},\n \"trigger\": {},\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"name\": \"<string>\"\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.hq.zone/v1/api/schedules/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"args\": {},\n \"trigger\": {},\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"name\": \"<string>\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.hq.zone/v1/api/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 \"args\": {},\n \"trigger\": {},\n \"description\": \"<string>\",\n \"max_duration_secs\": 123,\n \"name\": \"<string>\"\n}"
response = http.request(request)
puts response.read_body{
"ok": true,
"next_fire_at": "2023-11-07T05:31:56Z"
}Authorizations
bearer_patoauth2
Personal Access Token. Send as Authorization: Bearer hq_pat_....
Path Parameters
Schedule id
Body
application/json
⌘I