curl --request POST \
--url https://api.scrapebento.com/v1/public/webhooks/endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://hooks.example.com/scrapebento"
}
'import requests
url = "https://api.scrapebento.com/v1/public/webhooks/endpoints"
payload = { "url": "https://hooks.example.com/scrapebento" }
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({url: 'https://hooks.example.com/scrapebento'})
};
fetch('https://api.scrapebento.com/v1/public/webhooks/endpoints', 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.scrapebento.com/v1/public/webhooks/endpoints",
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([
'url' => 'https://hooks.example.com/scrapebento'
]),
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://api.scrapebento.com/v1/public/webhooks/endpoints"
payload := strings.NewReader("{\n \"url\": \"https://hooks.example.com/scrapebento\"\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://api.scrapebento.com/v1/public/webhooks/endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://hooks.example.com/scrapebento\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapebento.com/v1/public/webhooks/endpoints")
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 \"url\": \"https://hooks.example.com/scrapebento\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"endpoint": {
"id": "<string>",
"url": "<string>",
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"signingSecret": "<string>",
"secretRotatedAt": "2023-11-07T05:31:56Z",
"lastDeliveryAt": "2023-11-07T05:31:56Z"
}
}
}Register a webhook endpoint
Requires api.write. Returns the endpoint with its signing secret.
Registering up front is optional — naming a webhookUrl on a job
registers it too — but doing it here means the secret is in hand before
the first job runs, which is the order anyone wiring up a verified
receiver actually wants.
Registering a URL that is already registered returns the existing endpoint and its current secret rather than issuing a new one. Replacing the secret would break a receiver that is already verifying deliveries; use the rotate endpoint when that is what you mean.
curl --request POST \
--url https://api.scrapebento.com/v1/public/webhooks/endpoints \
--header 'Authorization: Bearer <token>' \
--header 'Content-Type: application/json' \
--data '
{
"url": "https://hooks.example.com/scrapebento"
}
'import requests
url = "https://api.scrapebento.com/v1/public/webhooks/endpoints"
payload = { "url": "https://hooks.example.com/scrapebento" }
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({url: 'https://hooks.example.com/scrapebento'})
};
fetch('https://api.scrapebento.com/v1/public/webhooks/endpoints', 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.scrapebento.com/v1/public/webhooks/endpoints",
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([
'url' => 'https://hooks.example.com/scrapebento'
]),
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://api.scrapebento.com/v1/public/webhooks/endpoints"
payload := strings.NewReader("{\n \"url\": \"https://hooks.example.com/scrapebento\"\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://api.scrapebento.com/v1/public/webhooks/endpoints")
.header("Authorization", "Bearer <token>")
.header("Content-Type", "application/json")
.body("{\n \"url\": \"https://hooks.example.com/scrapebento\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.scrapebento.com/v1/public/webhooks/endpoints")
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 \"url\": \"https://hooks.example.com/scrapebento\"\n}"
response = http.request(request)
puts response.read_body{
"data": {
"endpoint": {
"id": "<string>",
"url": "<string>",
"status": "active",
"createdAt": "2023-11-07T05:31:56Z",
"updatedAt": "2023-11-07T05:31:56Z",
"description": "<string>",
"signingSecret": "<string>",
"secretRotatedAt": "2023-11-07T05:31:56Z",
"lastDeliveryAt": "2023-11-07T05:31:56Z"
}
}
}Authorizations
Send a workspace API token in the Authorization: Bearer <token> header.
Keys carry the satk_ prefix and spend your organization's credit
balance. GET /v1/public/balance reports what is left.
Test-mode keys (satk_test_), which drew on a separate self-refilling
allowance, have been retired and no longer authenticate.
Body
Public http(s) destination. Private, loopback, and link-local addresses are rejected — this is somewhere we will later POST your results to.
Response
The endpoint, including its signing secret.
Show child attributes
Show child attributes