Sorry, no results found for "".

Show examples in:
Javascript HTTP
Endpoint info
Available examples

Content Management API > Webhook

List all webhooks

Returns

Returns an array of resource objects of type webhook

Examples

import { buildClient } from "@datocms/cma-client-node";
async function run() {
const client = buildClient({ apiToken: process.env.DATOCMS_API_TOKEN });
const webhooks = await client.webhooks.list();
for (const webhook of webhooks) {
// Check the 'Returned output' tab for the result ☝️
console.log(webhook);
}
}
run();
{
id: "312",
name: "Item type creation/update",
url: "https://www.example.com/webhook",
enabled: true,
headers: { "X-Foo": "Bar" },
events: [{ entity_type: "item", event_types: ["update"] }],
http_basic_user: "user",
http_basic_password: "password",
custom_payload: '{ "message": "{{event_type}} event triggered on {{entity_type}}!", "entity_id": "{{#entity}}{{id}}{{/entity}}"] }',
payload_api_version: "3",
nested_items_in_payload: true,
auto_retry: true,
}