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

# Get notified using webhooks

<Frame>
  <img className="block" src="https://mintcdn.com/alohi/KnYKDC0EFTC2S5WS/resources/guides/get-notified-using-webhooks.svg?fit=max&auto=format&n=KnYKDC0EFTC2S5WS&q=85&s=80402bce603626600b152d1c98f958fb" alt="Get notified using webhooks" width="733" height="314" data-path="resources/guides/get-notified-using-webhooks.svg" />
</Frame>

<Steps>
  <Step title="Create a webhook">
    Specify your target URL and the event you want to track between the following options:

    ```
    - ENVELOPE_COMPLETED
    - ENVELOPE_EXPIRED
    - ENVELOPE_DECLINED
    - ENVELOPE_VOIDED
    - ENVELOPE_AUDIT_TRAIL
    ```

    <Card horizontal title="Create a webhook" icon="code" href="/api-reference/endpoints/signplus/add-envelope-annotation">
      Endpoint details
    </Card>
  </Step>

  <Step title="Handle webhook">
    When the envelope event will be triggered, the webhook will send a POST request to the specified URL. You can handle the request and perform the necessary actions on your end.

    Example of a webhook payload:

    ```json ENVELOPE_DECLINED theme={null}
    {
    "hook": {
      "id": "6697ccb204bd194fa74c22b4",
      "event": "envelope_declined",
      "target": "https://webhook.site/47acfde3-bd83-4fbc-9ff1-ea0dc030e118"
    },
    "data": {
      "id": "6697ccb204bd194fa74c22b4",
      "uid": "4a6e29bfc5344ca6ad7cc8beda456481",
      "envelope_id": "6697e681c5e364c7c23710d4",
      "file_name": "dummy"
    }
    ```

    ```json ENVELOPE_COMPLETED theme={null}
    {
    "hook": {
    "id": "6697ccb204bd194fa74c22b4",
    "event": "envelope_completed",
    "target": "https://webhook.site/47acfde3-bd83-4fbc-9ff1-ea0dc030e118"
    },
    "data": {
    "id": "6697ccb204bd194fa74c22b4",
    "uid": "4a6e29bfc5344ca6ad7cc8beda456481",
    "envelope_id": "6697e681c5e364c7c23710d4",
    "file_name": "dummy"
    }
    ```

    ```json ENVELOPE_EXPIRED theme={null}
    {
    "hook": {
    "id": "6697ccb204bd194fa74c22b4",
    "event": "envelope_expired",
    "target": "https://webhook.site/47acfde3-bd83-4fbc-9ff1-ea0dc030e118"
    },
    "data": {
    "id": "6697ccb204bd194fa74c22b4",
    "uid": "4a6e29bfc5344ca6ad7cc8beda456481",
    "envelope_id": "6697e681c5e364c7c23710d4",
    "file_name": "dummy"
    }
    ```

    ```json ENVELOPE_VOIDED theme={null}
    {
    "hook": {
    "id": "6697ccb204bd194fa74c22b4",
    "event": "envelope_voided",
    "target": "https://webhook.site/47acfde3-bd83-4fbc-9ff1-ea0dc030e118"
    },
    "data": {
    "id": "6697ccb204bd194fa74c22b4",
    "uid": "4a6e29bfc5344ca6ad7cc8beda456481",
    "envelope_id": "6697e681c5e364c7c23710d4",
    "file_name": "dummy"
    }
    ```

    ```json ENVELOPE_AUDIT_TRAIL theme={null}
    {
    "hook": {
      "id": "6697ccb204bd194fa74c22b4",
      "event": "envelope_audit_trail",
      "target": "https://webhook.site/47acfde3-bd83-4fbc-9ff1-ea0dc030e118"
    },
    "data": {
      "id": "6697ccb204bd194fa74c22b4",
      "uid": "4a6e29bfc5344ca6ad7cc8beda456481",
      "envelope_id": "6697e681c5e364c7c23710d4",
      "recipient_id": "6697cc22b4bd194facb20474",
      "action": "ENVELOPE_VIEWED"
    }
    ```

    `ENVELOPE_AUDIT_TRAIL` `action` can have the following values:

    * `ENVELOPE_VIEWED` - When the recipient views the envelope.
    * `ENVELOPE_SIGNED` - When the recipient signs the envelope.
    * `ENVELOPE_DECLINED` - When the recipient declines the envelope.
  </Step>
</Steps>
