Webhook endpoints
https://scrapelyserp.com /api/v1/webhook_endpoints cURL
curl -X GET "https://scrapelyserp.com/api/v1/webhook_endpoints"TypeScript
const res = await fetch('https://scrapelyserp.com/api/v1/webhook_endpoints', {
method: 'GET',
});
const data = await res.json();Python
import requests
res = requests.request(
"GET",
"https://scrapelyserp.com/api/v1/webhook_endpoints",
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://scrapelyserp.com/api/v1/webhook_endpoints", nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://scrapelyserp.com/api/v1/webhook_endpoints');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://scrapelyserp.com/api/v1/webhook_endpoints')
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://scrapelyserp.com/api/v1/webhook_endpoints"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Responses
Example
{
"object": {},
"data": [
{
"id": "we_3f9a1c2e4b5d6a7f8e9c",
"object": {},
"url": "string",
"description": "string",
"events": [
null
],
"enabled": true,
"secret_hint": "whsec_…9c41",
"previous_secret_expires_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}
],
"has_more": true
}Schema
objectdataWebhookEndpoint[]Show child parameters
idstringrequiredobjectrequiredurlstringrequiredcallback_url / webhook_url must equal it to be delivered here.descriptionstringeventsstring[]requirednull (the default): every event. []: none — only deliveries that name this endpoint (a job's callback_url, a watchlist's webhook_url), which it always receives.enabledbooleanrequiredsecret_hintstringrequiredprevious_secret_expires_atstringv1= until then, 24 hours after the rotation).created_atstringrequiredupdated_atstringhas_morebooleanUNAUTHORIZED: missing, unknown or revoked key.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringRATE_LIMITED or CONCURRENCY_LIMIT. Honour Retry-After.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringINTERNAL: our fault, not charged. Quote X-Request-Id.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringhttps://scrapelyserp.com /api/v1/webhook_endpoints Registers a URL and generates its own signing secret, returned in secret this once. At most 10 per account (409 beyond). Not idempotent by design: a replayable response would be a stored secret.
Request body application/json
urlstringdescriptionstringeventsstring[]null (the default): every event. []: none — only deliveries that name this endpoint (a job's callback_url, a watchlist's webhook_url), which it always receives.enabledboolean{
"url": "string",
"description": "string",
"events": [
"job.finished"
],
"enabled": true
}cURL
curl -X POST "https://scrapelyserp.com/api/v1/webhook_endpoints" \
-H "Content-Type: application/json" \
-d '{"url":"string","description":"string","events":["job.finished"],"enabled":true}'TypeScript
const res = await fetch('https://scrapelyserp.com/api/v1/webhook_endpoints', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({"url":"string","description":"string","events":["job.finished"],"enabled":true}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://scrapelyserp.com/api/v1/webhook_endpoints",
headers={
"Content-Type": "application/json",
},
json={"url": "string", "description": "string", "events": ["job.finished"], "enabled": True},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://scrapelyserp.com/api/v1/webhook_endpoints", strings.NewReader(`{"url":"string","description":"string","events":["job.finished"],"enabled":true}`))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://scrapelyserp.com/api/v1/webhook_endpoints');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"url":"string","description":"string","events":["job.finished"],"enabled":true}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://scrapelyserp.com/api/v1/webhook_endpoints')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = 'application/json'
req.body = '{"url":"string","description":"string","events":["job.finished"],"enabled":true}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://scrapelyserp.com/api/v1/webhook_endpoints"))
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"url\":\"string\",\"description\":\"string\",\"events\":[\"job.finished\"],\"enabled\":true}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Responses
secret now.Example
{
"id": "we_3f9a1c2e4b5d6a7f8e9c",
"object": {},
"url": "string",
"description": "string",
"events": [
"job.finished"
],
"enabled": true,
"secret_hint": "whsec_…9c41",
"previous_secret_expires_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"secret": "whsec_5b0e…"
}Schema
idstringrequiredobjectrequiredurlstringrequiredcallback_url / webhook_url must equal it to be delivered here.descriptionstringeventsstring[]requirednull (the default): every event. []: none — only deliveries that name this endpoint (a job's callback_url, a watchlist's webhook_url), which it always receives.enabledbooleanrequiredsecret_hintstringrequiredprevious_secret_expires_atstringv1= until then, 24 hours after the rotation).created_atstringrequiredupdated_atstringsecretstringrequiredMISSING_PARAM or INVALID_PARAM; param names the culprit.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringUNAUTHORIZED: missing, unknown or revoked key.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringCONFLICT: idempotent request in flight, or the job is already running/done.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringRATE_LIMITED or CONCURRENCY_LIMIT. Honour Retry-After.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringINTERNAL: our fault, not charged. Quote X-Request-Id.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringhttps://scrapelyserp.com /api/v1/webhook_endpoints/{id} Parameters
idstringpathrequiredwe_…).cURL
curl -X GET "https://scrapelyserp.com/api/v1/webhook_endpoints/{id}"TypeScript
const res = await fetch('https://scrapelyserp.com/api/v1/webhook_endpoints/{id}', {
method: 'GET',
});
const data = await res.json();Python
import requests
res = requests.request(
"GET",
"https://scrapelyserp.com/api/v1/webhook_endpoints/{id}",
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("GET", "https://scrapelyserp.com/api/v1/webhook_endpoints/{id}", nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://scrapelyserp.com/api/v1/webhook_endpoints/{id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'GET');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://scrapelyserp.com/api/v1/webhook_endpoints/{id}')
req = Net::HTTP::Get.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://scrapelyserp.com/api/v1/webhook_endpoints/{id}"))
.GET()
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Responses
Example
{
"id": "we_3f9a1c2e4b5d6a7f8e9c",
"object": {},
"url": "string",
"description": "string",
"events": [
"job.finished"
],
"enabled": true,
"secret_hint": "whsec_…9c41",
"previous_secret_expires_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}Schema
idstringrequiredobjectrequiredurlstringrequiredcallback_url / webhook_url must equal it to be delivered here.descriptionstringeventsstring[]requirednull (the default): every event. []: none — only deliveries that name this endpoint (a job's callback_url, a watchlist's webhook_url), which it always receives.enabledbooleanrequiredsecret_hintstringrequiredprevious_secret_expires_atstringv1= until then, 24 hours after the rotation).created_atstringrequiredupdated_atstringUNAUTHORIZED: missing, unknown or revoked key.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringNOT_FOUND.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringRATE_LIMITED or CONCURRENCY_LIMIT. Honour Retry-After.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringINTERNAL: our fault, not charged. Quote X-Request-Id.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringhttps://scrapelyserp.com /api/v1/webhook_endpoints/{id} Pending retries to it, and jobs or watchlists that name its URL, are recorded as failed deliveries from now on.
Parameters
idstringpathrequiredwe_…).cURL
curl -X DELETE "https://scrapelyserp.com/api/v1/webhook_endpoints/{id}"TypeScript
const res = await fetch('https://scrapelyserp.com/api/v1/webhook_endpoints/{id}', {
method: 'DELETE',
});
const data = await res.json();Python
import requests
res = requests.request(
"DELETE",
"https://scrapelyserp.com/api/v1/webhook_endpoints/{id}",
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("DELETE", "https://scrapelyserp.com/api/v1/webhook_endpoints/{id}", nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://scrapelyserp.com/api/v1/webhook_endpoints/{id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://scrapelyserp.com/api/v1/webhook_endpoints/{id}')
req = Net::HTTP::Delete.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://scrapelyserp.com/api/v1/webhook_endpoints/{id}"))
.method("DELETE", BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Responses
Example
{
"id": "string",
"object": {},
"deleted": {}
}Schema
idstringobjectdeletedUNAUTHORIZED: missing, unknown or revoked key.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringNOT_FOUND.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringRATE_LIMITED or CONCURRENCY_LIMIT. Honour Retry-After.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringINTERNAL: our fault, not charged. Quote X-Request-Id.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringhttps://scrapelyserp.com /api/v1/webhook_endpoints/{id} Change url, description, events or enabled. The secret is unchanged (rotate it separately).
Parameters
idstringpathrequiredwe_…).Request body application/json
urlstringdescriptionstringeventsstring[]null (the default): every event. []: none — only deliveries that name this endpoint (a job's callback_url, a watchlist's webhook_url), which it always receives.enabledboolean{
"url": "string",
"description": "string",
"events": [
"job.finished"
],
"enabled": true
}cURL
curl -X PATCH "https://scrapelyserp.com/api/v1/webhook_endpoints/{id}" \
-H "Content-Type: application/json" \
-d '{"url":"string","description":"string","events":["job.finished"],"enabled":true}'TypeScript
const res = await fetch('https://scrapelyserp.com/api/v1/webhook_endpoints/{id}', {
method: 'PATCH',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({"url":"string","description":"string","events":["job.finished"],"enabled":true}),
});
const data = await res.json();Python
import requests
res = requests.request(
"PATCH",
"https://scrapelyserp.com/api/v1/webhook_endpoints/{id}",
headers={
"Content-Type": "application/json",
},
json={"url": "string", "description": "string", "events": ["job.finished"], "enabled": True},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("PATCH", "https://scrapelyserp.com/api/v1/webhook_endpoints/{id}", strings.NewReader(`{"url":"string","description":"string","events":["job.finished"],"enabled":true}`))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://scrapelyserp.com/api/v1/webhook_endpoints/{id}');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"url":"string","description":"string","events":["job.finished"],"enabled":true}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://scrapelyserp.com/api/v1/webhook_endpoints/{id}')
req = Net::HTTP::Patch.new(uri)
req['Content-Type'] = 'application/json'
req.body = '{"url":"string","description":"string","events":["job.finished"],"enabled":true}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://scrapelyserp.com/api/v1/webhook_endpoints/{id}"))
.header("Content-Type", "application/json")
.method("PATCH", BodyPublishers.ofString("{\"url\":\"string\",\"description\":\"string\",\"events\":[\"job.finished\"],\"enabled\":true}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Responses
Example
{
"id": "we_3f9a1c2e4b5d6a7f8e9c",
"object": {},
"url": "string",
"description": "string",
"events": [
"job.finished"
],
"enabled": true,
"secret_hint": "whsec_…9c41",
"previous_secret_expires_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z"
}Schema
idstringrequiredobjectrequiredurlstringrequiredcallback_url / webhook_url must equal it to be delivered here.descriptionstringeventsstring[]requirednull (the default): every event. []: none — only deliveries that name this endpoint (a job's callback_url, a watchlist's webhook_url), which it always receives.enabledbooleanrequiredsecret_hintstringrequiredprevious_secret_expires_atstringv1= until then, 24 hours after the rotation).created_atstringrequiredupdated_atstringMISSING_PARAM or INVALID_PARAM; param names the culprit.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringUNAUTHORIZED: missing, unknown or revoked key.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringNOT_FOUND.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringCONFLICT: idempotent request in flight, or the job is already running/done.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringRATE_LIMITED or CONCURRENCY_LIMIT. Honour Retry-After.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringINTERNAL: our fault, not charged. Quote X-Request-Id.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringhttps://scrapelyserp.com /api/v1/webhook_endpoints/{id}/rotate A new secret, effective at once, returned in secret this once. With overlap: true (the default) the old secret keeps signing too — a second v1= in Scrapely-Signature — for 24 hours, so you can deploy the new one without missing a delivery. overlap: false drops it immediately (use it if the secret leaked).
Parameters
idstringpathrequiredwe_…).Request body application/json
overlapboolean{
"overlap": true
}cURL
curl -X POST "https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/rotate" \
-H "Content-Type: application/json" \
-d '{"overlap":true}'TypeScript
const res = await fetch('https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/rotate', {
method: 'POST',
headers: {
'Content-Type': 'application/json',
},
body: JSON.stringify({"overlap":true}),
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/rotate",
headers={
"Content-Type": "application/json",
},
json={"overlap": True},
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
"strings"
)
func main() {
req, _ := http.NewRequest("POST", "https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/rotate", strings.NewReader(`{"overlap":true}`))
req.Header.Set("Content-Type", "application/json")
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/rotate');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_HTTPHEADER, ['Content-Type: application/json']);
curl_setopt($ch, CURLOPT_POSTFIELDS, '{"overlap":true}');
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/rotate')
req = Net::HTTP::Post.new(uri)
req['Content-Type'] = 'application/json'
req.body = '{"overlap":true}'
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/rotate"))
.header("Content-Type", "application/json")
.method("POST", BodyPublishers.ofString("{\"overlap\":true}"))
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Responses
secret now.Example
{
"id": "we_3f9a1c2e4b5d6a7f8e9c",
"object": {},
"url": "string",
"description": "string",
"events": [
"job.finished"
],
"enabled": true,
"secret_hint": "whsec_…9c41",
"previous_secret_expires_at": "2024-01-01T00:00:00Z",
"created_at": "2024-01-01T00:00:00Z",
"updated_at": "2024-01-01T00:00:00Z",
"secret": "whsec_5b0e…"
}Schema
idstringrequiredobjectrequiredurlstringrequiredcallback_url / webhook_url must equal it to be delivered here.descriptionstringeventsstring[]requirednull (the default): every event. []: none — only deliveries that name this endpoint (a job's callback_url, a watchlist's webhook_url), which it always receives.enabledbooleanrequiredsecret_hintstringrequiredprevious_secret_expires_atstringv1= until then, 24 hours after the rotation).created_atstringrequiredupdated_atstringsecretstringrequiredMISSING_PARAM or INVALID_PARAM; param names the culprit.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringUNAUTHORIZED: missing, unknown or revoked key.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringNOT_FOUND.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringRATE_LIMITED or CONCURRENCY_LIMIT. Honour Retry-After.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringINTERNAL: our fault, not charged. Quote X-Request-Id.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringhttps://scrapelyserp.com /api/v1/webhook_endpoints/{id}/test One signed webhook.test delivery to this endpoint, now, without retries. Recorded in the delivery log.
Parameters
idstringpathrequiredwe_…).cURL
curl -X POST "https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/test"TypeScript
const res = await fetch('https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/test', {
method: 'POST',
});
const data = await res.json();Python
import requests
res = requests.request(
"POST",
"https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/test",
)
data = res.json()Go
package main
import (
"fmt"
"io"
"net/http"
)
func main() {
req, _ := http.NewRequest("POST", "https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/test", nil)
res, _ := http.DefaultClient.Do(req)
defer res.Body.Close()
body, _ := io.ReadAll(res.Body)
fmt.Println(string(body))
}PHP
<?php
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, 'https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/test');
curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'POST');
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$response = curl_exec($ch);
curl_close($ch);
echo $response;Ruby
require 'net/http'
require 'uri'
uri = URI('https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/test')
req = Net::HTTP::Post.new(uri)
res = Net::HTTP.start(uri.hostname, uri.port, use_ssl: uri.scheme == 'https') do |http|
http.request(req)
end
puts res.bodyJava
import java.net.URI;
import java.net.http.*;
import java.net.http.HttpRequest.BodyPublishers;
HttpClient client = HttpClient.newHttpClient();
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("https://scrapelyserp.com/api/v1/webhook_endpoints/{id}/test"))
.method("POST", BodyPublishers.noBody())
.build();
HttpResponse<String> response = client.send(request, HttpResponse.BodyHandlers.ofString());
System.out.println(response.body());Responses
Example
{
"object": {},
"endpoint_id": "string",
"delivered": true,
"status_code": 0,
"duration_ms": 0,
"error": "string"
}Schema
objectendpoint_idstringdeliveredbooleanstatus_codeintegerduration_msintegererrorstringUNAUTHORIZED: missing, unknown or revoked key.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringNOT_FOUND.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringRATE_LIMITED or CONCURRENCY_LIMIT. Honour Retry-After.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstringINTERNAL: our fault, not charged. Quote X-Request-Id.Example
{
"error": {
"code": "MISSING_PARAM",
"message": "string",
"param": "string",
"docs": "/docs/errors#insufficient_credits"
}
}Schema
errorobjectrequiredShow child parameters
codestringrequiredmessage.messagestringrequiredparamstringdocsstring