> ## Documentation Index
> Fetch the complete documentation index at: https://razorpay-881012b3.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Fetch All Webhooks

> Fetch and view the details of all webhooks using Razorpay APIs.

<div style={{display:"flex",flexWrap:"wrap",alignItems:"center",gap:"0.35rem 0.9rem",border:"1px solid rgba(128,128,128,0.28)",borderRadius:"0.5rem",padding:"0.45rem 0.75rem",margin:"0 0 1.25rem",fontSize:"0.875rem"}}>
  <span style={{fontWeight:600}}>Available in</span>
  <span>🇮🇳 India</span>
  <span>🇸🇬 Singapore</span>
  <span>🇺🇸 United States</span>
</div>

Use this endpoint to retrieve all webhooks for a given account. Know about the [various error responses](/docs/us/api/partners/errors) for this API.

<RequestExample>
  ```bash Curl theme={null}
  curl -u <YOUR_KEY_ID>:<YOUR_KEY_SECRET> \
  - X GET https://api.razorpay.com/v2/accounts/acc_H3kYHQ635sBwXG/webhooks   \
  ```

  ```java Java theme={null}
  RazorpayClient razorpay = new RazorpayClient("[ACCESS_TOKEN]");

  String accountId = "acc_GP4lfNA0iIMn5B";

  Webhook webhook = instance.webhook.fetchAll(accountId);
  ```

  ```ruby Ruby theme={null}
  require "razorpay"
  Razorpay.setup('ACCESS_TOKEN')
  accountId = "acc_GP4lfNA0iIMn5B";

  Razorpay::Webhook.all({
   "count": 1
  }, accountId);
  ```

  ```csharp .NET theme={null}
  RazorpayClient client = new RazorpayClient("[ACCESS_TOKEN]");

  string accountId = "acc_ua2tBezhcEBvap";

  List<Webhook> webhook = client.Webhook.All(accountId);
  ```
</RequestExample>

<ResponseExample>
  ```json Success theme={null}
  {
    "entity": "collection",
    "count": 1,
    "items": [
      {
        "id": "HK890egfiItP3H",
        "created_at": 1624060358,
        "updated_at": 1624060358,
        "service": "beta-api-test",
        "owner_id": "H3kYHQ635sBwXG",
        "owner_type": "merchant",
        "context": [],
        "disabled_at": 0,
        "url": "https://en1mwkqo5ioct.x.pipedream.net",
        "alert_email": "gaurav.kumar@example.com",
        "secret_exists": true,
        "entity": "webhook",
        "active": true,
        "events": [
          "payment.authorized",
          "payment.failed",
          "payment.captured",
          "payment.dispute.created",
          "refund.failed",
          "refund.created"
        ]
      }
    ]
  }
  ```
</ResponseExample>

## Path Parameters

<ParamField path="account_id" type="string" required>
  The unique identifier of a sub-merchant account generated by Razorpay for which a webhook is created. For example, `acc_H3kYHQ635sBwXG`.
</ParamField>

## Query Parameters

<ParamField query="from" type="integer">
  Timestamp, in seconds, from when the webhooks are to be fetched.
</ParamField>

<ParamField query="to" type="integer">
  Timestamp, in seconds, till when the webhooks are to be fetched.
</ParamField>

<ParamField query="count" type="integer">
  Number of webhooks to be fetched. The default value is `10` and the maximum value is `100`. This can be used for pagination, in combination with `skip`.
</ParamField>

<ParamField query="skip" type="integer">
  Number of records to be skipped while fetching the webhooks. This can be used for pagination, in combination with `count`.
</ParamField>

## Response Parameters

<ResponseField name="id" type="string">
  The unique identifier of the created webhook. For example, `HK890egfiItP3H`. This id is used to fetch, update or delete a webhook. The maximum length is 14 characters.
</ResponseField>

<ResponseField name="created_at" type="integer">
  The Unix timestamp at which the webhook has been created.
</ResponseField>

<ResponseField name="updated_at" type="integer">
  The Unix timestamp at which the webhook has been updated.
</ResponseField>

<ResponseField name="owner_id" type="string">
  The unique identifier generated by Razorpay for the sub-merchant who will receive the webhooks. For example, in this case, it will be `account_id` passed in the API URL.
</ResponseField>

<ResponseField name="owner_type" type="string">
  Indicates the type of owner. For example, in this case, it will be the merchant.
</ResponseField>

<ResponseField name="url" type="string">
  The URL where you receive the webhook payload when an event is triggered. The maximum length is 255 characters.
</ResponseField>

<ResponseField name="secret" type="string">
  A secret for the webhook endpoint used to validate that the webhook is from Razorpay.
</ResponseField>

<ResponseField name="alert_email" type="string">
  This is the email address to which notifications must be sent in case of webhook failure.
</ResponseField>

<ResponseField name="secret_exists" type="boolean">
  This attribute is set to `true` if a secret password has been set for the webhook endpoint. If no secret is sent in the request, this parameter does not appear in the response code.
</ResponseField>

<ResponseField name="entity" type="string">
  Indicates the type of entity. For example, in this case, it will be **webhook**.
</ResponseField>

<ResponseField name="active" type="string">
  Indicates the status of webhook.

  * `true`: Webhook is activated.
  * `false`: Webhook is deactivated.
</ResponseField>

<ResponseField name="events" type="object">
  The required events from the list of Active Events. For example, `payment.authorized`, `payment.captured`, `payment.failed`, `payment.dispute.created`, `refund.failed`, `refund.created` and so on.
</ResponseField>
