Skip to main content
PATCH
/
v1
/
str
/
webhooks
/
{webhookId}
Update webhook endpoint
curl --request PATCH \
  --url https://spb.sandbox.lerian.net/v1/str/webhooks/{webhookId} \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "eventTypes": [
    "<string>"
  ],
  "isActive": true,
  "metadata": {},
  "secret": "<string>",
  "url": "<string>"
}
'
import requests

url = "https://spb.sandbox.lerian.net/v1/str/webhooks/{webhookId}"

payload = {
    "eventTypes": ["<string>"],
    "isActive": True,
    "metadata": {},
    "secret": "<string>",
    "url": "<string>"
}
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({
    eventTypes: ['<string>'],
    isActive: true,
    metadata: {},
    secret: '<string>',
    url: '<string>'
  })
};

fetch('https://spb.sandbox.lerian.net/v1/str/webhooks/{webhookId}', 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://spb.sandbox.lerian.net/v1/str/webhooks/{webhookId}",
  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([
    'eventTypes' => [
        '<string>'
    ],
    'isActive' => true,
    'metadata' => [
        
    ],
    'secret' => '<string>',
    'url' => '<string>'
  ]),
  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://spb.sandbox.lerian.net/v1/str/webhooks/{webhookId}"

	payload := strings.NewReader("{\n  \"eventTypes\": [\n    \"<string>\"\n  ],\n  \"isActive\": true,\n  \"metadata\": {},\n  \"secret\": \"<string>\",\n  \"url\": \"<string>\"\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://spb.sandbox.lerian.net/v1/str/webhooks/{webhookId}")
  .header("Authorization", "Bearer <token>")
  .header("Content-Type", "application/json")
  .body("{\n  \"eventTypes\": [\n    \"<string>\"\n  ],\n  \"isActive\": true,\n  \"metadata\": {},\n  \"secret\": \"<string>\",\n  \"url\": \"<string>\"\n}")
  .asString();
require 'uri'
require 'net/http'

url = URI("https://spb.sandbox.lerian.net/v1/str/webhooks/{webhookId}")

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  \"eventTypes\": [\n    \"<string>\"\n  ],\n  \"isActive\": true,\n  \"metadata\": {},\n  \"secret\": \"<string>\",\n  \"url\": \"<string>\"\n}"

response = http.request(request)
puts response.read_body
{
  "correlationId": "<string>",
  "webhook": {
    "createdAt": "<string>",
    "eventTypes": [
      "<string>"
    ],
    "isActive": true,
    "messageTypes": [
      "<string>"
    ],
    "updatedAt": "<string>",
    "url": "<string>",
    "webhookId": "<string>",
    "metadata": {}
  }
}
{
  "code": "<string>",
  "detail": "<string>",
  "errors": [
    {
      "location": "<string>",
      "message": "<string>",
      "value": "<unknown>"
    }
  ],
  "instance": "<string>",
  "status": 123,
  "title": "<string>",
  "type": "about:blank"
}

Authorizations

Authorization
string
header
required

JWT bearer token issued by the identity provider.

Headers

X-Idempotency
string

Idempotency key (canonical).

X-Idempotency-Key
string

Idempotency key (legacy alias).

X-TTL
string

Idempotency key TTL in seconds.

Example:

"86400"

Path Parameters

webhookId
string
required

Webhook UUID.

Example:

"550e8400-e29b-41d4-a716-446655440000"

Body

application/json
eventTypes
string[]

New subscription list, re-validated against the canonical catalog. Omit to leave unchanged; an explicit empty array clears the subscription.

isActive
boolean

New active flag for the endpoint. Omit to leave unchanged.

metadata
object

New client-defined metadata. Omit to leave unchanged.

secret
string

New shared signing secret (16-512 chars); re-encrypted at rest. Omit to leave unchanged.

Example:

"whsec_0123456789abcdef"

url
string

New HTTPS endpoint; re-runs the HTTPS + SSRF check. Omit to leave unchanged.

Example:

"https://example.com/webhooks/str-events"

Response

OK

correlationId
string
required

Request-scoped correlation identifier echoing X-Request-ID, for pivoting from response to trace.

Example:

"550e8400-e29b-41d4-a716-446655440001"

webhook
object
required

The created, fetched, or updated webhook endpoint.