# Retrieve a webhook endpoint

> For the complete machine-readable documentation index, see [llms.txt](https://apidocs.chargebee.com/llms.txt).


Retrieves the details of a specific webhook endpoint using its unique identifier. Use this API to inspect an endpoint's configuration, such as the target URL, subscribed events, and authentication settings.

## Sample Request

#### cURL

```bash
curl  https://{site}.chargebee.com/api/v2/webhook_endpoints/whv2_198PKVUX26UX9IvR \
     -u {site_api_key}:
```

#### .NET

```dotnet
using ChargeBee.Api;
using ChargeBee.Models;

ApiConfig.Configure("{site}","{site_api_key}");
EntityResult result = WebhookEndpoint.Retrieve("whv2_198PKVUX26UX9IvR").Request();

WebhookEndpoint webhookEndpoint = result.WebhookEndpoint;
```

#### Go

```go
package main
import (
    "fmt"
    "github.com/chargebee/chargebee-go/v3"
    webhookendpointAction "github.com/chargebee/chargebee-go/v3/actions/webhookendpoint"
)
func main() {
    chargebee.Configure("{site_api_key}","{site}");
    res,err := webhookendpointAction.Retrieve("whv2_198PKVUX26UX9IvR").Request()
    if err != nil {
        fmt.Println(err)
    } else {
        WebhookEndpoint := res.WebhookEndpoint
    }
}
```

#### Go

```go
package main

import (
  "fmt"
  "github.com/chargebee/chargebee-go/v4"
)

func main() {
  config := &chargebee.ClientConfig{
    SiteName: "{site}",
    ApiKey: "{site_api_key}",
  }    
  client := chargebee.NewClient(config)
  req := &chargebee.WebhookEndpointRetrieveRequest{
    Id : "whv2_198PKVUX26UX9IvR",
}
  res, err := client.WebhookEndpoint.Retrieve(req)
      if err != nil {
        fmt.Println(err)
    } else {
        WebhookEndpoint := res.WebhookEndpoint
    }
}
```

#### Java

```java
import com.chargebee.*;
import com.chargebee.ListResult;
import com.chargebee.models.*;
import com.chargebee.models.enums.*;
import java.io.IOException;

public class Sample {

    public static void main(String args[]) throws IOException, Exception {
        Environment.configure("{site}", "{site_api_key}");
        Result result = WebhookEndpoint.retrieve("whv2_198PKVUX26UX9IvR").request();

        WebhookEndpoint webhookEndpoint = result.webhookEndpoint();
    }
}
```

#### Java

```java
import com.chargebee.v4.client.ChargebeeClient;
import com.chargebee.v4.models.webhookEndpoint.WebhookEndpoint;
import com.chargebee.v4.models.webhookEndpoint.params.WebhookEndpointRetrieveParams;
import com.chargebee.v4.models.webhookEndpoint.responses.WebhookEndpointRetrieveResponse;

public class WebhookEndpointRetrieve {

    public static void main(String[] args) {
        ChargebeeClient client = ChargebeeClient.builder()
            .apiKey("{site_api_key}")
            .siteName("{site}")
            .build();

        WebhookEndpointRetrieveResponse response = client.webhookEndpoints().retrieve("whv2_198PKVUX26UX9IvR");

        WebhookEndpoint webhookEndpoint = response.getWebhookEndpoint();
    }
}
```

#### Node.js

```node
import Chargebee from "chargebee";

const chargebee = new Chargebee({
    site: "{site}",
    apiKey: "{site_api_key}",
});

try {
    const result = await chargebee.webhookEndpoint.retrieve("whv2_198PKVUX26UX9IvR");

    console.log(result);
    const webhookEndpoint = result.webhook_endpoint;
} catch (err) {
    console.log(err);
}
```

#### PHP

```php
<?php

require __DIR__ . '/vendor/autoload.php';

use Chargebee\ChargebeeClient;

$chargebee = new ChargebeeClient(options: [
    "site" => "{site}",
    "apiKey" => "{site_api_key}",
]);
$result = $chargebee->webhookEndpoint()->retrieve("whv2_198PKVUX26UX9IvR");
$webhookEndpoint = $result->webhook_endpoint;
```

#### Python

```python
from chargebee import Chargebee

cb_client = Chargebee(api_key="{site_api_key}", site="{site}")
response = cb_client.WebhookEndpoint.retrieve("whv2_198PKVUX26UX9IvR")
webhook_endpoint = response.webhook_endpoint
```

#### Ruby

```ruby
require 'chargebee'

ChargeBee.configure(:site => "{site}",
  :api_key => "{site_api_key}")

result = ChargeBee::WebhookEndpoint.retrieve("whv2_198PKVUX26UX9IvR")

webhook_endpoint = result.webhook_endpoint
```

## Sample Response

```json
{
  "webhook_endpoint": {
    "id": "whv2_198PKVUX26UX9IvR",
    "name": "Notify Subscription",
    "api_version": "v2",
    "enabled_events": [
      "subscription_created",
      {..}
    ],
    "url": "https://{host}.com",
    "primary_url": true,
    "send_card_resource": false,
    "disabled": false
  }
}
```

## URL Format

**GET** https://[site].chargebee.com/api/v2/webhook_endpoints/{webhook-endpoint-id}

## Returns

- `webhook_endpoint` (Webhook endpoint object)
  Resource object representing webhook\_endpoint
