Skip to main content
PUT
/
v1
/
schedule_rotations
/
{id}
Update a schedule rotation
curl --request PUT \
  --url https://api.rootly.com/v1/schedule_rotations/{id} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/vnd.api+json' \
  --data '
{
  "data": {
    "type": "schedule_rotations",
    "attributes": {
      "name": "<string>",
      "position": 123,
      "active_all_week": true,
      "active_days": [],
      "active_time_type": "<string>",
      "active_time_attributes": [
        {
          "start_time": "<string>",
          "end_time": "<string>"
        }
      ],
      "time_zone": "Etc/UTC",
      "schedule_rotationable_attributes": {
        "handoff_time": "<string>"
      },
      "start_time": "2023-11-07T05:31:56Z",
      "end_time": "2023-11-07T05:31:56Z",
      "schedule_rotation_members": [
        {
          "member_id": "<string>",
          "position": 123
        }
      ]
    }
  }
}
'
import requests

url = "https://api.rootly.com/v1/schedule_rotations/{id}"

payload = { "data": {
"type": "schedule_rotations",
"attributes": {
"name": "<string>",
"position": 123,
"active_all_week": True,
"active_days": [],
"active_time_type": "<string>",
"active_time_attributes": [
{
"start_time": "<string>",
"end_time": "<string>"
}
],
"time_zone": "Etc/UTC",
"schedule_rotationable_attributes": { "handoff_time": "<string>" },
"start_time": "2023-11-07T05:31:56Z",
"end_time": "2023-11-07T05:31:56Z",
"schedule_rotation_members": [
{
"member_id": "<string>",
"position": 123
}
]
}
} }
headers = {
"Authorization": "Bearer <token>",
"Content-Type": "application/vnd.api+json"
}

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

print(response.text)
const options = {
method: 'PUT',
headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/vnd.api+json'},
body: JSON.stringify({
data: {
type: 'schedule_rotations',
attributes: {
name: '<string>',
position: 123,
active_all_week: true,
active_days: [],
active_time_type: '<string>',
active_time_attributes: [{start_time: '<string>', end_time: '<string>'}],
time_zone: 'Etc/UTC',
schedule_rotationable_attributes: {handoff_time: '<string>'},
start_time: '2023-11-07T05:31:56Z',
end_time: '2023-11-07T05:31:56Z',
schedule_rotation_members: [{member_id: '<string>', position: 123}]
}
}
})
};

fetch('https://api.rootly.com/v1/schedule_rotations/{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.rootly.com/v1/schedule_rotations/{id}",
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([
'data' => [
'type' => 'schedule_rotations',
'attributes' => [
'name' => '<string>',
'position' => 123,
'active_all_week' => true,
'active_days' => [

],
'active_time_type' => '<string>',
'active_time_attributes' => [
[
'start_time' => '<string>',
'end_time' => '<string>'
]
],
'time_zone' => 'Etc/UTC',
'schedule_rotationable_attributes' => [
'handoff_time' => '<string>'
],
'start_time' => '2023-11-07T05:31:56Z',
'end_time' => '2023-11-07T05:31:56Z',
'schedule_rotation_members' => [
[
'member_id' => '<string>',
'position' => 123
]
]
]
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/vnd.api+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.rootly.com/v1/schedule_rotations/{id}"

payload := strings.NewReader("{\n \"data\": {\n \"type\": \"schedule_rotations\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"position\": 123,\n \"active_all_week\": true,\n \"active_days\": [],\n \"active_time_type\": \"<string>\",\n \"active_time_attributes\": [\n {\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n ],\n \"time_zone\": \"Etc/UTC\",\n \"schedule_rotationable_attributes\": {\n \"handoff_time\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"schedule_rotation_members\": [\n {\n \"member_id\": \"<string>\",\n \"position\": 123\n }\n ]\n }\n }\n}")

req, _ := http.NewRequest("PUT", url, payload)

req.Header.Add("Authorization", "Bearer <token>")
req.Header.Add("Content-Type", "application/vnd.api+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://api.rootly.com/v1/schedule_rotations/{id}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/vnd.api+json")
.body("{\n \"data\": {\n \"type\": \"schedule_rotations\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"position\": 123,\n \"active_all_week\": true,\n \"active_days\": [],\n \"active_time_type\": \"<string>\",\n \"active_time_attributes\": [\n {\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n ],\n \"time_zone\": \"Etc/UTC\",\n \"schedule_rotationable_attributes\": {\n \"handoff_time\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"schedule_rotation_members\": [\n {\n \"member_id\": \"<string>\",\n \"position\": 123\n }\n ]\n }\n }\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://api.rootly.com/v1/schedule_rotations/{id}")

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/vnd.api+json'
request.body = "{\n \"data\": {\n \"type\": \"schedule_rotations\",\n \"attributes\": {\n \"name\": \"<string>\",\n \"position\": 123,\n \"active_all_week\": true,\n \"active_days\": [],\n \"active_time_type\": \"<string>\",\n \"active_time_attributes\": [\n {\n \"start_time\": \"<string>\",\n \"end_time\": \"<string>\"\n }\n ],\n \"time_zone\": \"Etc/UTC\",\n \"schedule_rotationable_attributes\": {\n \"handoff_time\": \"<string>\"\n },\n \"start_time\": \"2023-11-07T05:31:56Z\",\n \"end_time\": \"2023-11-07T05:31:56Z\",\n \"schedule_rotation_members\": [\n {\n \"member_id\": \"<string>\",\n \"position\": 123\n }\n ]\n }\n }\n}"

response = http.request(request)
puts response.read_body
{
  "data": {
    "id": "<string>",
    "type": "schedule_rotations",
    "attributes": {
      "schedule_id": "<string>",
      "name": "<string>",
      "schedule_rotationable_attributes": {
        "handoff_time": "<string>"
      },
      "position": 123,
      "active_all_week": true,
      "active_days": [],
      "active_time_type": "<string>",
      "active_time_attributes": [
        {
          "start_time": "<string>",
          "end_time": "<string>"
        }
      ],
      "time_zone": "Etc/UTC",
      "start_time": "2023-11-07T05:31:56Z",
      "end_time": "2023-11-07T05:31:56Z"
    }
  },
  "included": [
    {
      "id": "<string>",
      "type": "<string>",
      "attributes": {},
      "relationships": {}
    }
  ]
}
{
"errors": [
{
"title": "<string>",
"status": "<string>",
"code": "<string>",
"detail": "<string>"
}
]
}

Authorizations

Authorization
string
header
required

Bearer authentication header of the form Bearer <token>, where <token> is your auth token.

Path Parameters

id
string
required

Body

application/vnd.api+json
data
object
required

Response

schedule_rotation updated

data
object
required
included
object[]