# Restart a stopped Space from a Webhook?

**URL:** </static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frestart-a-stopped-space-from-a-webhook%2F32098%3E%5C
**Category:** Spaces\
**Created:** [February 20, 2023, 4:03pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frestart-a-stopped-space-from-a-webhook%2F32098 "2023-02-20T16:03:30Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![milyiyo](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/milyiyo/32/59140_2.png) [@milyiyo](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmilyiyo)%5C
**Post date:** [February 20, 2023, 4:03pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frestart-a-stopped-space-from-a-webhook%2F32098%2F1 "2023-02-20T16:03:30Z")

</div>

Hi everyone,

Are webhooks capable of restarting a related Space if it is stopped?

Thanks in advance 🙂

---

<div class="post-metadata">

**Author:** ![radames](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/radames/32/28246_2.png) [@radames](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fradames)%5C
**Post date:** [February 22, 2023, 2:11am UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frestart-a-stopped-space-from-a-webhook%2F32098%2F2 "2023-02-22T02:11:08Z")

</div>

Hi @milyiyo, currently we don’t have a Webhook trigger event for when the Space is stopped or restarted. But it’s a good idea indeed.

You can restart a stopped Space programmatically via our API or using our `huggingface_hub` lib

> **[HfApi Client](https://huggingface.co/docs/huggingface_hub/main/en/package_reference/hf_api#huggingface_hub.HfApi.restart_space)**
>
> We’re on a journey to advance and democratize artificial intelligence through open source and open science.

Read more about our [Webhooks](https://huggingface.co/docs/hub/webhooks#:~:text=Possible%20values%20for%20the%20associated%20action%3A%20%22create%22%2C%20%22delete%22%2C%20%22update%22%2C%20%22move%22) events

> - `"repo"` - Global events on repos. Possible values for the associated `action`: `"create"`, `"delete"`, `"update"`, `"move"`.
> - `"repo.content"` - Events on the repo’s content, such as new commits or tags. It triggers on new Pull Requests as well due to the newly created reference/commit. The associated `action` is always `"update"`.
> - `"repo.config"` - Events on the config: update Space secrets, update settings, update DOIs, disabled or not, etc. The associated `action` is always `"update"`.
> - `"discussion"` - Creating a discussion or Pull Request, updating the title or status, and merging. Possible values for the associated `action`: `"create"`, `"delete"`, `"update"`.
> - `"discussion.comment"` - Creating, updating, and hiding a comment. Possible values for the associated `action`: `"create"`, `"update"`.

---

<div class="post-metadata">

**Author:** ![milyiyo](https://sea2.discourse-cdn.com/hellohellohello/user_avatar/discuss.huggingface.co/milyiyo/32/59140_2.png) [@milyiyo](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Fu%2Fmilyiyo)%5C
**Post date:** [February 22, 2023, 3:56pm UTC](/static-proxy?url=https%3A%2F%2Fdiscuss.huggingface.co%2Ft%2Frestart-a-stopped-space-from-a-webhook%2F32098%2F3 "2023-02-22T15:56:09Z")

</div>

Thanks @radames 🙂 👍
