> ## Documentation Index
> Fetch the complete documentation index at: https://docs.yabetoopay.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Get Webhook

> Retrieve details of an existing webhook.

## Endpoint

```bash theme={null}
GET https://pay.sandbox.yabetoopay.com/v1/account/{accountId}/webhooks/{id}   # Sandbox
GET https://pay.api.yabetoopay.com/v1/account/{accountId}/webhooks/{id}       # Production
```

## Authentication

Use your secret key in the `Authorization` header:

```bash theme={null}
Authorization: Bearer YOUR_SECRET_KEY
```

## Path Parameters

| Parameter   | Type     | Description     |
| ----------- | -------- | --------------- |
| `accountId` | `string` | Your account ID |
| `id`        | `string` | The webhook ID  |

## Example Request

<CodeGroup>
  ```bash cURL theme={null}
  curl https://pay.sandbox.yabetoopay.com/v1/account/YOUR_ACCOUNT_ID/webhooks/whk_123456789 \
    -H "Authorization: Bearer YOUR_SECRET_KEY"
  ```

  ```javascript JavaScript theme={null}
  import Yabetoo from "@yabetoo/sdk-js";

  const yabetoo = new Yabetoo("YOUR_SECRET_KEY");

  const webhook = await yabetoo.webhooks.retrieve("whk_123456789");
  ```

  ```python Python theme={null}
  from yabetoo import Yabetoo

  yabetoo = Yabetoo("YOUR_SECRET_KEY")

  webhook = yabetoo.webhooks.retrieve("whk_123456789")
  ```

  ```php PHP theme={null}
  <?php
  require 'vendor/autoload.php';

  use Yabetoo\Yabetoo;

  $yabetoo = new Yabetoo("YOUR_SECRET_KEY");

  $webhook = $yabetoo->webhooks->retrieve("whk_123456789");
  ```

  ```java Java theme={null}
  import com.yabetoo.Yabetoo;
  import com.yabetoo.YabetooConfig;
  import com.yabetoo.model.Webhook;

  YabetooConfig config = new YabetooConfig()
      .setApiKey("YOUR_SECRET_KEY");

  Yabetoo yabetoo = new Yabetoo(config);

  Webhook webhook = yabetoo.webhooks().retrieve("whk_123456789");
  ```
</CodeGroup>

## Response

### 200 OK

```json theme={null}
{
  "id": "whk_123456789",
  "object": "webhook",
  "url": "https://example.com/webhooks",
  "description": "Production webhook",
  "status": "active",
  "enabled_events": [
    "intent.completed",
    "disbursement.completed"
  ],
  "metadata": {
    "environment": "production"
  },
  "created_at": "2023-05-12T10:12:32Z",
  "last_error": null,
  "stats": {
    "successful_deliveries": 150,
    "failed_deliveries": 2,
    "average_response_time": 245
  }
}
```

### Webhook Status

| Status     | Description                              |
| ---------- | ---------------------------------------- |
| `active`   | Webhook is active and functional         |
| `disabled` | Webhook manually disabled                |
| `failed`   | Webhook disabled after too many failures |

### Error Types

| Type               | Description                    |
| ------------------ | ------------------------------ |
| `connection_error` | Unable to connect to URL       |
| `timeout_error`    | Response timeout exceeded      |
| `invalid_response` | Invalid response (code != 200) |
| `ssl_error`        | SSL certificate error          |

### 404 Not Found

```json theme={null}
{
  "message": "Webhook not found"
}
```

### 401 Unauthorized

```json theme={null}
{
  "message": "Unauthorized"
}
```
