Skip to main content
PATCH
/
v1
/
contexts
/
{contextId}
/
schedules
/
{scheduleId}
Update a schedule
curl --request PATCH \
  --url https://matcher.sandbox.lerian.net/v1/contexts/{contextId}/schedules/{scheduleId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "cronExpression": "0 6 * * *",
  "enabled": false
}
'
import requests

url = "https://matcher.sandbox.lerian.net/v1/contexts/{contextId}/schedules/{scheduleId}"

payload = {
    "cronExpression": "0 6 * * *",
    "enabled": False
}
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({cronExpression: '0 6 * * *', enabled: false})
};

fetch('https://matcher.sandbox.lerian.net/v1/contexts/{contextId}/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://matcher.sandbox.lerian.net/v1/contexts/{contextId}/schedules/{scheduleId}",
  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([
    'cronExpression' => '0 6 * * *',
    'enabled' => false
  ]),
  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://matcher.sandbox.lerian.net/v1/contexts/{contextId}/schedules/{scheduleId}"

	payload := strings.NewReader("{\n  \"cronExpression\": \"0 6 * * *\",\n  \"enabled\": false\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://matcher.sandbox.lerian.net/v1/contexts/{contextId}/schedules/{scheduleId}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"cronExpression\": \"0 6 * * *\",\n  \"enabled\": false\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://matcher.sandbox.lerian.net/v1/contexts/{contextId}/schedules/{scheduleId}")

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  \"cronExpression\": \"0 6 * * *\",\n  \"enabled\": false\n}"

response = http.request(request)
puts response.read_body
{
  "id": "019c96a0-2b20-7123-9a1b-2c3d4e5f6a7b",
  "contextId": "019c96a0-2a10-7dfe-b5c1-8a1b2c3d4e5f",
  "cronExpression": "0 0 * * *",
  "enabled": true,
  "lastRunAt": "2025-01-15T10:30:00Z",
  "nextRunAt": "2025-01-16T00:00:00Z",
  "createdAt": "2025-01-15T10:30:00Z",
  "updatedAt": "2025-01-15T10:30:00Z"
}
{
  "code": "MTCH-0001",
  "title": "Bad Request",
  "message": "context not found",
  "error": "<string>",
  "details": {}
}
{
  "code": "MTCH-0001",
  "title": "Bad Request",
  "message": "context not found",
  "error": "<string>",
  "details": {}
}
{
  "code": "MTCH-0001",
  "title": "Bad Request",
  "message": "context not found",
  "error": "<string>",
  "details": {}
}
{
  "code": "MTCH-0001",
  "title": "Bad Request",
  "message": "context not found",
  "error": "<string>",
  "details": {}
}
{
  "code": "MTCH-0001",
  "title": "Bad Request",
  "message": "context not found",
  "error": "<string>",
  "details": {}
}

Authorizations

Authorization
string
header
required

Bearer token authentication (format: "Bearer {token}")

Headers

X-Request-Id
string

A unique identifier for tracing the request across services.

X-Idempotency-Key
string

Optional idempotency key for safe retries. Also accepts Idempotency-Key as an alternative header name. If the same key is sent again and the original request was already processed, the cached response is returned with X-Idempotency-Replayed: true.

See Retries and idempotency for details.

Path Parameters

contextId
string
required

The unique identifier of the reconciliation context.

scheduleId
string
required

The unique identifier of the schedule.

Body

application/json

Fields to update

Payload for updating a reconciliation schedule

cronExpression
string

Updated cron expression

Maximum string length: 100
Example:

"0 6 * * *"

enabled
boolean

Updated enabled status

Example:

false

Response

Schedule updated.

The response includes the X-Idempotency-Replayed header.

If the value is false, the request was just processed. If the value is true, the response is a replay of a previously processed request.

See Retries and idempotency for more details.

Cron-based reconciliation schedule

id
string<uuid>

Unique identifier for the schedule

Example:

"019c96a0-2b20-7123-9a1b-2c3d4e5f6a7b"

contextId
string<uuid>

Context this schedule belongs to

Example:

"019c96a0-2a10-7dfe-b5c1-8a1b2c3d4e5f"

cronExpression
string

Cron expression defining the schedule

Maximum string length: 100
Example:

"0 0 * * *"

enabled
boolean

Whether the schedule is active

Example:

true

lastRunAt
string<date-time>

Last successful run time in RFC 3339 format

Example:

"2025-01-15T10:30:00Z"

nextRunAt
string<date-time>

Next scheduled run time in RFC 3339 format

Example:

"2025-01-16T00:00:00Z"

createdAt
string<date-time>

Creation timestamp in RFC 3339 format

Example:

"2025-01-15T10:30:00Z"

updatedAt
string<date-time>

Last update timestamp in RFC 3339 format

Example:

"2025-01-15T10:30:00Z"