Pular para o conteúdo principal
POST
/
v1
/
str
/
webhooks
Registrar endpoint de webhook
curl --request POST \
  --url https://spb.sandbox.lerian.net/v1/str/webhooks \
  --header 'Authorization: Bearer <token>' \
  --header 'Content-Type: application/json' \
  --data '
{
  "eventTypes": [
    "<string>"
  ],
  "secret": "<string>",
  "url": "<string>",
  "isActive": true,
  "metadata": {}
}
'
import requests

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

payload = {
    "eventTypes": ["<string>"],
    "secret": "<string>",
    "url": "<string>",
    "isActive": True,
    "metadata": {}
}
headers = {
    "Authorization": "Bearer <token>",
    "Content-Type": "application/json"
}

response = requests.post(url, json=payload, headers=headers)

print(response.text)
const options = {
  method: 'POST',
  headers: {Authorization: 'Bearer <token>', 'Content-Type': 'application/json'},
  body: JSON.stringify({
    eventTypes: ['<string>'],
    secret: '<string>',
    url: '<string>',
    isActive: true,
    metadata: {}
  })
};

fetch('https://spb.sandbox.lerian.net/v1/str/webhooks', 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",
  CURLOPT_RETURNTRANSFER => true,
  CURLOPT_ENCODING => "",
  CURLOPT_MAXREDIRS => 10,
  CURLOPT_TIMEOUT => 30,
  CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
  CURLOPT_CUSTOMREQUEST => "POST",
  CURLOPT_POSTFIELDS => json_encode([
    'eventTypes' => [
        '<string>'
    ],
    'secret' => '<string>',
    'url' => '<string>',
    'isActive' => true,
    'metadata' => [
        
    ]
  ]),
  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"

	payload := strings.NewReader("{\n  \"eventTypes\": [\n    \"<string>\"\n  ],\n  \"secret\": \"<string>\",\n  \"url\": \"<string>\",\n  \"isActive\": true,\n  \"metadata\": {}\n}")

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

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

http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true

request = Net::HTTP::Post.new(url)
request["Authorization"] = 'Bearer <token>'
request["Content-Type"] = 'application/json'
request.body = "{\n  \"eventTypes\": [\n    \"<string>\"\n  ],\n  \"secret\": \"<string>\",\n  \"url\": \"<string>\",\n  \"isActive\": true,\n  \"metadata\": {}\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"
}

Autorizações

Authorization
string
header
obrigatório

JWT bearer token issued by the identity provider.

Cabeçalhos

X-Idempotency
string

Idempotency key (canonical).

X-Idempotency-Key
string

Idempotency key (legacy alias).

X-TTL
string

Idempotency key TTL in seconds (overrides the configured default).

Exemplo:

"86400"

Corpo

application/json
eventTypes
string[] | null
obrigatório

Canonical control-plane event types to subscribe to (str.operation., str.readiness., str.certificate., str.approval.); at least one required.

Exemplo:
[
  "str.operation.accepted",
  "str.operation.received"
]
secret
string
obrigatório

Shared signing secret (16-512 chars); encrypted at rest with AES-256-GCM and never returned.

Exemplo:

"whsec_..."

url
string
obrigatório

HTTPS endpoint that receives event deliveries; max 2048 chars and subject to an SSRF check.

Exemplo:

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

isActive
boolean

Whether the endpoint is active and eligible to receive deliveries; defaults to active when omitted.

metadata
object

Arbitrary client-defined key/value metadata stored with the endpoint.

Resposta

Created

correlationId
string
obrigatório

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

Exemplo:

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

webhook
object
obrigatório

The created, fetched, or updated webhook endpoint.