Skip to main content
POST
/
catchAll
/
webhooks
/
{webhook_id}
/
resources
Assign resource to webhook
curl --request POST \
  --url https://catchall.newscatcherapi.com/catchAll/webhooks/{webhook_id}/resources \
  --header 'Content-Type: application/json' \
  --header 'x-api-key: <api-key>' \
  --data '
{
  "resource_type": "monitor",
  "resource_id": "3fec5b07-8786-46d7-9486-d43ff67eccd4"
}
'
import requests

url = "https://catchall.newscatcherapi.com/catchAll/webhooks/{webhook_id}/resources"

payload = {
"resource_type": "monitor",
"resource_id": "3fec5b07-8786-46d7-9486-d43ff67eccd4"
}
headers = {
"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: {'x-api-key': '<api-key>', 'Content-Type': 'application/json'},
body: JSON.stringify({resource_type: 'monitor', resource_id: '3fec5b07-8786-46d7-9486-d43ff67eccd4'})
};

fetch('https://catchall.newscatcherapi.com/catchAll/webhooks/{webhook_id}/resources', 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://catchall.newscatcherapi.com/catchAll/webhooks/{webhook_id}/resources",
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([
'resource_type' => 'monitor',
'resource_id' => '3fec5b07-8786-46d7-9486-d43ff67eccd4'
]),
CURLOPT_HTTPHEADER => [
"Content-Type: application/json",
"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://catchall.newscatcherapi.com/catchAll/webhooks/{webhook_id}/resources"

payload := strings.NewReader("{\n \"resource_type\": \"monitor\",\n \"resource_id\": \"3fec5b07-8786-46d7-9486-d43ff67eccd4\"\n}")

req, _ := http.NewRequest("POST", url, payload)

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://catchall.newscatcherapi.com/catchAll/webhooks/{webhook_id}/resources")
.header("x-api-key", "<api-key>")
.header("Content-Type", "application/json")
.body("{\n \"resource_type\": \"monitor\",\n \"resource_id\": \"3fec5b07-8786-46d7-9486-d43ff67eccd4\"\n}")
.asString();
require 'uri'
require 'net/http'

url = URI("https://catchall.newscatcherapi.com/catchAll/webhooks/{webhook_id}/resources")

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

request = Net::HTTP::Post.new(url)
request["x-api-key"] = '<api-key>'
request["Content-Type"] = 'application/json'
request.body = "{\n \"resource_type\": \"monitor\",\n \"resource_id\": \"3fec5b07-8786-46d7-9486-d43ff67eccd4\"\n}"

response = http.request(request)
puts response.read_body
{
  "success": true,
  "message": "Resource assigned to webhook.",
  "already_existed": false,
  "mapping": {
    "id": "f1e2d3c4-b5a6-7890-abcd-ef1234567890",
    "webhook_id": "a1b2c3d4-e5f6-7890-abcd-ef1234567890",
    "resource_type": "monitor",
    "resource_id": "3fec5b07-8786-46d7-9486-d43ff67eccd4",
    "assigned_at": "2026-05-18T10:00:00Z"
  }
}

Authorizations

x-api-key
string
header
required

API key for authentication.

Path Parameters

webhook_id
string<uuid>
required

Unique webhook identifier.

Body

application/json
resource_type
enum<string>
required

Type of resource to assign.

Available options:
job,
monitor,
monitor_group
resource_id
string<uuid>
required

ID of the resource to assign.

Example:

"3fec5b07-8786-46d7-9486-d43ff67eccd4"

Response

Resource assigned to webhook.

success
boolean
required

True if the operation succeeded; false otherwise.

Example:

true

message
string

Human-readable result message.

Example:

"Resource assigned to webhook."

already_existed
boolean
default:false

True if the assignment already existed before this request.

Example:

false

mapping
object

The created or existing resource mapping.