BigW Consortium Gitlab

system_hooks.md 986 Bytes
Newer Older
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
All methods require admin authorization.

The url endpoint of the system hooks can be configured in [the admin area under hooks](/admin/hooks).

## List system hooks

Get list of system hooks

```
GET /hooks
```

Parameters:

+ **none**

```json
[
  {
20 21 22
    "id": 3,
    "url": "http://example.com/hook",
    "created_at": "2013-10-02T10:15:31Z"
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
  }
]
```

## 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
{
50 51 52 53 54 55
  "event_name": "project_create",
  "name": "Ruby",
  "path": "ruby",
  "project_id": 1,
  "owner_name": "Someone",
  "owner_email": "example@gitlabhq.com"
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
}
```

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