diff --git a/doc/api/system_hooks.md b/doc/api/system_hooks.md index a2426f6c6d2f60f023d9b9e3d138a89c82aff373..777ace75e913b050557feea444d48e37bf07e0ff 100644 --- a/doc/api/system_hooks.md +++ b/doc/api/system_hooks.md @@ -2,13 +2,15 @@ stage: Foundations group: Import and Integrate info: To determine the technical writer assigned to the Stage/Group associated with this page, see https://handbook.gitlab.com/handbook/product/ux/technical-writing/#assignments +title: System hooks API --- -# System hooks API +{{< details >}} -DETAILS: -**Tier:** Free, Premium, Ultimate -**Offering:** Self-managed +- Tier: Free, Premium, Ultimate +- Offering: GitLab Self-Managed + +{{< /details >}} All methods require administrator authorization. @@ -74,21 +76,19 @@ curl --header "PRIVATE-TOKEN: <your_access_token>" "https://gitlab.example.com/a Example response: ```json -[ - { - "id": 1, - "url": "https://gitlab.example.com/hook", - "name": "Hook name", - "description": "Hook description", - "created_at": "2016-10-31T12:32:15.192Z", - "push_events": true, - "tag_push_events": false, - "merge_requests_events": true, - "repository_update_events": true, - "enable_ssl_verification": true, - "url_variables": [] - } -] +{ + "id": 1, + "url": "https://gitlab.example.com/hook", + "name": "Hook name", + "description": "Hook description", + "created_at": "2016-10-31T12:32:15.192Z", + "push_events": true, + "tag_push_events": false, + "merge_requests_events": true, + "repository_update_events": true, + "enable_ssl_verification": true, + "url_variables": [] +} ``` ## Add new system hook @@ -107,7 +107,7 @@ POST /hooks | `token` | string | no | Secret token to validate received payloads; this isn't returned in the response | | `push_events` | boolean | no | When true, the hook fires on push events | | `tag_push_events` | boolean | no | When true, the hook fires on new tags being pushed | -| `merge_requests_events` | boolean | no | Trigger hook on merge requests events | +| `merge_requests_events` | boolean | no | Trigger hook on merge request events | | `repository_update_events` | boolean | no | Trigger hook on repository update events | | `enable_ssl_verification` | boolean | no | Do SSL verification when triggering the hook | | `push_events_branch_filter` | string | no | Trigger hook on push events for matching branches only | @@ -150,11 +150,11 @@ PUT /hooks/:hook_id | Attribute | Type | Required | Description | |-----------------------------|---------|----------|-------------| | `hook_id` | integer | Yes | The ID of the system hook | -| `url` | string | yes | The hook URL | +| `url` | string | no | The hook URL | | `token` | string | no | Secret token to validate received payloads; this isn't returned in the response | | `push_events` | boolean | no | When true, the hook fires on push events | | `tag_push_events` | boolean | no | When true, the hook fires on new tags being pushed | -| `merge_requests_events` | boolean | no | Trigger hook on merge requests events | +| `merge_requests_events` | boolean | no | Trigger hook on merge request events | | `repository_update_events` | boolean | no | Trigger hook on repository update events | | `enable_ssl_verification` | boolean | no | Do SSL verification when triggering the hook | | `push_events_branch_filter` | string | no | Trigger hook on push events for matching branches only | @@ -211,7 +211,11 @@ curl --request DELETE --header "PRIVATE-TOKEN: <your_access_token>" "https://git ## Set a URL variable -> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90310) in GitLab 15.2. +{{< history >}} + +- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90310) in GitLab 15.2. + +{{< /history >}} ```plaintext PUT /hooks/:hook_id/url_variables/:key @@ -229,7 +233,11 @@ On success, this endpoint returns the response code `204 No Content`. ## Delete a URL variable -> - [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90310) in GitLab 15.2. +{{< history >}} + +- [Introduced](https://gitlab.com/gitlab-org/gitlab/-/merge_requests/90310) in GitLab 15.2. + +{{< /history >}} ```plaintext DELETE /hooks/:hook_id/url_variables/:key