@itentialopensource/adapter-bitbucket
Version:
This adapter integrates with system described as: bitbucket.
1,440 lines (1,344 loc) • 467 kB
YAML
openapi: 3.0.0
info:
title: Bitbucket
description: Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.
contact:
name: Bitbucket Support
url: https://support.atlassian.com/bitbucket
email: support@bitbucket.org
version: '2.0'
servers:
- url: https://api.bitbucket.org/2.0
variables: {}
- url: https://bitbucket.org/site/oauth2
variables: {}
paths:
/teams/{username}/repositories:
get:
tags:
- users
- teams
summary: TeamsRepositoriesByUsername_GET
description: >-
All repositories owned by a user/team. This includes private
repositories, but filtered down to the ones that the calling user has
access to.
operationId: TeamsRepositoriesByUsername_GET
parameters:
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'200':
description: ''
headers: {}
content: {}
default:
description: Unexpected error.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- repository
/user:
get:
tags:
- users
summary: User_GET
description: Returns the currently logged in user.
operationId: User_GET
parameters: []
responses:
'200':
description: The current user.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/user'
'401':
description: When the request wasn't authenticated.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- account
/user/emails:
get:
tags:
- users
summary: UserEmails_GET
description: >-
Returns all the authenticated user's email addresses. Both
confirmed and unconfirmed.
operationId: UserEmails_GET
parameters: []
responses:
'200':
description: ''
headers: {}
content: {}
default:
description: Unexpected error.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- email
/user/emails/{email}:
get:
tags:
- users
summary: UserEmailsByEmail_GET
description: >-
Returns details about a specific one of the authenticated user's
email addresses.
Details describe whether the address has been confirmed by the user and
whether it is the user's primary address or not.
operationId: UserEmailsByEmail_GET
parameters:
- name: email
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'200':
description: ''
headers: {}
content: {}
default:
description: Unexpected error.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- email
/users/{username}:
get:
tags:
- users
summary: UsersByUsername_GET
description: >-
Gets the public information associated with a user account.
If the user's profile is private, `location`, `website` and
`created_on` elements are omitted.
operationId: UsersByUsername_GET
parameters:
- name: username
in: path
description: The account's username or UUID.
required: true
style: simple
schema:
type: string
responses:
'200':
description: The user object
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/user'
'404':
description: If no user exists for the specified name or UUID, or if the specified account is a team account, not a personal account.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
/users/{username}/followers:
get:
tags:
- users
summary: UsersFollowersByUsername_GET
description: Returns the list of accounts that are following this team.
operationId: UsersFollowersByUsername_GET
parameters:
- name: username
in: path
description: The account's username
required: true
style: simple
schema:
type: string
responses:
'200':
description: A paginated list of user objects.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/paginated_users'
- description: A paginated list of users.
'404':
description: If no account exists for the specified name, or if the specified account is a team account, not a personal account.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
/users/{username}/following:
get:
tags:
- users
summary: UsersFollowingByUsername_GET
description: Returns the list of accounts this user is following.
operationId: UsersFollowingByUsername_GET
parameters:
- name: username
in: path
description: The user's username
required: true
style: simple
schema:
type: string
responses:
'200':
description: A paginated list of user objects.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/paginated_users'
- description: A paginated list of users.
'404':
description: If no user exists for the specified name, or if the specified account is a team account, not a personal account.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- account
/users/{username}/hooks:
get:
tags:
- users
- webhooks
summary: UsersHooksByUsername_GET
description: Returns a paginated list of webhooks installed on this user account.
operationId: UsersHooksByUsername_GET
parameters:
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'200':
description: The paginated list of installed webhooks.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/paginated_webhook_subscriptions'
- description: A paginated list of webhook subscriptions
'403':
description: If the authenticated user is accessing an account other than their own.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
'404':
description: If the specified account does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- webhook
post:
tags:
- users
- webhooks
summary: UsersHooksByUsername_POST
description: >-
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.
operationId: UsersHooksByUsername_POST
parameters:
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'201':
description: The newly installed webhook.
headers:
Location:
description: The URL of new newly created webhook.
content:
text/plain:
schema:
type: string
description: The URL of new newly created webhook.
content:
application/json:
schema:
$ref: '#/components/schemas/webhook_subscription'
'403':
description: If the authenticated user is accessing an account other than their own.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
'404':
description: If the specified account does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- webhook
/users/{username}/hooks/{uid}:
delete:
tags:
- users
- webhooks
summary: UsersHooksByUsernameAndUid_DELETE
description: >-
Deletes the specified webhook subscription from the given user
account.
operationId: UsersHooksByUsernameAndUid_DELETE
parameters:
- name: uid
in: path
description: The installed webhook's id
required: true
style: simple
schema:
type: string
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'204':
description: When the webhook was deleted successfully
headers: {}
content: {}
'403':
description: If the authenticated user does not have permission to delete the webhook.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
'404':
description: If the webhook or user does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- webhook
get:
tags:
- users
- webhooks
summary: UsersHooksByUsernameAndUid_GET
description: >-
Returns the webhook with the specified id installed on the given
user account.
operationId: UsersHooksByUsernameAndUid_GET
parameters:
- name: uid
in: path
description: The installed webhook's id.
required: true
style: simple
schema:
type: string
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'200':
description: The webhook subscription object.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/webhook_subscription'
'404':
description: If the webhook or user does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- webhook
put:
tags:
- users
- webhooks
summary: UsersHooksByUsernameAndUid_PUT
description: >-
Updates the specified webhook subscription.
The following properties can be mutated:
* `description`
* `url`
* `active`
* `events`
operationId: UsersHooksByUsernameAndUid_PUT
parameters:
- name: uid
in: path
description: The installed webhook's id
required: true
style: simple
schema:
type: string
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'200':
description: The webhook subscription object.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/webhook_subscription'
'403':
description: If the authenticated user does not have permission to update the webhook.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
'404':
description: If the webhook or user does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- webhook
/users/{username}/repositories:
get:
tags:
- users
- teams
summary: UsersRepositoriesByUsername_GET
description: >-
All repositories owned by a user/team. This includes private
repositories, but filtered down to the ones that the calling user has
access to.
operationId: UsersRepositoriesByUsername_GET
parameters:
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'200':
description: ''
headers: {}
content: {}
default:
description: Unexpected error.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- repository
/teams:
get:
tags:
- teams
summary: Teams_GET
description: >-
Returns all the teams that the authenticated user is associated
with.
operationId: Teams_GET
parameters:
- name: role
in: query
description: >-
Filters the teams based on the authenticated user's role on each team.
* **member**: returns a list of all the teams which the caller is a member of
at least one team group or repository owned by the team
* **contributor**: returns a list of teams which the caller has write access
to at least one repository owned by the team
* **admin**: returns a list teams which the caller has team administrator access
style: form
explode: true
schema:
allOf:
- $ref: '#/components/schemas/role4'
- description: >-
Filters the teams based on the authenticated user's role on each team.
* **member**: returns a list of all the teams which the caller is a member of
at least one team group or repository owned by the team
* **contributor**: returns a list of teams which the caller has write access
to at least one repository owned by the team
* **admin**: returns a list teams which the caller has team administrator access
responses:
'200':
description: A paginated list of teams.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/paginated_teams'
- description: A paginated list of teams.
'401':
description: When the request wasn't authenticated.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- team
/teams/{username}:
get:
tags:
- teams
summary: TeamsByUsername_GET
description: >-
Gets the public information associated with a team.
If the team's profile is private, `location`, `website` and
`created_on` elements are omitted.
operationId: TeamsByUsername_GET
parameters:
- name: username
in: path
description: The team's username or UUID.
required: true
style: simple
schema:
type: string
responses:
'200':
description: The team object
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/account'
'404':
description: If no team exists for the specified name or UUID, or if the specified account is a personal account, not a team account.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
/teams/{username}/followers:
get:
tags:
- teams
summary: TeamsFollowersByUsername_GET
description: Returns the list of accounts that are following this team.
operationId: TeamsFollowersByUsername_GET
parameters:
- name: username
in: path
description: The team's username
required: true
style: simple
schema:
type: string
responses:
'200':
description: A paginated list of user objects.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/paginated_users'
- description: A paginated list of users.
'404':
description: If no team exists for the specified name, or if the specified account is a personal account, not a team account.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
/teams/{username}/following:
get:
tags:
- teams
summary: TeamsFollowingByUsername_GET
description: Returns the list of accounts this team is following.
operationId: TeamsFollowingByUsername_GET
parameters:
- name: username
in: path
description: The team's username
required: true
style: simple
schema:
type: string
responses:
'200':
description: A paginated list of user objects.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/paginated_users'
- description: A paginated list of users.
'404':
description: If no team exists for the specified name, or if the specified account is a personal account, not a team account.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- account
/teams/{username}/hooks:
get:
tags:
- teams
- webhooks
summary: TeamsHooksByUsername_GET
description: Returns a paginated list of webhooks installed on this team.
operationId: TeamsHooksByUsername_GET
parameters:
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'200':
description: The paginated list of installed webhooks.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/paginated_webhook_subscriptions'
- description: A paginated list of webhook subscriptions
'403':
description: If the authenticated user is not an admin on the specified team.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
'404':
description: If the specified team does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- webhook
post:
tags:
- teams
- webhooks
summary: TeamsHooksByUsername_POST
description: >-
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.
operationId: TeamsHooksByUsername_POST
parameters:
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'201':
description: The newly installed webhook.
headers:
Location:
description: The URL of new newly created webhook.
content:
text/plain:
schema:
type: string
description: The URL of new newly created webhook.
content:
application/json:
schema:
$ref: '#/components/schemas/webhook_subscription'
'403':
description: If the authenticated user is not an admin on the specified team.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
'404':
description: If the specified team does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- webhook
/teams/{username}/hooks/{uid}:
delete:
tags:
- teams
- webhooks
summary: TeamsHooksByUsernameAndUid_DELETE
description: >-
Deletes the specified webhook subscription from the given team
account.
operationId: TeamsHooksByUsernameAndUid_DELETE
parameters:
- name: uid
in: path
description: The installed webhook's id
required: true
style: simple
schema:
type: string
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'204':
description: When the webhook was deleted successfully
headers: {}
content: {}
'403':
description: If the authenticated user does not have permission to delete the webhook.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
'404':
description: If the webhook or team does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- webhook
get:
tags:
- teams
- webhooks
summary: TeamsHooksByUsernameAndUid_GET
description: >-
Returns the webhook with the specified id installed on the given
team account.
operationId: TeamsHooksByUsernameAndUid_GET
parameters:
- name: uid
in: path
description: The installed webhook's id.
required: true
style: simple
schema:
type: string
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'200':
description: The webhook subscription object.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/webhook_subscription'
'404':
description: If the webhook or team does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- webhook
put:
tags:
- teams
- webhooks
summary: TeamsHooksByUsernameAndUid_PUT
description: >-
Updates the specified webhook subscription.
The following properties can be mutated:
* `description`
* `url`
* `active`
* `events`
operationId: TeamsHooksByUsernameAndUid_PUT
parameters:
- name: uid
in: path
description: The installed webhook's id
required: true
style: simple
schema:
type: string
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'200':
description: The webhook subscription object.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/webhook_subscription'
'403':
description: If the authenticated user does not have permission to update the webhook.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
'404':
description: If the webhook or team does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- webhook
/teams/{username}/members:
get:
tags:
- teams
summary: TeamsMembersByUsername_GET
description: >-
All members of a team.
Returns all members of the specified team. Any member of any of the
team's groups is considered a member of the team. This includes users
in groups that may not actually have access to any of the team's
repositories.
Note that members using the "private profile" feature are not included.
operationId: TeamsMembersByUsername_GET
parameters:
- name: username
in: path
description: ''
required: true
style: simple
schema:
type: string
responses:
'200':
description: All members
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/user'
'404':
description: When the team does not exist, or multiple teams with the same name exist that differ only in casing and the URL did not match the exact casing of a particular one.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- account
/repositories:
get:
tags:
- repositories
summary: Repositories_GET
description: >-
Returns a paginated list of all public repositories.
This endpoint also supports filtering and sorting of the results. See
[filtering and sorting](../meta/filtering) for more details.
operationId: Repositories_GET
parameters:
- name: after
in: query
description: >-
Filter the results to include only repositories create on or
after this [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)
timestamp. Example: `YYYY-MM-DDTHH:mm:ss.sssZ`
style: form
explode: true
schema:
type: string
responses:
'200':
description: All public repositories.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/paginated_repositories'
- description: A paginated list of repositories.
deprecated: false
security:
- oauth2:
- repository
/repositories/{username}:
get:
tags:
- repositories
summary: RepositoriesByUsername_GET
description: >-
Returns a paginated list of all repositories owned by the specified
account or UUID.
The result can be narrowed down based on the authenticated user's role.
E.g. with `?role=contributor`, only those repositories that the
authenticated user has write access to are returned (this includes any
repo the user is an admin on, as that implies write access).
This endpoint also supports filtering and sorting of the results. See
[filtering and sorting](../../meta/filtering) for more details.
operationId: RepositoriesByUsername_GET
parameters:
- name: username
in: path
description: >-
This can either be the username or the UUID of the user,
surrounded by curly-braces, for example: `{user UUID}`.
required: true
style: simple
schema:
type: string
- name: role
in: query
description: >-
Filters the result based on the authenticated user's role on each repository.
* **member**: returns repositories to which the user has explicit read access
* **contributor**: returns repositories to which the user has explicit write access
* **admin**: returns repositories to which the user has explicit administrator access
* **owner**: returns all repositories owned by the current user
style: form
explode: true
schema:
allOf:
- $ref: '#/components/schemas/role1'
- description: >-
Filters the result based on the authenticated user's role on each repository.
* **member**: returns repositories to which the user has explicit read access
* **contributor**: returns repositories to which the user has explicit write access
* **admin**: returns repositories to which the user has explicit administrator access
* **owner**: returns all repositories owned by the current user
responses:
'200':
description: The repositories owned by the specified account.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/paginated_repositories'
- description: A paginated list of repositories.
'404':
description: If the specified account does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- repository
/repositories/{username}/{repo_slug}:
delete:
tags:
- repositories
summary: RepositoriesByUsernameAndRepoSlug_DELETE
description: >-
Deletes the repository. This is an irreversible operation.
This does not affect its forks.
operationId: RepositoriesByUsernameAndRepoSlug_DELETE
parameters:
- name: username
in: path
description: >-
This can either be the username or the UUID of the user,
surrounded by curly-braces, for example: `{user UUID}`.
required: true
style: simple
schema:
type: string
- name: repo_slug
in: path
description: >-
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: `{repository UUID}`.
required: true
style: simple
schema:
type: string
responses:
'204':
description: Indicates successful deletion.
headers: {}
content: {}
'403':
description: If the caller either does not have admin access to the repository, or the repository is set to read-only.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
'404':
description: If the repository does not exist.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- repository:delete
get:
tags:
- repositories
summary: RepositoriesByUsernameAndRepoSlug_GET
description: Returns the object describing this repository.
operationId: RepositoriesByUsernameAndRepoSlug_GET
parameters:
- name: username
in: path
description: >-
This can either be the username or the UUID of the user,
surrounded by curly-braces, for example: `{user UUID}`.
required: true
style: simple
schema:
type: string
- name: repo_slug
in: path
description: >-
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: `{repository UUID}`.
required: true
style: simple
schema:
type: string
responses:
'200':
description: The repository object.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/repository'
'403':
description: If the repository is private and the authenticated user does not have access to it.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
'404':
description: If no repository exists at this location.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- repository
post:
tags:
- repositories
summary: RepositoriesByUsernameAndRepoSlug_POST
description: >-
Creates a new repository.
Note: In order to set the project for the newly created repository,
pass in either the project key or the project UUID as part of the
request body as shown in the examples below:
```
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": {
"key": "MARS"
}
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
```
or
```
$ curl -X POST -H "Content-Type: application/json" -d '{
"scm": "git",
"project": {
"key": "{ba516952-992a-4c2d-acbd-17d502922f96}"
}
}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding
```
The project must only be assigned for repositories belonging to a team.
If the repository owner is a team and the project is not provided, the
repository is automatically assigned to the oldest project in the team.
Note: In the examples above, the username `teamsinspace`,
and/or the repository name `hablanding` can be replaced by UUIDs.
operationId: RepositoriesByUsernameAndRepoSlug_POST
parameters:
- name: username
in: path
description: >-
This can either be the username or the UUID of the user,
surrounded by curly-braces, for example: `{user UUID}`.
required: true
style: simple
schema:
type: string
- name: repo_slug
in: path
description: >-
This can either be the repository slug or the UUID of the repository,
surrounded by curly-braces, for example: `{repository UUID}`.
required: true
style: simple
schema:
type: string
requestBody:
description: The repository that is to be created. Note that most object elements are optional. Elements "owner" and "full_name" are ignored as the URL implies them.
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/repository'
- description: The repository that is to be created. Note that most object elements are optional. Elements "owner" and "full_name" are ignored as the URL implies them.
required: false
responses:
'200':
description: The newly created repository.
headers: {}
content:
application/json:
schema:
$ref: '#/components/schemas/repository'
'400':
description: If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
'401':
description: If the request was not authenticated.
headers: {}
content:
application/json:
schema:
allOf:
- $ref: '#/components/schemas/error'
- description: Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.
deprecated: false
security:
- oauth2:
- repository:admin
put:
tags:
- repositories
summary: RepositoriesByUsernameAndRepoSlug_PUT
description: >-
Since this endpoint can be used to both update and to create a
repository, the request body depends on the intent.
### Creation
See the POST documentation for the repository endpoint for an example
of the request body.
### Update
Note: Changing the `name` of the repository will cause the location to
be changed. This is because the URL of the repo is derived from the
name (a process called slugification). In such a scenario, it is
possible for the request to fail if the newly created slug conflicts
with an existing repository's slug. But if there is no conflict,
the new location will be returned in the `Location` header of the
response.
operationId: RepositoriesByUsernameAndRepoSlug_PUT
parameters:
- name: username
in: path
description: >-
This can either be the username or the UUID of the user,
surrounded by curly-braces, for example: `{user UUID}`.
required: true