Skip to content

Commit 23a878c

Browse files
committed
Clean up system hooks API documentation
[ci skip]
1 parent 9eeda3d commit 23a878c

File tree

1 file changed

+24
-4
lines changed

1 file changed

+24
-4
lines changed

doc/api/system_hooks.md

+24-4
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,24 @@
11
# System hooks
22

3-
All methods require admin authorization.
3+
All methods require administrator authorization.
44

55
The URL endpoint of the system hooks can also be configured using the UI in
6-
the admin area under hooks(`/admin/hooks`).
6+
the admin area under **Hooks** (`/admin/hooks`).
7+
8+
Read more about [system hooks](../system_hooks/system_hooks.md).
79

810
## List system hooks
911

1012
Get a list of all system hooks.
1113

14+
---
15+
1216
```
1317
GET /hooks
1418
```
1519

20+
Example request:
21+
1622
```bash
1723
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/hooks
1824
```
@@ -31,6 +37,10 @@ Example response:
3137

3238
## Add new system hook
3339

40+
Add a new system hook.
41+
42+
---
43+
3444
```
3545
POST /hooks
3646
```
@@ -39,6 +49,8 @@ POST /hooks
3949
| --------- | ---- | -------- | ----------- |
4050
| `url` | string | yes | The hook URL |
4151

52+
Example request:
53+
4254
```bash
4355
curl -X POST -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" "https://gitlab.example.com/api/v3/hooks?url=https://gitlab.example.com/hook"
4456
```
@@ -65,6 +77,8 @@ GET /hooks/:id
6577
| --------- | ---- | -------- | ----------- |
6678
| `id` | integer | yes | The ID of the hook |
6779

80+
Example request:
81+
6882
```bash
6983
curl -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/hooks/2
7084
```
@@ -85,8 +99,12 @@ Example response:
8599
## Delete system hook
86100

87101
Deletes a system hook. This is an idempotent API function and returns `200 OK`
88-
even if the hook is not available. If the hook is deleted a JSON object is
89-
returned.
102+
even if the hook is not available.
103+
104+
If the hook is deleted, a JSON object is returned. An error is raised if the
105+
hook is not found.
106+
107+
---
90108

91109
```
92110
DELETE /hooks/:id
@@ -96,6 +114,8 @@ DELETE /hooks/:id
96114
| --------- | ---- | -------- | ----------- |
97115
| `id` | integer | yes | The ID of the hook |
98116

117+
Example request:
118+
99119
```bash
100120
curl -X DELETE -H "PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK" https://gitlab.example.com/api/v3/hooks/2
101121
```

0 commit comments

Comments
 (0)