Update Webhook
PATCH
/
webhooks
/
{id}
Update Webhook
curl --request PATCH \
--url https://api.monime.io/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Monime-Space-Id: <monime-space-id>' \
--data '
{
"url": " https://api.company.com/webhooks",
"name": "<string>",
"isActive": true,
"apiVersion": "<string>",
"events": [
"<string>"
],
"alertEmails": [
"<string>"
],
"verificationMethod": {},
"customHeaders": {},
"metadata": {}
}
'import requests
url = "https://api.monime.io/webhooks/{id}"
payload = {
"url": " https://api.company.com/webhooks",
"name": "<string>",
"isActive": True,
"apiVersion": "<string>",
"events": ["<string>"],
"alertEmails": ["<string>"],
"verificationMethod": {},
"customHeaders": {},
"metadata": {}
}
headers = {
"Monime-Space-Id": "<monime-space-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Monime-Space-Id': '<monime-space-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: ' https://api.company.com/webhooks',
name: '<string>',
isActive: true,
apiVersion: '<string>',
events: ['<string>'],
alertEmails: ['<string>'],
verificationMethod: {},
customHeaders: {},
metadata: {}
})
};
fetch('https://api.monime.io/webhooks/{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.monime.io/webhooks/{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([
'url' => ' https://api.company.com/webhooks',
'name' => '<string>',
'isActive' => true,
'apiVersion' => '<string>',
'events' => [
'<string>'
],
'alertEmails' => [
'<string>'
],
'verificationMethod' => [
],
'customHeaders' => [
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Monime-Space-Id: <monime-space-id>"
],
]);
$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.monime.io/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \" https://api.company.com/webhooks\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"apiVersion\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"alertEmails\": [\n \"<string>\"\n ],\n \"verificationMethod\": {},\n \"customHeaders\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Monime-Space-Id", "<monime-space-id>")
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://api.monime.io/webhooks/{id}")
.header("Monime-Space-Id", "<monime-space-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \" https://api.company.com/webhooks\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"apiVersion\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"alertEmails\": [\n \"<string>\"\n ],\n \"verificationMethod\": {},\n \"customHeaders\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monime.io/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Monime-Space-Id"] = '<monime-space-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \" https://api.company.com/webhooks\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"apiVersion\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"alertEmails\": [\n \"<string>\"\n ],\n \"verificationMethod\": {},\n \"customHeaders\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messages": [
"<unknown>"
],
"result": {
"name": "My Ecommerce Webhook",
"url": "<string>",
"events": [
"<string>"
],
"id": "<string>",
"isActive": true,
"apiVersion": "<string>",
"alertEmails": [
"<string>"
],
"verificationMethod": {
"hmac256": {
"secret": "<string>"
}
},
"customHeaders": {},
"createTime": "2023-11-07T05:31:56Z",
"metadata": {}
}
}Authorizations
Bearer HTTP authentication specified with the header Authorization: Bearer <access_token>
Headers
The value is the tenancy parameter that Monime used to determine which space the request is intended for.
Maximum string length:
100Pattern:
^spc-.*$Path Parameters
The ID for the webhook object to update
Body
application/json
The URL where the webhook events are sent.
Example:
" https://api.company.com/webhooks"
The name of the webhook.
Required string length:
1 - 100Denotes whether the webhook is active.
The API version the webhook supports.
The list of events that triggers the webhook.
Required array length:
1 - 100 elementsThe list email address to send alert notifications to when the webhook is failing.
Maximum array length:
3The verification method of the webhook.
Show child attributes
Show child attributes
Custom headers of the webhook.
Show child attributes
Show child attributes
Metadata attributes of the webhook.
Response
200 - application/json
OK
Was this page helpful?
⌘I
Update Webhook
curl --request PATCH \
--url https://api.monime.io/webhooks/{id} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--header 'Monime-Space-Id: <monime-space-id>' \
--data '
{
"url": " https://api.company.com/webhooks",
"name": "<string>",
"isActive": true,
"apiVersion": "<string>",
"events": [
"<string>"
],
"alertEmails": [
"<string>"
],
"verificationMethod": {},
"customHeaders": {},
"metadata": {}
}
'import requests
url = "https://api.monime.io/webhooks/{id}"
payload = {
"url": " https://api.company.com/webhooks",
"name": "<string>",
"isActive": True,
"apiVersion": "<string>",
"events": ["<string>"],
"alertEmails": ["<string>"],
"verificationMethod": {},
"customHeaders": {},
"metadata": {}
}
headers = {
"Monime-Space-Id": "<monime-space-id>",
"Authorization": "Bearer <token>",
"Content-Type": "application/json"
}
response = requests.patch(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'PATCH',
headers: {
'Monime-Space-Id': '<monime-space-id>',
Authorization: 'Bearer <token>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
url: ' https://api.company.com/webhooks',
name: '<string>',
isActive: true,
apiVersion: '<string>',
events: ['<string>'],
alertEmails: ['<string>'],
verificationMethod: {},
customHeaders: {},
metadata: {}
})
};
fetch('https://api.monime.io/webhooks/{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.monime.io/webhooks/{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([
'url' => ' https://api.company.com/webhooks',
'name' => '<string>',
'isActive' => true,
'apiVersion' => '<string>',
'events' => [
'<string>'
],
'alertEmails' => [
'<string>'
],
'verificationMethod' => [
],
'customHeaders' => [
],
'metadata' => [
]
]),
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>",
"Content-Type: application/json",
"Monime-Space-Id: <monime-space-id>"
],
]);
$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.monime.io/webhooks/{id}"
payload := strings.NewReader("{\n \"url\": \" https://api.company.com/webhooks\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"apiVersion\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"alertEmails\": [\n \"<string>\"\n ],\n \"verificationMethod\": {},\n \"customHeaders\": {},\n \"metadata\": {}\n}")
req, _ := http.NewRequest("PATCH", url, payload)
req.Header.Add("Monime-Space-Id", "<monime-space-id>")
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://api.monime.io/webhooks/{id}")
.header("Monime-Space-Id", "<monime-space-id>")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \" https://api.company.com/webhooks\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"apiVersion\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"alertEmails\": [\n \"<string>\"\n ],\n \"verificationMethod\": {},\n \"customHeaders\": {},\n \"metadata\": {}\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.monime.io/webhooks/{id}")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Patch.new(url)
request["Monime-Space-Id"] = '<monime-space-id>'
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"url\": \" https://api.company.com/webhooks\",\n \"name\": \"<string>\",\n \"isActive\": true,\n \"apiVersion\": \"<string>\",\n \"events\": [\n \"<string>\"\n ],\n \"alertEmails\": [\n \"<string>\"\n ],\n \"verificationMethod\": {},\n \"customHeaders\": {},\n \"metadata\": {}\n}"
response = http.request(request)
puts response.read_body{
"success": true,
"messages": [
"<unknown>"
],
"result": {
"name": "My Ecommerce Webhook",
"url": "<string>",
"events": [
"<string>"
],
"id": "<string>",
"isActive": true,
"apiVersion": "<string>",
"alertEmails": [
"<string>"
],
"verificationMethod": {
"hmac256": {
"secret": "<string>"
}
},
"customHeaders": {},
"createTime": "2023-11-07T05:31:56Z",
"metadata": {}
}
}