2013-03-06 05:33:32 -05:00
|
|
|
All methods require admin authorization.
|
|
|
|
|
2013-10-14 03:24:38 -04:00
|
|
|
The url endpoint of the system hooks can be configured in [the admin area under hooks](/admin/hooks).
|
|
|
|
|
2013-03-06 05:33:32 -05:00
|
|
|
## List system hooks
|
|
|
|
|
|
|
|
Get list of system hooks
|
|
|
|
|
|
|
|
```
|
|
|
|
GET /hooks
|
|
|
|
```
|
|
|
|
|
2013-03-07 11:56:11 -05:00
|
|
|
Parameters:
|
|
|
|
|
|
|
|
+ **none**
|
|
|
|
|
2013-10-02 06:50:01 -04:00
|
|
|
```json
|
|
|
|
[
|
|
|
|
{
|
|
|
|
"id":3,
|
|
|
|
"url":"http://example.com/hook",
|
|
|
|
"created_at":"2013-10-02T10:15:31Z"
|
|
|
|
}
|
|
|
|
]
|
|
|
|
```
|
2013-03-06 05:33:32 -05:00
|
|
|
|
|
|
|
## Add new system hook hook
|
|
|
|
|
|
|
|
```
|
|
|
|
POST /hooks
|
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
+ `url` (required) - The hook URL
|
|
|
|
|
|
|
|
|
|
|
|
## Test system hook
|
|
|
|
|
|
|
|
```
|
|
|
|
GET /hooks/:id
|
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
+ `id` (required) - The ID of hook
|
|
|
|
|
2013-10-02 06:50:01 -04:00
|
|
|
```json
|
|
|
|
{
|
|
|
|
"event_name":"project_create",
|
|
|
|
"name":"Ruby",
|
|
|
|
"path":"ruby",
|
|
|
|
"project_id":1,
|
|
|
|
"owner_name":"Someone",
|
|
|
|
"owner_email":"example@gitlabhq.com"
|
|
|
|
}
|
|
|
|
```
|
2013-03-06 05:33:32 -05:00
|
|
|
|
|
|
|
## Delete system hook
|
|
|
|
|
2013-03-07 11:56:11 -05:00
|
|
|
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 it is also returned as JSON.
|
|
|
|
|
2013-03-06 05:33:32 -05:00
|
|
|
```
|
|
|
|
DELETE /hooks/:id
|
|
|
|
```
|
|
|
|
|
|
|
|
Parameters:
|
|
|
|
|
|
|
|
+ `id` (required) - The ID of hook
|