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

# Webhook

## Webhook

A webhook 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.

## getExecutionLog

This call will return a comprehensive detail of all the webhooks that were executed at a particular execution cycle.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
Call<ResponseBody> response = webhook.getExecutionLog("executionUid").execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

The execution unique ID of the webhook.

## GetExecution

The "Get executions of a webhook" request allows you to fetch the execution details of a specific webhook, which includes the execution UID. These details are instrumental in retrieving webhook logs and retrying a failed webhook.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
Call<ResponseBody> response = webhook.getExecutions().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## importExisting

The "Import an Existing Webhook" request will allow you to update the details of an existing webhook.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
Call<ResponseBody> response = webhook.importExisting().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## export

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
Call<ResponseBody> response = webhook.export().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## retry

This call makes a manual attempt to execute a webhook after the webhook has finished executing its automatic attempts.

When executing the API call, in the URI Parameter section, enter the execution UID that you receive when you execute the 'Get executions of webhooks' call.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
Call<ResponseBody> response = webhook.retry("executionUid").execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

The execution unique ID of the webhook.

## removeParam

Set header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
webhook.removeParam("key");
```

Removes query parameters using the key of the request.

## find

The "Get all Webhooks request" returns comprehensive information on all the available webhooks in the specified stack

When executing the API call, under the Header section, you need to enter the authtoken that you receive after logging into your account.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
Call<ResponseBody> response = webhook.find().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## fetch

The "Get webhook" request returns comprehensive information on a specific webhook.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
Call<ResponseBody> response = webhook.fetch().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## delete

The "Delete webhook" call deletes an existing webhook from a stack.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
Call<ResponseBody> response = webhook.delete().execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

## addParam

Sets header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
webhook.addParam("key", value);
```

Query parameter key for the request.

Query parameter value for the request.

## addHeader

Sets header for the request.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
webhook.addHeader("key", value);
```

Header key for the request.

Header value for the request.

## update

The "Update webhook" request allows you to update the details of an existing webhook in the stack.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
Call<ResponseBody> response = webhook.update(requestBody).execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

The body should be of a JSONObject type.

## importWebhook

The **Import Webhook** section consists of the following two requests that will help you to import new Webhooks or update existing ones by uploading JSON files.

```
import contentstack;
Contentstack contentstack = new Contentstack.Builder().build();
Webhook webhook = contentstack.stack().webhook();
Call<ResponseBody> response = webhook.importWebhook("filename","jsonPath").execute();
if (response.isSuccessful) {
    System.out.println("Response" + response);
}
```

the file name

jsonPath like example "/Downloads/import.json"

## Webhook | Java Management SDK | Contentstack

Webhook sends real-time event data to third-party apps or services to keep your application in sync with your account in the Java Management SDK.