Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kazuhiko Shiozaki
gitlab-ce
Commits
23a878c4
Commit
23a878c4
authored
Jan 24, 2016
by
Achilleas Pipinellis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Clean up system hooks API documentation
[ci skip]
parent
9eeda3da
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
4 deletions
+24
-4
doc/api/system_hooks.md
doc/api/system_hooks.md
+24
-4
No files found.
doc/api/system_hooks.md
View file @
23a878c4
# System hooks
All methods require admin authorization.
All methods require admin
istrator
authorization.
The URL endpoint of the system hooks can also be configured using the UI in
the admin area under hooks(
`/admin/hooks`
).
the admin area under
**Hooks**
(
`/admin/hooks`
).
Read more about
[
system hooks
](
../system_hooks/system_hooks.md
)
.
## List system hooks
Get a list of all system hooks.
---
```
GET /hooks
```
Example request:
```
bash
curl
-H
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
https://gitlab.example.com/api/v3/hooks
```
...
...
@@ -31,6 +37,10 @@ Example response:
## Add new system hook
Add a new system hook.
---
```
POST /hooks
```
...
...
@@ -39,6 +49,8 @@ POST /hooks
| --------- | ---- | -------- | ----------- |
|
`url`
| string | yes | The hook URL |
Example request:
```
bash
curl
-X
POST
-H
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
"https://gitlab.example.com/api/v3/hooks?url=https://gitlab.example.com/hook"
```
...
...
@@ -65,6 +77,8 @@ GET /hooks/:id
| --------- | ---- | -------- | ----------- |
|
`id`
| integer | yes | The ID of the hook |
Example request:
```
bash
curl
-H
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
https://gitlab.example.com/api/v3/hooks/2
```
...
...
@@ -85,8 +99,12 @@ Example response:
## Delete system hook
Deletes a system hook. This is an idempotent API function and returns
`200 OK`
even if the hook is not available. If the hook is deleted a JSON object is
returned.
even if the hook is not available.
If the hook is deleted, a JSON object is returned. An error is raised if the
hook is not found.
---
```
DELETE /hooks/:id
...
...
@@ -96,6 +114,8 @@ DELETE /hooks/:id
| --------- | ---- | -------- | ----------- |
|
`id`
| integer | yes | The ID of the hook |
Example request:
```
bash
curl
-X
DELETE
-H
"PRIVATE-TOKEN: 9koXpg98eAheJpvBs5tK"
https://gitlab.example.com/api/v3/hooks/2
```
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment