diff options
Diffstat (limited to 'doc/api/groups.md')
-rw-r--r-- | doc/api/groups.md | 112 |
1 files changed, 112 insertions, 0 deletions
diff --git a/doc/api/groups.md b/doc/api/groups.md index f4dfefe3cb7..de8490fa1f4 100644 --- a/doc/api/groups.md +++ b/doc/api/groups.md @@ -660,6 +660,118 @@ GET /groups?search=foobar ] ``` +## Hooks + +Also called Group Hooks and Webhooks. +These are different from [System Hooks](system_hooks.md) that are system wide and [Project Hooks](projects.md#hooks) that are limited to one project. + +### List group hooks + +Get a list of group hooks + +``` +GET /groups/:id/hooks +``` + +| Attribute | Type | Required | Description | +| --------- | --------------- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) | + +### Get group hook + +Get a specific hook for a group. + +| Attribute | Type | Required | Description | +| --------- | -------------- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) | +| `hook_id` | integer | yes | The ID of a group hook | + +``` +GET /groups/:id/hooks/:hook_id +``` + +```json +{ + "id": 1, + "url": "http://example.com/hook", + "group_id": 3, + "push_events": true, + "issues_events": true, + "confidential_issues_events": true, + "merge_requests_events": true, + "tag_push_events": true, + "note_events": true, + "job_events": true, + "pipeline_events": true, + "wiki_page_events": true, + "enable_ssl_verification": true, + "created_at": "2012-10-12T17:04:47Z" +} +``` + +### Add group hook + +Adds a hook to a specified group. + +``` +POST /groups/:id/hooks +``` + +| Attribute | Type | Required | Description | +| -----------------------------| -------------- | ---------| ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) | +| `url` | string | yes | The hook URL | +| `push_events` | boolean | no | Trigger hook on push events | +| `issues_events` | boolean | no | Trigger hook on issues events | +| `confidential_issues_events` | boolean | no | Trigger hook on confidential issues events | +| `merge_requests_events` | boolean | no | Trigger hook on merge requests events | +| `tag_push_events` | boolean | no | Trigger hook on tag push events | +| `note_events` | boolean | no | Trigger hook on note events | +| `job_events` | boolean | no | Trigger hook on job events | +| `pipeline_events` | boolean | no | Trigger hook on pipeline events | +| `wiki_page_events` | boolean | no | Trigger hook on wiki events | +| `enable_ssl_verification` | boolean | no | Do SSL verification when triggering the hook | +| `token` | string | no | Secret token to validate received payloads; this will not be returned in the response | + +### Edit group hook + +Edits a hook for a specified group. + +``` +PUT /groups/:id/hooks/:hook_id +``` + +| Attribute | Type | Required | Description | +| ---------------------------- | -------------- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) | +| `hook_id` | integer | yes | The ID of the group hook | +| `url` | string | yes | The hook URL | +| `push_events` | boolean | no | Trigger hook on push events | +| `issues_events` | boolean | no | Trigger hook on issues events | +| `confidential_issues_events` | boolean | no | Trigger hook on confidential issues events | +| `merge_requests_events` | boolean | no | Trigger hook on merge requests events | +| `tag_push_events` | boolean | no | Trigger hook on tag push events | +| `note_events` | boolean | no | Trigger hook on note events | +| `job_events` | boolean | no | Trigger hook on job events | +| `pipeline_events` | boolean | no | Trigger hook on pipeline events | +| `wiki_events` | boolean | no | Trigger hook on wiki events | +| `enable_ssl_verification` | boolean | no | Do SSL verification when triggering the hook | +| `token` | string | no | Secret token to validate received payloads; this will not be returned in the response | + +### Delete group hook + +Removes a hook from a group. This is an idempotent method and can be called multiple times. +Either the hook is available or not. + +``` +DELETE /groups/:id/hooks/:hook_id +``` + +| Attribute | Type | Required | Description | +| --------- | -------------- | -------- | ----------- | +| `id` | integer/string | yes | The ID or [URL-encoded path of the group](README.md#namespaced-path-encoding) | +| `hook_id` | integer | yes | The ID of the group hook. | + ## Group Audit Events **(STARTER)** Group audit events can be accessed via the [Group Audit Events API](audit_events.md#group-audit-events-starter) |