system_hooks.md 942 Bytes
Newer Older
Matt Humphrey's avatar
Matt Humphrey committed
1 2 3 4 5 6 7 8 9 10
All methods require admin authorization.

## List system hooks

Get list of system hooks

```
GET /hooks
```

11 12 13 14
Parameters:

+ **none**

15 16 17 18 19 20 21 22 23
```json
[
  {
    "id":3,
    "url":"http://example.com/hook",
    "created_at":"2013-10-02T10:15:31Z"
  }
]
```
Matt Humphrey's avatar
Matt Humphrey committed
24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45

## 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

46 47 48 49 50 51 52 53 54 55
```json
{
  "event_name":"project_create",
  "name":"Ruby",
  "path":"ruby",
  "project_id":1,
  "owner_name":"Someone",
  "owner_email":"example@gitlabhq.com"
}
```
Matt Humphrey's avatar
Matt Humphrey committed
56 57 58

## Delete system hook

59 60 61
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.

Matt Humphrey's avatar
Matt Humphrey committed
62 63 64 65 66 67 68
```
DELETE /hooks/:id
```

Parameters:

+ `id` (required) - The ID of hook