2014-05-27 08:12:15 -04:00
# System hooks
2014-03-14 14:53:43 -04:00
All methods require admin authorization.
2014-04-24 18:48:22 -04:00
The URL endpoint of the system hooks can be configured in [the admin area under hooks ](/admin/hooks ).
2014-03-14 14:53:43 -04:00
## List system hooks
Get list of system hooks
```
GET /hooks
```
Parameters:
2014-04-24 18:48:22 -04:00
- **none**
2014-03-14 14:53:43 -04:00
```json
[
{
2014-04-05 02:36:47 -04:00
"id": 3,
"url": "http://example.com/hook",
"created_at": "2013-10-02T10:15:31Z"
2014-03-14 14:53:43 -04:00
}
]
```
## Add new system hook hook
```
POST /hooks
```
Parameters:
2014-04-24 18:48:22 -04:00
- `url` (required) - The hook URL
2014-03-14 14:53:43 -04:00
## Test system hook
```
GET /hooks/:id
```
Parameters:
2014-04-24 18:48:22 -04:00
- `id` (required) - The ID of hook
2014-03-14 14:53:43 -04:00
```json
{
2014-04-05 02:36:47 -04:00
"event_name": "project_create",
"name": "Ruby",
"path": "ruby",
"project_id": 1,
"owner_name": "Someone",
"owner_email": "example@gitlabhq.com"
2014-03-14 14:53:43 -04:00
}
```
## Delete system hook
2014-08-15 10:03:01 -04: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.
2014-03-14 14:53:43 -04:00
```
DELETE /hooks/:id
```
Parameters:
2014-04-24 18:48:22 -04:00
- `id` (required) - The ID of hook