Skip to content

Latest commit

 

History

History
511 lines (304 loc) · 21.5 KB

WebhooksApi.md

File metadata and controls

511 lines (304 loc) · 21.5 KB

\WebhooksApi

All URIs are relative to https://api.bitbucket.org/2.0

Method HTTP request Description
HookEventsGet Get /hook_events
HookEventsSubjectTypeGet Get /hook_events/{subject_type}
RepositoriesUsernameRepoSlugHooksGet Get /repositories/{username}/{repo_slug}/hooks
RepositoriesUsernameRepoSlugHooksPost Post /repositories/{username}/{repo_slug}/hooks
RepositoriesUsernameRepoSlugHooksUidDelete Delete /repositories/{username}/{repo_slug}/hooks/{uid}
RepositoriesUsernameRepoSlugHooksUidGet Get /repositories/{username}/{repo_slug}/hooks/{uid}
RepositoriesUsernameRepoSlugHooksUidPut Put /repositories/{username}/{repo_slug}/hooks/{uid}
TeamsUsernameHooksGet Get /teams/{username}/hooks
TeamsUsernameHooksPost Post /teams/{username}/hooks
TeamsUsernameHooksUidDelete Delete /teams/{username}/hooks/{uid}
TeamsUsernameHooksUidGet Get /teams/{username}/hooks/{uid}
TeamsUsernameHooksUidPut Put /teams/{username}/hooks/{uid}
UsersUsernameHooksGet Get /users/{username}/hooks
UsersUsernameHooksPost Post /users/{username}/hooks
UsersUsernameHooksUidDelete Delete /users/{username}/hooks/{uid}
UsersUsernameHooksUidGet Get /users/{username}/hooks/{uid}
UsersUsernameHooksUidPut Put /users/{username}/hooks/{uid}

HookEventsGet

SubjectTypes HookEventsGet(ctx, )

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\" } } }, \"team\": { \"links\": { \"events\": { \"href\": \"https://api.bitbucket.org/2.0/hook_events/team\" } } }, \"user\": { \"links\": { \"events\": { \"href\": \"https://api.bitbucket.org/2.0/hook_events/user\" } } } }

Required Parameters

This endpoint does not need any parameter.

Return type

SubjectTypes

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

HookEventsSubjectTypeGet

PaginatedHookEvents HookEventsSubjectTypeGet(ctx, subjectType)

Returns a paginated list of all valid webhook events for the specified entity. This is public data that does not require any scopes or authentication. Example: NOTE: The following example is a truncated response object for the team subject_type. We return the same structure for the other subject_type objects. $ curl https://api.bitbucket.org/2.0/hook_events/team { \"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\" } ] }

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
subjectType string A resource or subject type.

Return type

PaginatedHookEvents

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesUsernameRepoSlugHooksGet

PaginatedWebhookSubscriptions RepositoriesUsernameRepoSlugHooksGet(ctx, username, repoSlug)

Returns a paginated list of webhooks installed on this repository.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string
repoSlug string

Return type

PaginatedWebhookSubscriptions

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesUsernameRepoSlugHooksPost

WebhookSubscription RepositoriesUsernameRepoSlugHooksPost(ctx, username, repoSlug)

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/username/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.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string
repoSlug string

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesUsernameRepoSlugHooksUidDelete

RepositoriesUsernameRepoSlugHooksUidDelete(ctx, username, repoSlug, uid)

Deletes the specified webhook subscription from the given repository.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string
repoSlug string
uid string The installed webhook's id

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesUsernameRepoSlugHooksUidGet

WebhookSubscription RepositoriesUsernameRepoSlugHooksUidGet(ctx, username, repoSlug, uid)

Returns the webhook with the specified id installed on the specified repository.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string
repoSlug string
uid string The installed webhook's id.

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

RepositoriesUsernameRepoSlugHooksUidPut

WebhookSubscription RepositoriesUsernameRepoSlugHooksUidPut(ctx, username, repoSlug, uid)

Updates the specified webhook subscription. The following properties can be mutated: * description * url * active * events

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string
repoSlug string
uid string The installed webhook's id

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TeamsUsernameHooksGet

PaginatedWebhookSubscriptions TeamsUsernameHooksGet(ctx, username)

Returns a paginated list of webhooks installed on this team.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string

Return type

PaginatedWebhookSubscriptions

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TeamsUsernameHooksPost

WebhookSubscription TeamsUsernameHooksPost(ctx, username)

Creates a new webhook on the specified team. Team webhooks are fired for events from all repositories belonging to that team account. Note that only admins can install webhooks on teams.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TeamsUsernameHooksUidDelete

TeamsUsernameHooksUidDelete(ctx, username, uid)

Deletes the specified webhook subscription from the given team account.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string
uid string The installed webhook's id

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TeamsUsernameHooksUidGet

WebhookSubscription TeamsUsernameHooksUidGet(ctx, username, uid)

Returns the webhook with the specified id installed on the given team account.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string
uid string The installed webhook's id.

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

TeamsUsernameHooksUidPut

WebhookSubscription TeamsUsernameHooksUidPut(ctx, username, uid)

Updates the specified webhook subscription. The following properties can be mutated: * description * url * active * events

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string
uid string The installed webhook's id

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UsersUsernameHooksGet

PaginatedWebhookSubscriptions UsersUsernameHooksGet(ctx, username)

Returns a paginated list of webhooks installed on this user account. Note that the username path parameter has been deprecated due to privacy changes. Use the account's UUID or account_id instead.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string

Return type

PaginatedWebhookSubscriptions

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UsersUsernameHooksPost

WebhookSubscription UsersUsernameHooksPost(ctx, username)

Creates a new webhook on the specified user account. Account-level webhooks are fired for events from all repositories belonging to that account. Note that one can only register webhooks on one's own account, not that of others. Also, note that the username path parameter has been deprecated due to privacy changes. Use the account's UUID or account_id instead.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UsersUsernameHooksUidDelete

UsersUsernameHooksUidDelete(ctx, username, uid)

Deletes the specified webhook subscription from the given user account. Note that the username path parameter has been deprecated due to privacy changes. Use the account's UUID or account_id instead.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string
uid string The installed webhook's id

Return type

(empty response body)

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UsersUsernameHooksUidGet

WebhookSubscription UsersUsernameHooksUidGet(ctx, username, uid)

Returns the webhook with the specified id installed on the given user account. Note that the username path parameter has been deprecated due to privacy changes. Use the account's UUID or account_id instead.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string
uid string The installed webhook's id.

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

UsersUsernameHooksUidPut

WebhookSubscription UsersUsernameHooksUidPut(ctx, username, uid)

Updates the specified webhook subscription. The following properties can be mutated: * description * url * active * events Note that the username path parameter has been deprecated due to privacy changes. Use the account's UUID or account_id instead.

Required Parameters

Name Type Description Notes
ctx context.Context context for logging, tracing, authentication, etc.
username string
uid string The installed webhook's id

Return type

WebhookSubscription

Authorization

api_key, basic, oauth2

HTTP request headers

  • Content-Type: application/json
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]