summaryrefslogtreecommitdiff
path: root/doc/api/system_hooks.md
blob: 5eeb3652d577a13a5e2c1de1732932c7f026bcbd (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
All methods require admin authorization.

## List system hooks

Get list of system hooks

```
GET /hooks
```

Parameters:

+ **none**

```json
[
  {
    "id":3,
    "url":"http://example.com/hook",
    "created_at":"2013-10-02T10:15:31Z"
  }
]
```

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

```json
{
  "event_name":"project_create",
  "name":"Ruby",
  "path":"ruby",
  "project_id":1,
  "owner_name":"Someone",
  "owner_email":"example@gitlabhq.com"
}
```

## 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 it is also returned as JSON.

```
DELETE /hooks/:id
```

Parameters:

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