Regulatory Monitoring API
Create or update a regulatory source watch
POST
/
api
/
v1
/
regulatory-monitoring
/
source-watches
Create or update a regulatory source watch
curl --request POST \
--url https://api.esheria.ai/api/v1/regulatory-monitoring/source-watches \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"authority_type": "binding",
"check_interval_seconds": 86400,
"domain_pack_id": "UK-DATA-PROTECTION-PRIVACY",
"expected_hash_sha256": "known-source-hash",
"source_asset_id": "src_uk_ico_data_protection_guidance",
"source_kind": "binding",
"source_uri": "https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/"
}
'import requests
url = "https://api.esheria.ai/api/v1/regulatory-monitoring/source-watches"
payload = {
"authority_type": "binding",
"check_interval_seconds": 86400,
"domain_pack_id": "UK-DATA-PROTECTION-PRIVACY",
"expected_hash_sha256": "known-source-hash",
"source_asset_id": "src_uk_ico_data_protection_guidance",
"source_kind": "binding",
"source_uri": "https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/"
}
headers = {
"idempotency-key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
authority_type: 'binding',
check_interval_seconds: 86400,
domain_pack_id: 'UK-DATA-PROTECTION-PRIVACY',
expected_hash_sha256: 'known-source-hash',
source_asset_id: 'src_uk_ico_data_protection_guidance',
source_kind: 'binding',
source_uri: 'https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/'
})
};
fetch('https://api.esheria.ai/api/v1/regulatory-monitoring/source-watches', 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.esheria.ai/api/v1/regulatory-monitoring/source-watches",
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([
'authority_type' => 'binding',
'check_interval_seconds' => 86400,
'domain_pack_id' => 'UK-DATA-PROTECTION-PRIVACY',
'expected_hash_sha256' => 'known-source-hash',
'source_asset_id' => 'src_uk_ico_data_protection_guidance',
'source_kind' => 'binding',
'source_uri' => 'https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"idempotency-key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$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.esheria.ai/api/v1/regulatory-monitoring/source-watches"
payload := strings.NewReader("{\n \"authority_type\": \"binding\",\n \"check_interval_seconds\": 86400,\n \"domain_pack_id\": \"UK-DATA-PROTECTION-PRIVACY\",\n \"expected_hash_sha256\": \"known-source-hash\",\n \"source_asset_id\": \"src_uk_ico_data_protection_guidance\",\n \"source_kind\": \"binding\",\n \"source_uri\": \"https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
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.esheria.ai/api/v1/regulatory-monitoring/source-watches")
.header("idempotency-key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"authority_type\": \"binding\",\n \"check_interval_seconds\": 86400,\n \"domain_pack_id\": \"UK-DATA-PROTECTION-PRIVACY\",\n \"expected_hash_sha256\": \"known-source-hash\",\n \"source_asset_id\": \"src_uk_ico_data_protection_guidance\",\n \"source_kind\": \"binding\",\n \"source_uri\": \"https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.esheria.ai/api/v1/regulatory-monitoring/source-watches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"authority_type\": \"binding\",\n \"check_interval_seconds\": 86400,\n \"domain_pack_id\": \"UK-DATA-PROTECTION-PRIVACY\",\n \"expected_hash_sha256\": \"known-source-hash\",\n \"source_asset_id\": \"src_uk_ico_data_protection_guidance\",\n \"source_kind\": \"binding\",\n \"source_uri\": \"https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/\"\n}"
response = http.request(request)
puts response.read_body{
"status": "error",
"errors": [
{
"code": "unauthorized",
"message": "Invalid API key"
}
],
"trace_id": "trace-123"
}{
"status": "error",
"errors": [
{
"code": "credits_exhausted",
"message": "API credits exhausted"
}
],
"trace_id": "trace-123"
}{
"status": "error",
"errors": [
{
"code": "duplicate_token_name",
"message": "An active data token already uses that name."
}
],
"trace_id": "trace-123"
}{
"status": "error",
"errors": [
{
"code": "validation_error",
"message": "Invalid payload",
"field": "body.name"
}
],
"trace_id": "trace-123"
}{
"status": "error",
"errors": [
{
"code": "billing_unavailable",
"message": "Billing ledger is unavailable"
}
],
"trace_id": "trace-123"
}Authorizations
Client API key issued by Esheria.
Headers
Unique key for mutating request replay protection.
Body
application/json
Required string length:
2 - 160Required string length:
2 - 2000Maximum string length:
240Available options:
binding, guidance, watchlist, context Available options:
binding, non_binding, watchlist, context Maximum string length:
128Maximum string length:
256Maximum string length:
256Required range:
x >= 60Available options:
active, paused, retired Response
Successful Response
List configured regulatory source watches
Previous
List source currentness from the latest monitoring snapshots
Next
⌘I
Create or update a regulatory source watch
curl --request POST \
--url https://api.esheria.ai/api/v1/regulatory-monitoring/source-watches \
--header 'Content-Type: application/json' \
--header 'idempotency-key: <idempotency-key>' \
--header 'x-api-key: <api-key>' \
--data '
{
"authority_type": "binding",
"check_interval_seconds": 86400,
"domain_pack_id": "UK-DATA-PROTECTION-PRIVACY",
"expected_hash_sha256": "known-source-hash",
"source_asset_id": "src_uk_ico_data_protection_guidance",
"source_kind": "binding",
"source_uri": "https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/"
}
'import requests
url = "https://api.esheria.ai/api/v1/regulatory-monitoring/source-watches"
payload = {
"authority_type": "binding",
"check_interval_seconds": 86400,
"domain_pack_id": "UK-DATA-PROTECTION-PRIVACY",
"expected_hash_sha256": "known-source-hash",
"source_asset_id": "src_uk_ico_data_protection_guidance",
"source_kind": "binding",
"source_uri": "https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/"
}
headers = {
"idempotency-key": "<idempotency-key>",
"x-api-key": "<api-key>",
"Content-Type": "application/json"
}
response = requests.post(url, json=payload, headers=headers)
print(response.text)const options = {
method: 'POST',
headers: {
'idempotency-key': '<idempotency-key>',
'x-api-key': '<api-key>',
'Content-Type': 'application/json'
},
body: JSON.stringify({
authority_type: 'binding',
check_interval_seconds: 86400,
domain_pack_id: 'UK-DATA-PROTECTION-PRIVACY',
expected_hash_sha256: 'known-source-hash',
source_asset_id: 'src_uk_ico_data_protection_guidance',
source_kind: 'binding',
source_uri: 'https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/'
})
};
fetch('https://api.esheria.ai/api/v1/regulatory-monitoring/source-watches', 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.esheria.ai/api/v1/regulatory-monitoring/source-watches",
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([
'authority_type' => 'binding',
'check_interval_seconds' => 86400,
'domain_pack_id' => 'UK-DATA-PROTECTION-PRIVACY',
'expected_hash_sha256' => 'known-source-hash',
'source_asset_id' => 'src_uk_ico_data_protection_guidance',
'source_kind' => 'binding',
'source_uri' => 'https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"idempotency-key: <idempotency-key>",
"x-api-key: <api-key>"
],
]);
$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.esheria.ai/api/v1/regulatory-monitoring/source-watches"
payload := strings.NewReader("{\n \"authority_type\": \"binding\",\n \"check_interval_seconds\": 86400,\n \"domain_pack_id\": \"UK-DATA-PROTECTION-PRIVACY\",\n \"expected_hash_sha256\": \"known-source-hash\",\n \"source_asset_id\": \"src_uk_ico_data_protection_guidance\",\n \"source_kind\": \"binding\",\n \"source_uri\": \"https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/\"\n}")
req, _ := http.NewRequest("POST", url, payload)
req.Header.Add("idempotency-key", "<idempotency-key>")
req.Header.Add("x-api-key", "<api-key>")
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.esheria.ai/api/v1/regulatory-monitoring/source-watches")
.header("idempotency-key", "<idempotency-key>")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"authority_type\": \"binding\",\n \"check_interval_seconds\": 86400,\n \"domain_pack_id\": \"UK-DATA-PROTECTION-PRIVACY\",\n \"expected_hash_sha256\": \"known-source-hash\",\n \"source_asset_id\": \"src_uk_ico_data_protection_guidance\",\n \"source_kind\": \"binding\",\n \"source_uri\": \"https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/\"\n}")
.asString();require 'uri'
require 'net/http'
url = URI("https://api.esheria.ai/api/v1/regulatory-monitoring/source-watches")
http = Net::HTTP.new(url.host, url.port)
http.use_ssl = true
request = Net::HTTP::Post.new(url)
request["idempotency-key"] = '<idempotency-key>'
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"authority_type\": \"binding\",\n \"check_interval_seconds\": 86400,\n \"domain_pack_id\": \"UK-DATA-PROTECTION-PRIVACY\",\n \"expected_hash_sha256\": \"known-source-hash\",\n \"source_asset_id\": \"src_uk_ico_data_protection_guidance\",\n \"source_kind\": \"binding\",\n \"source_uri\": \"https://ico.org.uk/for-organisations/uk-gdpr-guidance-and-resources/\"\n}"
response = http.request(request)
puts response.read_body{
"status": "error",
"errors": [
{
"code": "unauthorized",
"message": "Invalid API key"
}
],
"trace_id": "trace-123"
}{
"status": "error",
"errors": [
{
"code": "credits_exhausted",
"message": "API credits exhausted"
}
],
"trace_id": "trace-123"
}{
"status": "error",
"errors": [
{
"code": "duplicate_token_name",
"message": "An active data token already uses that name."
}
],
"trace_id": "trace-123"
}{
"status": "error",
"errors": [
{
"code": "validation_error",
"message": "Invalid payload",
"field": "body.name"
}
],
"trace_id": "trace-123"
}{
"status": "error",
"errors": [
{
"code": "billing_unavailable",
"message": "Billing ledger is unavailable"
}
],
"trace_id": "trace-123"
}