Skip to main content
PUT
/
chrono
/
schedules
/
{scheduleId}
Update a schedule
curl --request PUT \
  --url https://v1.api.altostrat.io/chrono/schedules/{scheduleId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "name": "Weekend Maintenance Window",
  "hours": [
    {
      "day": "saturday",
      "start": "22:00",
      "end": "23:59"
    }
  ],
  "timezone": "America/New_York",
  "metadata": [
    {
      "key": "ticket_ref",
      "value": "JIRA-456"
    }
  ]
}
'
import requests

url = "https://v1.api.altostrat.io/chrono/schedules/{scheduleId}"

payload = {
"name": "Weekend Maintenance Window",
"hours": [
{
"day": "saturday",
"start": "22:00",
"end": "23:59"
}
],
"timezone": "America/New_York",
"metadata": [
{
"key": "ticket_ref",
"value": "JIRA-456"
}
]
}
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}

response = requests.put(url, json=payload, headers=headers)

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
body: JSON.stringify({
name: 'Weekend Maintenance Window',
hours: [{day: 'saturday', start: '22:00', end: '23:59'}],
timezone: 'America/New_York',
metadata: [{key: 'ticket_ref', value: 'JIRA-456'}]
})
};

fetch('https://v1.api.altostrat.io/chrono/schedules/{scheduleId}', 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://v1.api.altostrat.io/chrono/schedules/{scheduleId}",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "PUT",
CURLOPT_POSTFIELDS => json_encode([
'name' => 'Weekend Maintenance Window',
'hours' => [
[
'day' => 'saturday',
'start' => '22:00',
'end' => '23:59'
]
],
'timezone' => 'America/New_York',
'metadata' => [
[
'key' => 'ticket_ref',
'value' => 'JIRA-456'
]
]
]),
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://v1.api.altostrat.io/chrono/schedules/{scheduleId}"

payload := strings.NewReader("{\n \"name\": \"Weekend Maintenance Window\",\n \"hours\": [\n {\n \"day\": \"saturday\",\n \"start\": \"22:00\",\n \"end\": \"23:59\"\n }\n ],\n \"timezone\": \"America/New_York\",\n \"metadata\": [\n {\n \"key\": \"ticket_ref\",\n \"value\": \"JIRA-456\"\n }\n ]\n}")

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://v1.api.altostrat.io/chrono/schedules/{scheduleId}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"Weekend Maintenance Window\",\n \"hours\": [\n {\n \"day\": \"saturday\",\n \"start\": \"22:00\",\n \"end\": \"23:59\"\n }\n ],\n \"timezone\": \"America/New_York\",\n \"metadata\": [\n {\n \"key\": \"ticket_ref\",\n \"value\": \"JIRA-456\"\n }\n ]\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://v1.api.altostrat.io/chrono/schedules/{scheduleId}")

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 = "{\n \"name\": \"Weekend Maintenance Window\",\n \"hours\": [\n {\n \"day\": \"saturday\",\n \"start\": \"22:00\",\n \"end\": \"23:59\"\n }\n ],\n \"timezone\": \"America/New_York\",\n \"metadata\": [\n {\n \"key\": \"ticket_ref\",\n \"value\": \"JIRA-456\"\n }\n ]\n}"

response = http.request(request)
puts response.read_body
{
  "id": "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d",
  "name": "Business Hours Policy",
  "timezone": "Australia/Sydney",
  "active": true,
  "updated_at": "2025-10-29T01:43:31Z",
  "created_at": "2025-10-29T01:43:31Z",
  "hours": [
    {
      "day": "monday",
      "start": "09:00",
      "end": "17:00"
    }
  ],
  "metadata": [
    {
      "key": "policy_id",
      "value": "pol_12345"
    }
  ]
}
{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'timezone' parameter must be a valid IANA Time Zone.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}
{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'timezone' parameter must be a valid IANA Time Zone.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}
{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'timezone' parameter must be a valid IANA Time Zone.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}
{
"type": "invalid_request_error",
"code": "parameter_invalid",
"message": "The 'timezone' parameter must be a valid IANA Time Zone.",
"doc_url": "https://docs.altostrat.io/errors/parameter_invalid"
}

Authorizations

Authorization
string
header
required

Enter your API key in the format: Bearer {key}

Path Parameters

scheduleId
string<uuid>
required

The unique identifier (UUID) for the schedule to update.

Example:

"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"

Body

application/json

The details of the schedule to update.

The request body for creating or updating a schedule.

name
string
required

The name of the schedule. Must be unique within your workspace.

Maximum string length: 200
Example:

"Weekend Maintenance Window"

hours
object[]
required

An array of time slot objects. This array will completely replace any existing time slots on an update.

Maximum array length: 50
timezone
string

An IANA Time Zone Database name, e.g., America/New_York or UTC. If not provided, the workspace default will be used.

Example:

"America/New_York"

metadata
object[]

An array of key-value pairs. On update, provide a key with a null value to delete it. New keys will be added, and existing keys will be updated.

Maximum array length: 50

Response

The schedule was updated successfully.

Represents a schedule object that defines when a policy or configuration is active.

id
string<uuid>

The unique identifier for the schedule.

Example:

"9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"

name
string

A human-readable name for the schedule.

Example:

"Business Hours Policy"

timezone
string

The IANA timezone identifier that this schedule operates in. All start and end times are relative to this timezone.

Example:

"Australia/Sydney"

active
boolean

A read-only flag indicating whether the schedule is currently within an active time slot. This is calculated by the system.

Example:

true

updated_at
string<date-time>

The timestamp of when the schedule was last updated.

Example:

"2025-10-29T01:43:31Z"

created_at
string<date-time>

The timestamp of when the schedule was created.

Example:

"2025-10-29T01:43:31Z"

hours
object[]

A list of time slots that define the active periods for this schedule.

metadata
object[]

A list of key-value pairs that can be used to store additional information about the schedule.