---
title: "Webhook"
description: "Webhook"
url: "https://www.contentstack.com/docs/developers/sdks/content-management-sdk/javascript/reference/webhook"
product: "Contentstack"
doc_type: "guide"
audience:
  - developers
  - admins
version: "current"
last_updated: "2026-09-08"
---

# Webhook

## Webhook

A [webhook](/docs/headless-cms/about-webhooks) is a mechanism that sends real-time information to any third-party app or service to keep your application in sync with your Contentstack account. Webhooks allow you to specify a URL to which you would like Contentstack to post data when an event happens.

## update

The Update Webhook call lets you update the name and description of an existing Webhook.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).webhook('webhook_uid')
.fetch()
.then((webhook) => {
 webhook.title = 'My New Webhook'
 webhook.description = 'Webhook description'
 return webhook.update()
})
.then((webhook) => console.log(webhook))
```

## delete

The Delete Webhook call is used to delete an existing Webhook permanently from your Stack.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).webhook('webhook_uid')
.delete()
.then((response) => console.log(response.notice))
```

## fetch

The fetch Webhook call fetches Webhook details.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).webhook('webhook_uid')
.fetch()
.then((webhook) => console.log(webhook))
```

## executions

The Get executions of a webhook call will provide the execution details of a specific webhook, which includes the execution UID.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).webhook('webhook_uid')
.executions()
.then((webhook) => console.log(webhook))
```

## retry

The retry webhook execution will perform retry execution.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })
client.stack({ api_key: 'api_key'})
.retry( executionUid )
.then((webhook) => console.log(webhook))
```

execution UID that you receive when you execute the 'Get executions of webhooks' call.

## create

The Create a webhook request allows you to create a new webhook in a specific stack.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const webhook = {
name: 'Test',
destinations: [{
  target_url: 'http://example.com',
  http_basic_auth: 'basic',
  http_basic_password: 'test',
  custom_header: [{
    header_name: 'Custom',
    value: 'testing'
  }]
}],
 channels: [
   'assets.create'
 ],
 retry_policy: 'manual',
 disabled: false
}

client.stack({ api_key: 'api_key'}).webhook()
.create({ webhook })
.then((webhook) => console.log(webhook))
```

The webhook details including name, destinations, channels, and retry policy.

## fetchAll

The Get all Webhook call lists all Webhooks from Stack.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

client.stack({ api_key: 'api_key'}).webhook()
.fetchAll()
.then((webhook) => console.log(webhook))
```

The \`include\_count’ parameter includes the count of total number of webhook in your stack, along with the details of each webhook.

The ‘limit’ parameter will return a specific number of webhook in the output.

The ‘skip’ parameter will skip a specific number of webhook in the response.

## import

The Import a webhook call imports a web hook into a stack.

```
import * as contentstack from '@contentstack/management'
const client = contentstack.client({ authtoken })

const data = {
 webhook: 'path/to/file.json',
}

client.stack({ api_key: 'api_key'}).webhook().import(data)
.then((webhook) => console.log(webhook))

//OR
client.stack({ api_key: 'api_key'}).webhook('webhook_uid').import(data)
.then((webhook) => console.log(webhook))
```

File path to import webhook

## Webhook | JavaScript Management SDK | Contentstack

Webhook sends real-time event data to third-party apps to keep them in sync with your account, in the JavaScript Management SDK.