# Setup Guide

Follow these steps to configure a webhook for your workspace:

1. Log in to [UseStencil](https://app.usestencil.com/)
2. Navigate to your Template that you wish to have integration with. This is located under the "Project" tab.
3. Click on the triple-dot menu to bring up the menu options for the template. Choose "Webhooks".\
   ![](/files/dgbju3t1EmEdCq1dFqHL)
4. Click "Add Webhook".
5. Fill in the following fields:

<table><thead><tr><th width="187.3828125">Fields</th><th>Description</th></tr></thead><tbody><tr><td>Webhook name</td><td>A friendly name for your reference.</td></tr><tr><td>Webhook URL</td><td>The HTTPS endpoint where UseStencil should send the payload.</td></tr><tr><td>Custom headers (Optional)</td><td><p>Key-value pairs to be included as HTTP headers in the request. Useful for:</p><ul><li>Authentication tokens (e.g., <code>Authorization: Bearer YOUR_TOKEN</code>)</li><li>Source-identification headers (e.g., <code>X-Origin: stencil</code>)</li></ul></td></tr><tr><td>Custom Body (Optional)</td><td><p>Define a custom JSON payload structure under the <code>user_defined</code> field.</p><p></p><p>You can:</p><ul><li>Include static values (e.g., "source": "usestencil")</li><li>Inject dynamic values using handlebars-style templating like:<br><br><code>{</code><br><code>"image_id": "{{data.id}}",</code><br><code>"url": "{{data.url}}",</code><br><code>"created_at": "{{timestamp}}"</code><br><code>}</code></li></ul></td></tr></tbody></table>

Click **Save** and that's it! Isn't that easy?

## Using Custom Headers for Security

Custom headers are a simple yet powerful way to pass authentication tokens or shared secrets to your server. You can configure:

* `Authorization: Bearer abc123`
* `X-Signature: custom-value`
* `X-App-Key: my-service-key`

These headers will be included in every webhook request and can be validated on your backend.

## Managing Webhooks

From the Webhooks dashboard, you can:

* **Pause** or **edit** existing webhooks
* **Delete** unused ones
* View recent **delivery logs** to inspect response codes, headers, and payloads.

> #### ✅ Next Steps
>
> Now that you’ve set up and tested your webhook with custom headers and payloads, you’re ready to explore the [Payload Structure ](/integrations/webhook-integration/payload-structure.md)in detail


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.usestencil.com/integrations/webhook-integration/setup-guide.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
