# Webhook usecase

**URL:** <https://discuss.huggingface.co/t/webhook-usecase/164297>\
**Category:** 🤗Transformers\
**Created:** [July 23, 2025, 8:15pm UTC](https://discuss.huggingface.co/t/webhook-usecase/164297 "2025-07-23T20:15:08Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rahul7star](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/rahul7star/32/46682_2.png) [@rahul7star](https://discuss.huggingface.co/u/rahul7star)\
**Post date:** [July 23, 2025, 8:15pm UTC](https://discuss.huggingface.co/t/webhook-usecase/164297/1 "2025-07-23T20:15:08Z")

</div>

can i use webhook feature to pass a payload from space A to other space B . space B will read the data from payload and act on it ?

---

<div class="post-metadata">

**Author:** ![saurabhb-dev](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/saurabhb-dev/32/59139_2.png) [@saurabhb-dev](https://discuss.huggingface.co/u/saurabhb-dev)\
**Post date:** [April 2, 2026, 6:25am UTC](https://discuss.huggingface.co/t/webhook-usecase/164297/2 "2026-04-02T06:25:01Z")

</div>

**How to set this up:**

- **On Space B:** You need to build your Space so that it exposes a web endpoint. A common way to do this is using a **Docker Space** running a lightweight `FastAPI` server, or using the `@webhook_endpoint` decorator provided by the `huggingface_hub` Python library in a Gradio Space.

- **In your HF Settings:** You go to your user/organization Webhooks settings, select Space A as the “Target Repository,” and paste the Direct URL of Space B as the destination.

- **Security:** You configure a Webhook Secret in your settings and set that same secret as an Environment Variable in Space B. Space B’s code should verify the `X-Webhook-Secret` header so it only accepts requests from Hugging Face.
