Rotate webhook endpoint secret
curl --request POST \
--url https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret', 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}/secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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>",
"code": "idempotency_key_reused"
}{
"message": "<string>"
}Webhooks
Rotate webhook endpoint secret
Generate a new signing secret for the webhook endpoint. The previous secret stops working right away. The new secret is returned only in this response.
POST
/
webhook-endpoints
/
{webhookEndpoint}
/
secret
Rotate webhook endpoint secret
curl --request POST \
--url https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret \
--header 'Authorization: Bearer <token>'import requests
url = "https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret"
headers = {"Authorization": "Bearer <token>"}
response = requests.post(url, headers=headers)
print(response.text)const options = {method: 'POST', headers: {Authorization: 'Bearer <token>'}};
fetch('https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret', 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}/secret",
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => "",
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 30,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_HTTPHEADER => [
"Authorization: Bearer <token>"
],
]);
$response = curl_exec($curl);
$err = curl_error($curl);
curl_close($curl);
if ($err) {
echo "cURL Error #:" . $err;
} else {
echo $response;
}package main
import (
"fmt"
"net/http"
"io"
)
func main() {
url := "https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret"
req, _ := http.NewRequest("POST", url, nil)
req.Header.Add("Authorization", "Bearer <token>")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}HttpResponse<String> response = Unirest.post("https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret")
.header("Authorization", "Bearer <token>")
.asString();require 'uri'
require 'net/http'
url = URI("https://cloud.laravel.com/api/webhook-endpoints/{webhookEndpoint}/secret")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
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>",
"code": "idempotency_key_reused"
}{
"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 - 255Was this page helpful?

