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

# Create a Webhook

export const ParamList = ({items = [], is_child = false}) => {
  return items.map(item => {
    const field_props = {
      id: Math.random().toString(),
      body: item.name,
      name: item.name,
      type: item.type,
      required: item.required
    };
    const enums = item.enums || [];
    const items = item.items || [];
    const has_items = items?.length > 0;
    const has_enums = enums?.length > 0;
    const should_default_open = item.defaultOpen || false;
    const render_child_item = () => {
      const child_props = {
        title: has_enums ? "Possible enum values" : "properties"
      };
      if (should_default_open) child_props.defaultOpen = true;
      const has_inline_enums = has_enums && enums.every(enum_item => typeof enum_item === 'string') && enums.map((enum_item, idx) => {
        const is_last = idx === enums.length - 1;
        const is_2nd_to_last = idx === enums.length - 2;
        return <>
            <code>{enum_item}</code>
            {is_last && ''}
            {is_2nd_to_last && ' or '}
            {!is_last && !is_2nd_to_last && ', '}
          </>;
      });
      const enum_list = has_enums && !has_inline_enums && <Accordion {...child_props}>
          {enums.map((enum_item, index) => <div key={`enum-${index}`}>
              <code>{enum_item.name}</code>
              <br />
              <p>{enum_item.description}</p>
            </div>)}
        </Accordion>;
      const item_list = has_items && <Expandable {...child_props}>
          <ParamList items={items || []} is_child />
        </Expandable>;
      return <>
          <p>
            {item.description}
            {has_inline_enums && [has_inline_enums.length > 1 ? ' One of ' : ' Must be ', ...has_inline_enums]}
          </p>

          {enum_list}
          {item_list}
        </>;
    };
    return is_child ? <ResponseField {...field_props}>{render_child_item()}</ResponseField> : <ParamField {...field_props}>{render_child_item()}</ParamField>;
  });
};

Creating a new Webhook means registering a URL to receive
updates for a specific event type. Once a resource is
created or updated, your application will be notified
via an HTTPS POST request with the event information.

## Body

<ParamList
  items={[
{
name: 'type',
type: 'enum',
required: true,
description: (
  <>
    The event type to be sent to this
    URL. See <a href="/2026-03-30/reference/webhooks/overview#webhook-event-types">Webhook Event Types.</a>
  </>
),
},
{
name: 'url',
type: 'string',
required: true,
description: (
  <>
    The URL receiving the Webhook event.

    <Tip>
      When testing your integration in a local environment, we recommend
      utilizing the following technologies for a seamless developer experience
      with Webhooks:
      <br/>
      <ul>
        <li>
          <a href="https://webhook.site" target="_blank">https://webhook.site</a> – to debug
          the Webhook payload from Method.
        </li>
        <li>
          <a href="https://ngrok.com" target="_blank">https://ngrok.com</a> – to create a reverse
          proxy to your local development environment.
        </li>
      </ul>
    </Tip>
  </>
),
},
{
name: 'auth_token',
type: 'string',
required: false,
description: (
  <>
    Secret token for request validation. Will be sent as
    a <code>base64</code> encoded string in
    the <code>Authorization</code> header of the Webhook.

    <Tip>
      <a href="/2026-03-30/reference/webhooks/overview#webhook-request-validation:1-authorization-header-verification" target="_blank">Authorization Header Verification </a> – <code>base64</code> encoded string in the <code>Authorization</code> header of the webhook.
    </Tip>
  </>
),
},
{
name: 'hmac_secret',
type: 'string',
required: false,
description: (
  <>
    Secret token used for computing HMAC signature. Used to compute
    the HMAC signature in the <code>method-webhook-signature</code> header of the Webhook.

    <Tip>
      <a href="/2026-03-30/reference/webhooks/overview#webhook-request-validation:2-hmac-verification" target="_blank">HMAC Verification</a> – HMAC signature in the <code>method-webhook-signature</code> header of the webhook.
    </Tip>
  </>
),
},
{
name: 'expand_event',
type: 'boolean',
required: false,
description: (
  <>
    Whether to expand the event object in the Webhook payload. (default: false)
  </>
),
}
]}
/>

## Returns

Returns the newly created Webhook object.

<RequestExample>
  ```bash cURL theme={null}
  curl https://production.methodfi.com/webhooks \
    -X POST \
    -H "Method-Version: 2026-03-30" \
    -H "Authorization: Bearer sk_WyZEWVfTcH7GqmPzUPk65Vjc" \
    -H "Content-Type: application/json" \
    -d '{
      "type": "payment.update",
      "url": "https://reference.example.app/webhook",
      "auth_token": "md7UqcTSmvXCBzPORDwOkE",
      "hmac_secret": "bd7UscLSmvEXazTOQDwOKW",
      "expand_event": true
    }'
  ```

  ```javascript Node.js theme={null}
  const webhook = await method.webhooks.create({
    type: 'payment.update',
    url: 'https://reference.example.app/webhook',
    auth_token: 'md7UqcTSmvXCBzPORDwOkE',
    hmac_secret: 'bd7UscLSmvEXazTOQDwOKW',
    expand_event: true
  });
  ```

  ```python Python theme={null}
  webhook = method.webhooks.create({
    'type': 'payment.update',
    'url': 'https://reference.example.app/webhook',
    'auth_token': 'md7UqcTSmvXCBzPORDwOkE',
    'hmac_secret': 'bd7UscLSmvEXazTOQDwOKW',
    'expand_event': true
  })
  ```
</RequestExample>

<ResponseExample>
  ```json theme={null}
  {
    "id": "whk_cSGjA6d9N8y8R",
    "type": "payment.update",
    "url": "https://reference.example.app/webhook",
    "metadata": null,
    "expand_event": false,
    "status": "active",
    "error": null,
    "created_at": "2020-12-09T00:41:05.647Z",
    "updated_at": "2020-12-09T00:41:05.647Z"
  }
  ```
</ResponseExample>
