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

# Notify approvers with Zapier

> Automate notifications to policy approvers using Zapier or other automation tools to send emails, Slack messages, or webhook events on approvals.

export const Loom = props => {
  return <iframe className="w-full aspect-video rounded-xl" src={`https://www.loom.com/embed/${props.videoId}`} title="Loom video player" frameBorder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowFullScreen>
      </iframe>;
};

Dfns offers webhooks to notify your systems when events occur on your wallets. The `policy.approval.pending` event fires when an approval is requested. This guide uses it to trigger a Zapier (or similar) automation that emails the approver.

<Tip>
  A video walkthrough of the first steps is available at the end of this page.
</Tip>

<Steps>
  <Step title="Create the base automation">
    On Zapier, configure the trigger: "Webhooks by Zapier: Catch Hook"

    <Icon icon="hand-point-right" /> Get the **webhook url** from that first block: in "Test" and copy the address. It should be an `https://`  address.

    <Frame>
      <img src="https://mintcdn.com/dfns-6d8c7466/aH8Z4RyoX4Vg4edY/images/spaces_2FtnSPOZGQ2hBmgoVWX5H6_2Fuploads_2FbgZIGYkhH5TnxbNttGw3_2FCapture_20d_E2_80_99e_CC_81cran_202025-08-18_20a_CC_80_2013.26.22.png?fit=max&auto=format&n=aH8Z4RyoX4Vg4edY&q=85&s=68beef3f8caa250ced9f4f829b25970d" alt="" width="1202" height="674" data-path="images/spaces_2FtnSPOZGQ2hBmgoVWX5H6_2Fuploads_2FbgZIGYkhH5TnxbNttGw3_2FCapture_20d_E2_80_99e_CC_81cran_202025-08-18_20a_CC_80_2013.26.22.png" />
    </Frame>
  </Step>

  <Step title="Create a Webhook on your Dfns organization">
    On the Dfns dashboard, navigate to Settings > Webhooks (direct link: [https://app.dfns.io/settings/webhooks](https://app.dfns.io/settings/webhooks)) and click <Icon icon="circle-plus" /> **New Webhook**.

    Copy your Zapier webhook URL into the "url" field, give a description and select "Specific Events" with only "**policy.approval.pending**", then save. You will have to 🔑 sign the creation with your passkey.

    <Frame>
      <img src="https://mintcdn.com/dfns-6d8c7466/aH8Z4RyoX4Vg4edY/images/spaces_2FtnSPOZGQ2hBmgoVWX5H6_2Fuploads_2FV2qPtyIUlO6THRi9K35g_2FCapture_20d_E2_80_99e_CC_81cran_202025-08-18_20a_CC_80_2013.33.36.png?fit=max&auto=format&n=aH8Z4RyoX4Vg4edY&q=85&s=81958ea057c908b7368b731a32f3b8b1" alt="" width="3412" height="1792" data-path="images/spaces_2FtnSPOZGQ2hBmgoVWX5H6_2Fuploads_2FV2qPtyIUlO6THRi9K35g_2FCapture_20d_E2_80_99e_CC_81cran_202025-08-18_20a_CC_80_2013.33.36.png" />
    </Frame>

    <Check>
      The basic architecture is in place. Now configure the actions.
    </Check>
  </Step>

  <Step title="Create a policy to request approval">
    Make sure you have a policy to trigger. For example a policy that always trigger on transfer requests.

    You can follow the following tutorial to create it: [Create policies](/guides/create-policies)

    Trigger the policy (for example by requesting a transfer) so that Zapier receives the information and can help you use the data to write an email.
  </Step>

  <Step title="Send an email from your automation">
    Add an action "Email by Zapier: Send Outbound Email" connected to your Webhook trigger.

    <Frame>
      <img src="https://mintcdn.com/dfns-6d8c7466/aH8Z4RyoX4Vg4edY/images/spaces_2FtnSPOZGQ2hBmgoVWX5H6_2Fuploads_2FBZIUC55rBb8RokmIPBSm_2FCapture_20d_E2_80_99e_CC_81cran_202025-08-18_20a_CC_80_2013.47.45.png?fit=max&auto=format&n=aH8Z4RyoX4Vg4edY&q=85&s=d5a1c387c34b7c69570dcab320ce4cf8" alt="" width="724" height="654" data-path="images/spaces_2FtnSPOZGQ2hBmgoVWX5H6_2Fuploads_2FBZIUC55rBb8RokmIPBSm_2FCapture_20d_E2_80_99e_CC_81cran_202025-08-18_20a_CC_80_2013.47.45.png" />
    </Frame>

    Configure the email by entering the list of recipients, a topic, and a message.

    Example of message:

    ```
    Hello! 

    Please review and approve the following transfer request:
    [1. Kind] transfer of [1. Asset Symbol] to the wallet [1. To] on [1. Network]. 

    Transfer id is: [1. TransferRequest Id]

    Please login to https://app.dfns.io/policies/approvals to accept or refuse. 
    ```

    Save, Publish and trigger a transfer to test the automation!

    <Check>
      You're now sending an email each time an approval is requested.
    </Check>
  </Step>

  <Step title="Going further: display the amount properly">
    Dfns displays asset amounts with the network maximum precision, and provides a description of the number of decimals. So in order to display the amount properly, you need to divide $amount$  by $10^{decimals}$. In the example below: `1000000000` for `7` decimals so $1000 000 00 / 10^7 = 100$ units!

    In Zapier, insert a block "Formatter by Zapier: Numbers" before the email block.

    Configure the fields:

    * Transform: Perform Math Operation
    * Operation: Divide
    * Input:
      * \[1. Amount]
      * 10^\[1. Asset Decimals]

    <Frame>
      <img src="https://mintcdn.com/dfns-6d8c7466/2kpqVE6bPN0ElHJ8/images/spaces_2FtnSPOZGQ2hBmgoVWX5H6_2Fuploads_2FrgkBWMHzNyeDfwjCevbP_2FCapture_20d_E2_80_99e_CC_81cran_202025-08-18_20a_CC_80_2014.03.14.png?fit=max&auto=format&n=2kpqVE6bPN0ElHJ8&q=85&s=e564da736c253d97a6bb7ed93aa19dec" alt="" width="1186" height="1372" data-path="images/spaces_2FtnSPOZGQ2hBmgoVWX5H6_2Fuploads_2FrgkBWMHzNyeDfwjCevbP_2FCapture_20d_E2_80_99e_CC_81cran_202025-08-18_20a_CC_80_2014.03.14.png" />
    </Frame>

    You can now update the email body to display the output:

    ```
    [1. Kind] transfer of [2. output] [1. Asset Symbol] to the wallet [1. To] on [1. Network]. 
    ```

    Publish and trigger a policy to test again!

    <Check>
      The amount now displays in human-readable units.
    </Check>
  </Step>

  <Step title="Going even further: query additional information about the request">
    Dfns provides a wide-range catalog of APIs to refine your email.

    For instance, the webhook sends the "Initiator Id" (`us-*****-*****-********`), which represents the user who triggered the policy. Let's get his information and include those in the email!

    You need a token to access the API. The best way is to create a service account, follow the tutorial on the page: [Dfns API using a service account](/introduction/quickstart/6-non-custody-1-2-dfns-api-using-a-service-account) until you get a token. For rapid testing you can also copy your current session token from the dashboard (Settings > Personal Access Tokens > Copy the JWT token) but this token expires quickly so it's only good for temporary testing.

    <Icon icon="hand-point-right" />Copy your token

    <Warning>
      Keep your token secret (and disable it when you don't need it anymore)!
    </Warning>

    In Zapier, add a "Webhooks by Zapier: GET" after the formatter block, and configure the following fields:

    * **URL:** `https://api.dfns.io/auth/users/[1. Requester User Id]`
    * **Headers:** add one called Authorization, with value: "`Bearer <paste your token>`"

    And finally, update the email body to use the new data you gathered. For example:

    ```
    Please review and approve the following transfer request from [3. Name]:
    ```

    Publish and trigger a policy to test again!

    <Check>
      The email now includes details fetched from the Dfns API.
    </Check>
  </Step>
</Steps>

You can now go as far as required to get more data about the event, refine the mail. Use our [API reference](/api-reference/) to learn what you have access to!

### Video tutorial

<Loom videoId="b2475c3aafb24ccb9000df59dc958d47" />
