Hooks
Update Hook
Update a hook.
PATCH
/
api
/
v1
/
hooks
/
{hook_id}
Update Hook
curl --request PATCH \
--url https://api.example.com/api/v1/hooks/{hook_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"trigger": {
"type": "<string>",
"cron": "<string>"
},
"condition": "<string>",
"actions": [
{}
],
"enabled": true
}
'import requests
url = "https://api.example.com/api/v1/hooks/{hook_id}"
payload = {
"name": "<string>",
"description": "<string>",
"trigger": {
"type": "<string>",
"cron": "<string>"
},
"condition": "<string>",
"actions": [{}],
"enabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
trigger: {type: '<string>', cron: '<string>'},
condition: '<string>',
actions: [{}],
enabled: true
})
};
fetch('https://api.example.com/api/v1/hooks/{hook_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.example.com/api/v1/hooks/{hook_id}",
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>',
'description' => '<string>',
'trigger' => [
'type' => '<string>',
'cron' => '<string>'
],
'condition' => '<string>',
'actions' => [
[
]
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/v1/hooks/{hook_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"cron\": \"<string>\"\n },\n \"condition\": \"<string>\",\n \"actions\": [\n {}\n ],\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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://api.example.com/api/v1/hooks/{hook_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"cron\": \"<string>\"\n },\n \"condition\": \"<string>\",\n \"actions\": [\n {}\n ],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/hooks/{hook_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"cron\": \"<string>\"\n },\n \"condition\": \"<string>\",\n \"actions\": [\n {}\n ],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"account_id": "<string>",
"name": "<string>",
"description": "<string>",
"trigger": {},
"condition": "<string>",
"actions": [
{}
],
"enabled": true,
"last_run_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"cron": "<string>",
"cron_description": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}Path Parameters
Body
application/json
Request body for updating a hook (all fields optional).
Required string length:
1 - 200Trigger that fires on a cron schedule.
- ScheduleTriggerConfig
- EventTriggerConfig
- ManualTriggerConfig
Show child attributes
Show child attributes
Updated condition expression (pass '' to clear)
Response
Successful Response
Response schema for a single hook.
Cron expression (schedule triggers only)
Human-readable cron schedule
⌘I
Update Hook
curl --request PATCH \
--url https://api.example.com/api/v1/hooks/{hook_id} \
--header 'Content-Type: application/json' \
--data '
{
"name": "<string>",
"description": "<string>",
"trigger": {
"type": "<string>",
"cron": "<string>"
},
"condition": "<string>",
"actions": [
{}
],
"enabled": true
}
'import requests
url = "https://api.example.com/api/v1/hooks/{hook_id}"
payload = {
"name": "<string>",
"description": "<string>",
"trigger": {
"type": "<string>",
"cron": "<string>"
},
"condition": "<string>",
"actions": [{}],
"enabled": True
}
headers = {"Content-Type": "application/json"}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {'Content-Type': 'application/json'},
body: JSON.stringify({
name: '<string>',
description: '<string>',
trigger: {type: '<string>', cron: '<string>'},
condition: '<string>',
actions: [{}],
enabled: true
})
};
fetch('https://api.example.com/api/v1/hooks/{hook_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.example.com/api/v1/hooks/{hook_id}",
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>',
'description' => '<string>',
'trigger' => [
'type' => '<string>',
'cron' => '<string>'
],
'condition' => '<string>',
'actions' => [
[
]
],
'enabled' => true
]),
CURLOPT_HTTPHEADER => [
"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://api.example.com/api/v1/hooks/{hook_id}"
payload := strings.NewReader("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"cron\": \"<string>\"\n },\n \"condition\": \"<string>\",\n \"actions\": [\n {}\n ],\n \"enabled\": true\n}")
req, _ := http.NewRequest("PATCH", url, payload)
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://api.example.com/api/v1/hooks/{hook_id}")
.header("Content-Type", "application/json")
.body("{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"cron\": \"<string>\"\n },\n \"condition\": \"<string>\",\n \"actions\": [\n {}\n ],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.example.com/api/v1/hooks/{hook_id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Content-Type"] = 'application/json'
request.body = "{\n \"name\": \"<string>\",\n \"description\": \"<string>\",\n \"trigger\": {\n \"type\": \"<string>\",\n \"cron\": \"<string>\"\n },\n \"condition\": \"<string>\",\n \"actions\": [\n {}\n ],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"id": "<string>",
"account_id": "<string>",
"name": "<string>",
"description": "<string>",
"trigger": {},
"condition": "<string>",
"actions": [
{}
],
"enabled": true,
"last_run_at": "2023-11-07T05:31:56Z",
"next_run_at": "2023-11-07T05:31:56Z",
"created_at": "2023-11-07T05:31:56Z",
"updated_at": "2023-11-07T05:31:56Z",
"created_by": "<string>",
"cron": "<string>",
"cron_description": "<string>"
}{
"detail": [
{
"loc": [
"<string>"
],
"msg": "<string>",
"type": "<string>"
}
]
}