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

# Box Sign webhooks

> Listen for Box Sign request events on a folder, create a webhook, and handle the notification payload.

export const MultiRelatedLinks = ({sections = []}) => {
  if (!sections || sections.length === 0) {
    return null;
  }
  return <div className="space-y-8">
      {sections.map((section, index) => <RelatedLinks key={index} title={section.title} items={section.items} />)}
    </div>;
};

export const RelatedLinks = ({title, items = []}) => {
  const getBadgeClass = badge => {
    if (!badge) return "badge-default";
    const badgeType = badge.toLowerCase().replace(/\s+/g, "-");
    return `badge-${badge === "ガイド" ? "guide" : badgeType}`;
  };
  if (!items || items.length === 0) {
    return null;
  }
  return <div className="my-8">
      {}
      <h3 className="text-sm font-bold uppercase tracking-wider mb-4">{title}</h3>

      {}
      <div className="flex flex-col gap-3">
        {items.map((item, index) => <a key={index} href={item.href} className="py-2 px-3 rounded related_link hover:bg-[#f2f2f2] dark:hover:bg-[#111827] flex items-center gap-3 group no-underline hover:no-underline border-b-0">
            {}
            <span className={`px-2 py-1 rounded-full text-xs font-semibold uppercase tracking-wide flex-shrink-0 ${getBadgeClass(item.badge)}`}>
              {item.badge}
            </span>

            {}
            <span className="text-base">{item.label}</span>
          </a>)}
      </div>
    </div>;
};

Signature requests are asynchronous. Signers can complete, decline, or ignore a
request at any time, including outside your app. A webhook on the destination
folder notifies your app when those events happen.

## Sign-related events

Set the listener on a folder or a document. The usual approach is the folder
where you create signature requests, so one webhook covers every request in
that folder.

Examples of events you can listen for:

* `SIGN_REQUEST.COMPLETED`, when a signature request is completed
* `SIGN_REQUEST.DECLINED`, when a signature request is declined
* `SIGN_REQUEST.EXPIRED`, when a signature request expires
* `SIGN_REQUEST.SIGNER_EMAIL_BOUNCED`, when a signer's email is bounced
* `SIGN_REQUEST.SIGNER_SIGNED`, when a particular signer signs the request
* `SIGN_REQUEST.SIGNATURE_REQUESTED`, when a signature is requested from a signer
* `SIGN_REQUEST.ERROR_FINALIZING`, when the signature request could not be processed

For the full list of triggers, see [webhook triggers](/guides/webhooks/triggers).

## Create a Sign webhook

Sign webhooks use the standard Box webhooks infrastructure.
To receive Box Sign events, call the [create webhook](/reference/post-webhooks) endpoint.
Set the `target` to the folder where you create signature requests, and list the
`SIGN_REQUEST.*` triggers you want to receive.

<Warning>
  This API requires the application to have the **Manage Webhooks** scope enabled.
</Warning>

```sh theme={null}
curl -i -X POST "https://api.box.com/2.0/webhooks" \
     -H "authorization: Bearer <ACCESS_TOKEN>" \
     -H "content-type: application/json" \
     -d '{
       "target": {
         "id": "12345",
         "type": "folder"
       },
       "address": "https://example.com/sign-webhooks",
       "triggers": [
         "SIGN_REQUEST.COMPLETED",
         "SIGN_REQUEST.DECLINED",
         "SIGN_REQUEST.EXPIRED"
       ]
     }'
```

For more ways to create webhooks, including the Developer Console and SDK examples, see [Create webhooks (v2)](/guides/webhooks/v2/create-v2).

## Receive Sign event notifications

When a Box Sign event occurs, Box sends an HTTP `POST` request to the `address` you configured.
The payload includes the trigger and Sign-specific `additional_info`, such as the sign request ID and signer emails.
It can also include a `source` file for the signature request.

For example, when a signature request is completed, Box sends a payload similar to the following:

```json theme={null}
{
  "type": "webhook_event",
  "id": "eb0c4e06-751f-442c-86f8-fd5bb404dbec",
  "created_at": "2024-05-22T08:28:56-07:00",
  "trigger": "SIGN_REQUEST.COMPLETED",
  "webhook": {
    "id": "53",
    "type": "webhook"
  },
  "created_by": {
    "type": "user",
    "id": "226067247",
    "name": "John Q. Developer",
    "login": "johnq@dev.name"
  },
  "source": {
    "id": "73835521473",
    "type": "file",
    "name": "Contract.pdf",
    "item_status": "active"
  },
  "additional_info": {
    "sign_request_id": "123e4567-e89b-12d3-a456-426614174000",
    "signer_emails": [
      "johnq@dev.name",
      "signer@example.com"
    ],
    "external_id": ""
  }
}
```

Your endpoint must respond with an HTTP status code in the `200` to `299` range within 30 seconds to acknowledge the notification.
For the full payload format and delivery details, see [webhooks (v2)](/guides/webhooks/v2).
To verify that a notification was sent by Box, see [Verify Box webhook signatures](/guides/webhooks/v2/signatures-v2).

<RelatedLinks
  title="RELATED APIS"
  items={[
{ label: translate("Create webhook"), href: "/reference/post-webhooks", badge: "POST" }
]}
/>

<RelatedLinks
  title="RELATED GUIDES"
  items={[
{ label: translate("Create Box Sign request"), href: "/guides/box-sign/create-sign-request", badge: "GUIDE" },
{ label: translate("Webhook triggers"), href: "/guides/webhooks/triggers", badge: "GUIDE" },
{ label: translate("Create webhooks (v2)"), href: "/guides/webhooks/v2/create-v2", badge: "GUIDE" }
]}
/>
