# System hooks

## Reference

- v4 API:
  - `gitlab.v4.objects.Hook`
  - `gitlab.v4.objects.HookManager`
  - `gitlab.Gitlab.hooks`
- v3 API:
  - `gitlab.v3.objects.Hook`
  - `gitlab.v3.objects.HookManager`
  - `gitlab.Gitlab.hooks`
- GitLab API: https://docs.gitlab.com/ce/api/system_hooks.html

## Examples

List the system hooks:

    hooks = gl.hooks.list()

Create a system hook:

    hook = gl.hooks.create({'url': 'http://your.target.url'})

Test a system hook. The returned object is not usable (it misses the hook ID):

    gl.hooks.get(hook_id)

Delete a system hook:

    gl.hooks.delete(hook_id)
    # or
    hook.delete()