Patch Scheduler

Partially updates a scheduler's configuration.

Authentication

Requires authentication. Pass your API key via X-API-Key or Authorization: Bearer header.

Path Parameters

Parameter Type Description
id string The unique identifier of the scheduler

Request Body

1{
2  "display_name": "updated-scheduler-name"
3}

Example Request

curl -X PATCH "https://api.hola.cloud/schedulers/sched-a1b2c3d4-e5f6-7890-abcd-ef1234567890" \
  -H "X-API-Key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "display_name": "updated-scheduler-name"
  }'
PATCH /schedulers/sched-a1b2c3d4-e5f6-7890-abcd-ef1234567890 HTTP/1.1
Host: api.hola.cloud
X-API-Key: YOUR_API_KEY
Content-Type: application/json

{
    "display_name": "updated-scheduler-name"
  }
// Go 1.21+, standard library only. Save as main.go and run: go run main.go
package main

import (
	"fmt"
	"io"
	"net/http"
	"encoding/json"
	"strings"
)

func main() {
	payload := map[string]any{"display_name": "updated-scheduler-name"}
	bodyBytes, err := json.Marshal(payload)
	if err != nil {
		panic(err)
	}
	body := string(bodyBytes)

	req, err := http.NewRequest("PATCH", "https://api.hola.cloud/schedulers/sched-a1b2c3d4-e5f6-7890-abcd-ef1234567890", strings.NewReader(body))
	if err != nil {
		panic(err)
	}
	req.Header.Set("X-API-Key", "YOUR_API_KEY")
	req.Header.Set("Content-Type", "application/json")

	resp, err := http.DefaultClient.Do(req)
	if err != nil {
		panic(err)
	}
	defer resp.Body.Close()

	responseBody, err := io.ReadAll(resp.Body)
	if err != nil {
		panic(err)
	}
	fmt.Println(resp.Status)
	fmt.Println(string(responseBody))
}
<?php
// PHP 8+ with the curl extension. Save as example.php and run: php example.php

$payload = ['display_name' => 'updated-scheduler-name'];
$body = json_encode($payload);

$ch = curl_init();

curl_setopt_array($ch, [
    CURLOPT_URL => 'https://api.hola.cloud/schedulers/sched-a1b2c3d4-e5f6-7890-abcd-ef1234567890',
    CURLOPT_RETURNTRANSFER => true,
    CURLOPT_CUSTOMREQUEST => 'PATCH',
    CURLOPT_POSTFIELDS => $body,
    CURLOPT_HTTPHEADER => [
        'X-API-Key: YOUR_API_KEY',
        'Content-Type: application/json',
    ],
]);

$response = curl_exec($ch);
if ($response === false) {
    throw new Exception(curl_error($ch));
}
echo curl_getinfo($ch, CURLINFO_RESPONSE_CODE), "\n", $response, "\n";
curl_close($ch);
# Python 3.8+. Install: pip install requests. Save as example.py and run: python example.py
import requests

headers = {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json",
}

payload = {"display_name": "updated-scheduler-name"}

response = requests.request(
    "PATCH",
    "https://api.hola.cloud/schedulers/sched-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    headers=headers,
    json=payload
)

print(response.status_code)
print(response.text)
// Node.js 18+. Save as example.mjs and run: node example.mjs
const payload = {"display_name": "updated-scheduler-name"};

const response = await fetch("https://api.hola.cloud/schedulers/sched-a1b2c3d4-e5f6-7890-abcd-ef1234567890", {
  method: "PATCH",
  headers: {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify(payload)
});

console.log(response.status);
console.log(await response.text());
const payload = {"display_name": "updated-scheduler-name"};

const response = await fetch("https://api.hola.cloud/schedulers/sched-a1b2c3d4-e5f6-7890-abcd-ef1234567890", {
  method: "PATCH",
  headers: {
    "X-API-Key": "YOUR_API_KEY",
    "Content-Type": "application/json"
  },
  body: JSON.stringify(payload)
});

console.log(response.status);
console.log(await response.text());
// Java 17+, standard library only. Save as Main.java and run: java Main.java
import java.net.URI;
import java.net.http.HttpClient;
import java.net.http.HttpRequest;
import java.net.http.HttpResponse;

public class Main {
    public static void main(String[] args) throws Exception {
        var body = """
{
    "display_name": "updated-scheduler-name"
  }
""";

        var request = HttpRequest.newBuilder()
            .uri(URI.create("https://api.hola.cloud/schedulers/sched-a1b2c3d4-e5f6-7890-abcd-ef1234567890"))
            .method("PATCH", HttpRequest.BodyPublishers.ofString(body))
            .header("X-API-Key", "YOUR_API_KEY")
            .header("Content-Type", "application/json")
            .build();

        var response = HttpClient.newHttpClient().send(request, HttpResponse.BodyHandlers.ofString());
        System.out.println(response.statusCode());
        System.out.println(response.body());
    }
}

Example Response

1HTTP/1.1 200 OK
2Content-Type: application/json
1{
2  "id": "sched-a1b2c3d4-e5f6-7890-abcd-ef1234567890",
3  "display_name": "updated-scheduler-name",
4  "ready": true,
5  "scheduled": 5,
6  "inflight": 0,
7  "created_at": "2025-06-20T10:00:00Z",
8  "updated_at": "2025-06-21T09:15:00Z"
9}

Error Codes

Status Code Description
400 invalid_json Invalid JSON payload
400 validation_error Invalid request body
401 unauthorized Missing or invalid API key
404 not_found Scheduler not found
500 internal_error Internal server error

Comments

Leave a comment