Skip to content

Commit 0bca7dc

Browse files
committed
Split webhook into its own page
1 parent c0dd0f9 commit 0bca7dc

File tree

3 files changed

+25
-19
lines changed

3 files changed

+25
-19
lines changed

docs/hub/_sections.yml

+4-1
Original file line numberDiff line numberDiff line change
@@ -20,4 +20,7 @@
2020
title: Security
2121

2222
- local: api-main
23-
title: Hub API Endpoints
23+
title: Hub API Endpoints
24+
25+
- local: api-webhook
26+
title: Webhook

docs/hub/api-main.md

-18
Original file line numberDiff line numberDiff line change
@@ -28,21 +28,3 @@ We have open endpoints that you can use to retrieve information from the Hub as
2828
| /api/repos/move POST | Move a repository (rename within same namespace or transfer from user to organization). | `move_repo()` | ```headers = { "authorization" : "Bearer $token" }``` ```json= {"fromRepo" : "namespace/repo_name", "toRepo" : "namespace2/repo_name2"}``` | |
2929
| /api/{type}/{repo_id}/upload/{revision}/{path_in_repo} POST | Upload a file to a specific repository. | `upload_file()` | ```headers = { "authorization" : "Bearer $token" }``` ```"data"="bytestream"``` | |
3030
| /api/whoami-v2 GET | Get username and organizations the user belongs to. | `whoami(token)` | ```headers = { "authorization" : "Bearer $token" }``` | |
31-
32-
## Webhook
33-
34-
If you ever need to programmatically get notified about all the changes/additions to model/dataset/Space repositories on the Hugging Face Hub, you can subscribe to the Hugging Face Hub webhook.
35-
36-
When you're subscribed – meaning you sent us a URL on your side that you want us to ping – we will call it over HTTP with the following payload:
37-
38-
```python
39-
{ "add": "user/model_id" }
40-
# or
41-
{ "add": "datasets/user/dataset_id" }
42-
# or
43-
{ "update": "spaces/organization/space_id" }
44-
# or
45-
{ "remove": "user/model_id" }
46-
```
47-
48-
✉️ Contact us at `website at huggingface.co` if you would like to subscribe to the webhook.

docs/hub/api-webhook.md

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
---
2+
title: Webhook
3+
---
4+
5+
<h1>Webhook</h1>
6+
7+
If you ever need to programmatically get notified about all the changes/additions to model/dataset/Space repositories on the Hugging Face Hub, you can subscribe to the Hugging Face Hub webhook.
8+
9+
When you're subscribed – meaning you sent us a URL on your side that you want us to ping – we will call it over HTTP with the following payload:
10+
11+
```python
12+
{ "add": "user/model_id" }
13+
# or
14+
{ "add": "datasets/user/dataset_id" }
15+
# or
16+
{ "update": "spaces/organization/space_id" }
17+
# or
18+
{ "remove": "user/model_id" }
19+
```
20+
21+
✉️ Contact us at `website at huggingface.co` if you would like to subscribe to the webhook.

0 commit comments

Comments
 (0)