All URIs are relative to https://api.bitbucket.org/2.0
Method | HTTP request | Description |
---|---|---|
HookEventsGet | Get /hook_events | Get a webhook resource |
HookEventsSubjectTypeGet | Get /hook_events/{subject_type} | List subscribable webhook types |
RepositoriesWorkspaceRepoSlugHooksGet | Get /repositories/{workspace}/{repo_slug}/hooks | List webhooks for a repository |
RepositoriesWorkspaceRepoSlugHooksPost | Post /repositories/{workspace}/{repo_slug}/hooks | Create a webhook for a repository |
RepositoriesWorkspaceRepoSlugHooksUidDelete | Delete /repositories/{workspace}/{repo_slug}/hooks/{uid} | Delete a webhook for a repository |
RepositoriesWorkspaceRepoSlugHooksUidGet | Get /repositories/{workspace}/{repo_slug}/hooks/{uid} | Get a webhook for a repository |
RepositoriesWorkspaceRepoSlugHooksUidPut | Put /repositories/{workspace}/{repo_slug}/hooks/{uid} | Update a webhook for a repository |
WorkspacesWorkspaceHooksGet | Get /workspaces/{workspace}/hooks | List webhooks for a workspace |
WorkspacesWorkspaceHooksPost | Post /workspaces/{workspace}/hooks | Create a webhook for a workspace |
WorkspacesWorkspaceHooksUidDelete | Delete /workspaces/{workspace}/hooks/{uid} | Delete a webhook for a workspace |
WorkspacesWorkspaceHooksUidGet | Get /workspaces/{workspace}/hooks/{uid} | Get a webhook for a workspace |
WorkspacesWorkspaceHooksUidPut | Put /workspaces/{workspace}/hooks/{uid} | Update a webhook for a workspace |
SubjectTypes HookEventsGet(ctx, ) Get a webhook resource
Returns the webhook resource or subject types on which webhooks can be registered. Each resource/subject type contains an events
link that returns the paginated list of specific events each individual subject type can emit. This endpoint is publicly accessible and does not require authentication or scopes. Example: $ curl https://api.bitbucket.org/2.0/hook_events { \"repository\": { \"links\": { \"events\": { \"href\": \"https://api.bitbucket.org/2.0/hook_events/repository\" } } }, \"workspace\": { \"links\": { \"events\": { \"href\": \"https://api.bitbucket.org/2.0/hook_events/workspace\" } } } }
This endpoint does not need any parameter.
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PaginatedHookEvents HookEventsSubjectTypeGet(ctx, subjectType, optional) List subscribable webhook types
Returns a paginated list of all valid webhook events for the specified entity. The team and user webhooks are deprecated, and you should use workspace instead. For more information, see the announcement. This is public data that does not require any scopes or authentication. Example: NOTE: The following example is a truncated response object for the workspace
subject_type
. We return the same structure for the other subject_type
objects. $ curl https://api.bitbucket.org/2.0/hook_events/workspace { \"page\": 1, \"pagelen\": 30, \"size\": 21, \"values\": [ { \"category\": \"Repository\", \"description\": \"Whenever a repository push occurs\", \"event\": \"repo:push\", \"label\": \"Push\" }, { \"category\": \"Repository\", \"description\": \"Whenever a repository fork occurs\", \"event\": \"repo:fork\", \"label\": \"Fork\" }, { \"category\": \"Repository\", \"description\": \"Whenever a repository import occurs\", \"event\": \"repo:imported\", \"label\": \"Import\" }, ... { \"category\":\"Pull Request\", \"label\":\"Approved\", \"description\":\"When someone has approved a pull request\", \"event\":\"pullrequest:approved\" }, ] }
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
subjectType | string | A resource or subject type. | |
optional | *WebhooksApiHookEventsSubjectTypeGetOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a WebhooksApiHookEventsSubjectTypeGetOpts struct
Name | Type | Description | Notes |
---|
page | optional.Int32| page |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PaginatedWebhookSubscriptions RepositoriesWorkspaceRepoSlugHooksGet(ctx, repoSlug, workspace) List webhooks for a repository
Returns a paginated list of webhooks installed on this repository.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
repoSlug | string | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. | |
workspace | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. | |
optional | *WebhooksApiRepositoriesWorkspaceRepoSlugHooksGetOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a WebhooksApiRepositoriesWorkspaceRepoSlugHooksGetOpts struct
Name | Type | Description | Notes |
---|
page | optional.Int32| page |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhookSubscription RepositoriesWorkspaceRepoSlugHooksPost(ctx, repoSlug, workspace) Create a webhook for a repository
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.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
repoSlug | string | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. | |
workspace | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RepositoriesWorkspaceRepoSlugHooksUidDelete(ctx, repoSlug, uid, workspace) Delete a webhook for a repository
Deletes the specified webhook subscription from the given repository.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
repoSlug | string | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. | |
uid | string | Installed webhook's ID | |
workspace | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. |
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhookSubscription RepositoriesWorkspaceRepoSlugHooksUidGet(ctx, repoSlug, uid, workspace) Get a webhook for a repository
Returns the webhook with the specified id installed on the specified repository.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
repoSlug | string | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. | |
uid | string | Installed webhook's ID | |
workspace | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhookSubscription RepositoriesWorkspaceRepoSlugHooksUidPut(ctx, repoSlug, uid, workspace) Update a webhook for a repository
Updates the specified webhook subscription. The following properties can be mutated: * description
* url
* active
* events
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
repoSlug | string | This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`. | |
uid | string | Installed webhook's ID | |
workspace | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
PaginatedWebhookSubscriptions WorkspacesWorkspaceHooksGet(ctx, workspace, optional) List webhooks for a workspace
Returns a paginated list of webhooks installed on this workspace.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
workspace | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. | |
optional | *WebhooksApiWorkspacesWorkspaceHooksGetOpts | optional parameters | nil if no parameters |
Optional parameters are passed through a pointer to a WebhooksApiWorkspacesWorkspaceHooksGetOpts struct
Name | Type | Description | Notes |
---|
page | optional.Int32| page |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhookSubscription WorkspacesWorkspaceHooksPost(ctx, workspace) Create a webhook for a workspace
Creates a new webhook on the specified workspace. Workspace webhooks are fired for events from all repositories contained by that workspace. Example: $ curl -X POST -u credentials -H 'Content-Type: application/json' https://api.bitbucket.org/2.0/workspaces/my-workspace/hooks -d ' { \"description\": \"Webhook Description\", \"url\": \"https://example.com/\", \"active\": true, \"events\": [ \"repo:push\", \"issue:created\", \"issue:updated\" ] }'
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
. The url
must properly resolve and cannot be an internal, non-routed address. Only workspace owners can install webhooks on workspaces.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
workspace | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WorkspacesWorkspaceHooksUidDelete(ctx, uid, workspace) Delete a webhook for a workspace
Deletes the specified webhook subscription from the given workspace.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
uid | string | Installed webhook's ID | |
workspace | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. |
(empty response body)
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhookSubscription WorkspacesWorkspaceHooksUidGet(ctx, uid, workspace) Get a webhook for a workspace
Returns the webhook with the specified id installed on the given workspace.
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
uid | string | Installed webhook's ID | |
workspace | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]
WebhookSubscription WorkspacesWorkspaceHooksUidPut(ctx, uid, workspace) Update a webhook for a workspace
Updates the specified webhook subscription. The following properties can be mutated: * description
* url
* active
* events
Name | Type | Description | Notes |
---|---|---|---|
ctx | context.Context | context for authentication, logging, cancellation, deadlines, tracing, etc. | |
uid | string | Installed webhook's ID | |
workspace | string | This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example: `{workspace UUID}`. |
- Content-Type: Not defined
- Accept: application/json
[Back to top] [Back to API list] [Back to Model list] [Back to README]