hooks
Create a system hook
Changed onCreates a system hook. This endpoint has a rate limit of five requests per minute for each authenticated user. On GitLab Self-Managed and GitLab Dedicated, an administrator can change this limit in the application settings.
post/api/v4/hooks
Request
- Base URLhttps://gitlab.com
- Authnone declared
Request body
Example request
{
"url": "http://example.com/hook",
"url_variables": [
{
"key": "token",
"value": "123"
}
],
"custom_headers": [
{
"key": "X-Custom-Header",
"value": "value"
}
]
}Response
Create a system hook
Example response
{
"id": 1,
"url": "https://webhook.site",
"name": "Hook name",
"description": "Hook description",
"created_at": "2012-05-28T04:42:42-07:00",
"organization_id": 1,
"alert_status": "executable",
"disabled_until": "2012-05-28T04:42:42-07:00",
"url_variables": [
{
"token": "secr3t"
}
],
"push_events_branch_filter": "my-branch-*",
"branch_filter_strategy": "wildcard",
"custom_webhook_template": "{\"event\":\"{{object_kind}}\"}",
"custom_headers": [
{
"X-Custom-Header": "value"
}
]
}Changes
- info
added the non-success response with the status
- info