Update webhook endpoint
curl --request PATCH \
--url https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [],
"enabled": true
}
'import requests
url = "https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}"
payload = {
"url": "<string>",
"events": [],
"enabled": True
}
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({url: '<string>', events: [], enabled: true})
};
fetch('https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}', 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://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}",
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' => '<string>',
'events' => [
],
'enabled' => true
]),
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://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [],\n \"enabled\": true\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://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}")
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 \"url\": \"<string>\",\n \"events\": [],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "webhook_endpoints",
"attributes": {
"url": "<string>",
"events": [
"deployment.live"
],
"enabled": true,
"last_delivery_at": "2023-11-07T05:31:56Z",
"last_outcome": "pending",
"created_at": "2023-11-07T05:31:56Z",
"secret": "<string>"
},
"relationships": {
"subscribables": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
]
}
}
},
"included": [
{
"id": "<string>",
"type": "<string>"
}
]
}{
"message": "<string>",
"code": "idempotency_key_invalid"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"code": "idempotency_key_in_use"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Webhooks
Update webhook endpoint
Update the URL, events or enabled state of a webhook endpoint. The response does not include the signing secret, which is returned only when the endpoint is created and when its secret is rotated.
PATCH
/
webhook-endpoints
/
{webhookEndpoint}
Update webhook endpoint
curl --request PATCH \
--url https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint} \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "<string>",
"events": [],
"enabled": true
}
'import requests
url = "https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}"
payload = {
"url": "<string>",
"events": [],
"enabled": True
}
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({url: '<string>', events: [], enabled: true})
};
fetch('https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}', 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://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}",
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' => '<string>',
'events' => [
],
'enabled' => true
]),
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://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}"
payload := strings.NewReader("{\n \"url\": \"<string>\",\n \"events\": [],\n \"enabled\": true\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://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"<string>\",\n \"events\": [],\n \"enabled\": true\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}")
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 \"url\": \"<string>\",\n \"events\": [],\n \"enabled\": true\n}"
response = http.request(request)
puts response.read_body{
"data": {
"id": "<string>",
"type": "webhook_endpoints",
"attributes": {
"url": "<string>",
"events": [
"deployment.live"
],
"enabled": true,
"last_delivery_at": "2023-11-07T05:31:56Z",
"last_outcome": "pending",
"created_at": "2023-11-07T05:31:56Z",
"secret": "<string>"
},
"relationships": {
"subscribables": {
"data": [
{
"type": "<string>",
"id": "<string>"
}
]
}
}
},
"included": [
{
"id": "<string>",
"type": "<string>"
}
]
}{
"message": "<string>",
"code": "idempotency_key_invalid"
}{
"message": "<string>"
}{
"message": "<string>"
}{
"message": "<string>",
"code": "idempotency_key_in_use"
}{
"message": "<string>",
"errors": {}
}{
"message": "<string>"
}Required permission:
environment.editHeaders
A unique value, such as a UUID, that identifies this operation. When you send the same request again with the same key, Laravel Cloud returns the first successful response from the last 24 hours instead of performing the action again. See Idempotent requests.
Required string length:
1 - 255Body
application/json
Was this page helpful?

