Unique name for the webhook
The URL to be called
Additional headers that will be sent
All the events you will be notified for
A custom payload
HTTP Basic Authorization username
HTTP Basic Authorization password
Whether the webhook is enabled and sending events or not
Specifies which API version to use when serializing entities in the webhook payload
Whether the you want records present in the payload to show blocks expanded or not
import { buildClient } from '@datocms/cma-client-node';async function run() {const client = buildClient({ apiToken: '<YOUR_API_TOKEN>' });const webhook = await client.webhooks.create({name: 'Item type creation/update',url: 'https://www.example.com/webhook',headers: {'X-Foo': 'Bar'},events: [{entity_type: 'item_type',event_types: ['update','create'],filter: {entity_type: 'item_type',entity_ids: ['42','43']}}],custom_payload: '{ \message\: \'{{event_type}} event triggered on {{entity_type}}!\', \entity_id\: \'{{#entity}}{{id}}{{/entity}}\'] }',http_basic_user: 'user',http_basic_password: 'password'});console.log(webhook);}run();