Skip to main content

Create Repo Web Hook

Creates a new webhook on the specified repository.

Example:

$ curl -X POST -u credentials -H 'Content-Type: application/json'
https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo-slug/hooks
-d '
{
"description": "Webhook Description",
"url": "https://example.com/",
"active": true,
"events": [
"repo:push",
"issue:created",
"issue:updated"
]
}'

Note that this call requires the webhook scope, as well as any scope that applies to the events that the webhook subscribes to. In the example above that means: webhook, repository and issue.

Also note that the url must properly resolve and cannot be an internal, non-routed address.

External Documentation

To learn more, visit the Bitbucket documentation.

Parameters

ParameterDescription
Active-
DescriptionA user-defined description of the webhook.
EventsThe events this webhook is subscribed to.
Repo SlugThis can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: {repository UUID}.
URLThe URL events get delivered to.
Workspace SlugThis can either be the workspace ID (slug) or the workspace UUID
surrounded by curly-braces, for example: {workspace UUID}.

Example Output

{
"active": false,
"created_at": "date-time",
"description": "A user-defined description of the webhook.",
"events": [
"string"
],
"subject": {
"type": "string"
},
"subject_type": "The type of entity, which is `repository` in the case of webhook subscriptions on repositories.",
"type": "string",
"url": "The URL events get delivered to.",
"uuid": "The webhook's id"
}

Workflow Library Example

Create Repo Web Hook with Bitbucket and Send Results Via Email

Workflow LibraryPreview this Workflow on desktop