Update workflow rule
curl --request PATCH \
--url http://localhost:8080/api/v1/workflow-rules/{workflowRule} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"provider_slug": "<string>",
"ping_target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"cooldown_minutes": 5040,
"conditions": [
{
"value": "<string>",
"lookback_minutes": 60,
"sort_order": 123
}
],
"actions": [
{
"mail_provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_email": "jsmith@example.com",
"webhook_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"apprise_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sort_order": 123
}
]
}
'import requests
url = "http://localhost:8080/api/v1/workflow-rules/{workflowRule}"
payload = {
"name": "<string>",
"provider_slug": "<string>",
"ping_target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": True,
"cooldown_minutes": 5040,
"conditions": [
{
"value": "<string>",
"lookback_minutes": 60,
"sort_order": 123
}
],
"actions": [
{
"mail_provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_email": "jsmith@example.com",
"webhook_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"apprise_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sort_order": 123
}
]
}
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({
name: '<string>',
provider_slug: '<string>',
ping_target_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
is_active: true,
cooldown_minutes: 5040,
conditions: [{value: '<string>', lookback_minutes: 60, sort_order: 123}],
actions: [
{
mail_provider_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
email_template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
recipient_email: 'jsmith@example.com',
webhook_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
apprise_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sort_order: 123
}
]
})
};
fetch('http://localhost:8080/api/v1/workflow-rules/{workflowRule}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/v1/workflow-rules/{workflowRule}",
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([
'name' => '<string>',
'provider_slug' => '<string>',
'ping_target_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'is_active' => true,
'cooldown_minutes' => 5040,
'conditions' => [
[
'value' => '<string>',
'lookback_minutes' => 60,
'sort_order' => 123
]
],
'actions' => [
[
'mail_provider_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'email_template_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'recipient_email' => 'jsmith@example.com',
'webhook_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'apprise_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'sort_order' => 123
]
]
]),
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 := "http://localhost:8080/api/v1/workflow-rules/{workflowRule}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"provider_slug\": \"<string>\",\n \"ping_target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"cooldown_minutes\": 5040,\n \"conditions\": [\n {\n \"value\": \"<string>\",\n \"lookback_minutes\": 60,\n \"sort_order\": 123\n }\n ],\n \"actions\": [\n {\n \"mail_provider_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"recipient_email\": \"jsmith@example.com\",\n \"webhook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"apprise_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sort_order\": 123\n }\n ]\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("http://localhost:8080/api/v1/workflow-rules/{workflowRule}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"provider_slug\": \"<string>\",\n \"ping_target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"cooldown_minutes\": 5040,\n \"conditions\": [\n {\n \"value\": \"<string>\",\n \"lookback_minutes\": 60,\n \"sort_order\": 123\n }\n ],\n \"actions\": [\n {\n \"mail_provider_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"recipient_email\": \"jsmith@example.com\",\n \"webhook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"apprise_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sort_order\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/v1/workflow-rules/{workflowRule}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"provider_slug\": \"<string>\",\n \"ping_target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"cooldown_minutes\": 5040,\n \"conditions\": [\n {\n \"value\": \"<string>\",\n \"lookback_minutes\": 60,\n \"sort_order\": 123\n }\n ],\n \"actions\": [\n {\n \"mail_provider_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"recipient_email\": \"jsmith@example.com\",\n \"webhook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"apprise_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sort_order\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"provider_slug": "<string>",
"ping_target_id": "<string>",
"target_label": "<string>",
"target_host": "<string>",
"event": "<string>",
"event_label": "Speedtest run completes",
"condition_operator": "<string>",
"is_active": true,
"cooldown_minutes": 123,
"last_triggered_at": "<string>",
"conditions": [
{
"id": "<string>",
"metric": "<string>",
"operator": "<string>",
"value": "<string>",
"lookback_minutes": 123,
"sort_order": 123
}
],
"actions": [
{
"id": "<string>",
"type": "<string>",
"mail_provider_id": "<string>",
"email_template_id": "<string>",
"recipient_email": "<string>",
"webhook_id": "<string>",
"apprise_id": "<string>",
"sort_order": 123
}
],
"created_at": "<string>"
},
"success": true,
"code": 200,
"message": "Workflow rule updated successfully."
}{
"success": false,
"code": 401,
"message": "<string>"
}{
"success": false,
"code": 404,
"message": "<string>"
}{
"success": false,
"code": 405,
"message": "<string>"
}{
"success": false,
"code": 422,
"message": "<string>",
"errors": "<string>"
}{
"success": false,
"code": 429,
"message": "<string>"
}{
"success": false,
"code": 500,
"message": "<string>"
}Workflow Rules
Update workflow rule
Update an workflow rule. Conditions and actions are replaced wholesale when their keys are present in the request.
PATCH
/
v1
/
workflow-rules
/
{workflowRule}
Update workflow rule
curl --request PATCH \
--url http://localhost:8080/api/v1/workflow-rules/{workflowRule} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"provider_slug": "<string>",
"ping_target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": true,
"cooldown_minutes": 5040,
"conditions": [
{
"value": "<string>",
"lookback_minutes": 60,
"sort_order": 123
}
],
"actions": [
{
"mail_provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_email": "jsmith@example.com",
"webhook_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"apprise_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sort_order": 123
}
]
}
'import requests
url = "http://localhost:8080/api/v1/workflow-rules/{workflowRule}"
payload = {
"name": "<string>",
"provider_slug": "<string>",
"ping_target_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"is_active": True,
"cooldown_minutes": 5040,
"conditions": [
{
"value": "<string>",
"lookback_minutes": 60,
"sort_order": 123
}
],
"actions": [
{
"mail_provider_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"email_template_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"recipient_email": "jsmith@example.com",
"webhook_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"apprise_id": "3c90c3cc-0d44-4b50-8888-8dd25736052a",
"sort_order": 123
}
]
}
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({
name: '<string>',
provider_slug: '<string>',
ping_target_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
is_active: true,
cooldown_minutes: 5040,
conditions: [{value: '<string>', lookback_minutes: 60, sort_order: 123}],
actions: [
{
mail_provider_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
email_template_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
recipient_email: 'jsmith@example.com',
webhook_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
apprise_id: '3c90c3cc-0d44-4b50-8888-8dd25736052a',
sort_order: 123
}
]
})
};
fetch('http://localhost:8080/api/v1/workflow-rules/{workflowRule}', options)
.then(res => res.json())
.then(res => console.log(res))
.catch(err => console.error(err));<?php
$curl = curl_init();
curl_setopt_array($curl, [
CURLOPT_PORT => "8080",
CURLOPT_URL => "http://localhost:8080/api/v1/workflow-rules/{workflowRule}",
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([
'name' => '<string>',
'provider_slug' => '<string>',
'ping_target_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'is_active' => true,
'cooldown_minutes' => 5040,
'conditions' => [
[
'value' => '<string>',
'lookback_minutes' => 60,
'sort_order' => 123
]
],
'actions' => [
[
'mail_provider_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'email_template_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'recipient_email' => 'jsmith@example.com',
'webhook_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'apprise_id' => '3c90c3cc-0d44-4b50-8888-8dd25736052a',
'sort_order' => 123
]
]
]),
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 := "http://localhost:8080/api/v1/workflow-rules/{workflowRule}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"provider_slug\": \"<string>\",\n \"ping_target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"cooldown_minutes\": 5040,\n \"conditions\": [\n {\n \"value\": \"<string>\",\n \"lookback_minutes\": 60,\n \"sort_order\": 123\n }\n ],\n \"actions\": [\n {\n \"mail_provider_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"recipient_email\": \"jsmith@example.com\",\n \"webhook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"apprise_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sort_order\": 123\n }\n ]\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("http://localhost:8080/api/v1/workflow-rules/{workflowRule}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"provider_slug\": \"<string>\",\n \"ping_target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"cooldown_minutes\": 5040,\n \"conditions\": [\n {\n \"value\": \"<string>\",\n \"lookback_minutes\": 60,\n \"sort_order\": 123\n }\n ],\n \"actions\": [\n {\n \"mail_provider_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"recipient_email\": \"jsmith@example.com\",\n \"webhook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"apprise_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sort_order\": 123\n }\n ]\n}")
.asString();require 'uri'
require 'net/http'
url = URI("http://localhost:8080/api/v1/workflow-rules/{workflowRule}")
http = Net::HTTP.new(url.host, url.port)
request = Net::HTTP::Patch.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"provider_slug\": \"<string>\",\n \"ping_target_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"is_active\": true,\n \"cooldown_minutes\": 5040,\n \"conditions\": [\n {\n \"value\": \"<string>\",\n \"lookback_minutes\": 60,\n \"sort_order\": 123\n }\n ],\n \"actions\": [\n {\n \"mail_provider_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"email_template_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"recipient_email\": \"jsmith@example.com\",\n \"webhook_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"apprise_id\": \"3c90c3cc-0d44-4b50-8888-8dd25736052a\",\n \"sort_order\": 123\n }\n ]\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"name": "<string>",
"provider_slug": "<string>",
"ping_target_id": "<string>",
"target_label": "<string>",
"target_host": "<string>",
"event": "<string>",
"event_label": "Speedtest run completes",
"condition_operator": "<string>",
"is_active": true,
"cooldown_minutes": 123,
"last_triggered_at": "<string>",
"conditions": [
{
"id": "<string>",
"metric": "<string>",
"operator": "<string>",
"value": "<string>",
"lookback_minutes": 123,
"sort_order": 123
}
],
"actions": [
{
"id": "<string>",
"type": "<string>",
"mail_provider_id": "<string>",
"email_template_id": "<string>",
"recipient_email": "<string>",
"webhook_id": "<string>",
"apprise_id": "<string>",
"sort_order": 123
}
],
"created_at": "<string>"
},
"success": true,
"code": 200,
"message": "Workflow rule updated successfully."
}{
"success": false,
"code": 401,
"message": "<string>"
}{
"success": false,
"code": 404,
"message": "<string>"
}{
"success": false,
"code": 405,
"message": "<string>"
}{
"success": false,
"code": 422,
"message": "<string>",
"errors": "<string>"
}{
"success": false,
"code": 429,
"message": "<string>"
}{
"success": false,
"code": 500,
"message": "<string>"
}Authorizations
Bearer authentication header of the form Bearer <token>, where <token> is your auth token.
Path Parameters
The workflow rule ID
Body
application/json
Maximum string length:
255Available options:
run_completes, run_fails, run_skipped, any, ping Available options:
and, or Required range:
0 <= x <= 10080Hide child attributes
Hide child attributes
Available options:
status, download_mbps, upload_mbps, ping_ms, jitter_ms, packet_loss, latency_avg, latency_max, consecutive_failures Available options:
is, is_not, is_above, is_below, is_above_or_equal, is_below_or_equal Required range:
1 <= x <= 120Minimum array length:
1Hide child attributes
Hide child attributes
Available options:
email, webhook, apprise Response
WorkflowRuleResource
Hide child attributes
Hide child attributes
Available options:
Speedtest run completes, Speedtest run fails, Speedtest run is skipped, Any speedtest event, Ping result recorded Hide child attributes
Hide child attributes
Allowed value:
"Workflow rule updated successfully."⌘I