{ "info": { "termsOfService": "https://www.atlassian.com/legal/customer-agreement", "version": "2.0", "title": "Bitbucket API", "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": { "url": "https://support.atlassian.com/bitbucket-cloud/", "name": "Bitbucket Support", "email": "support@bitbucket.org" } }, "x-radar-pages": [ { "content": "\n# Authentication methods\n\nThe purpose of this section is to describe how to authenticate when making API calls using the Bitbucket REST API.\n\n-----\n\n*On this page*\n\n* [Oauth 2](#oauth-2)\n * [Making requests](#make-requests)\n * [Repository cloning](#repo-clone)\n * [Refresh tokens](#refresh-tokens)\n* [Scopes](#scopes-bbc)\n* [App passwords](#app-pw)\n* [Basic auth](#basic-auth)\n\n---\n\n# Bitbucket Cloud OAuth 2.0 \n\nOur OAuth 2 implementation is merged in with our existing OAuth 1 in\nsuch a way that existing OAuth 1 consumers automatically become\nvalid OAuth 2 clients. The only thing you need to do is edit your\nexisting consumer and configure a callback URL.\n\nOnce that is in place, you'll have the following 2 URLs:\n\n https://bitbucket.org/site/oauth2/authorize\n https://bitbucket.org/site/oauth2/access_token\n\nFor obtaining access/bearer tokens, we support all 4 of RFC-6749's grant\nflows, plus a custom Bitbucket flow for exchanging JWT tokens for access tokens:\n\n\n### 1. Authorization Code Grant (4.1)\n\nThe full-blown 3-LO flow. Request authorization from the end user by\nsending their browser to:\n\n https://bitbucket.org/site/oauth2/authorize?client_id={client_id}&response_type=code\n\nThe callback includes the `?code={}` query parameter that you can swap\nfor an access token:\n\n $ curl -X POST -u \"client_id:secret\" \\\n https://bitbucket.org/site/oauth2/access_token \\\n -d grant_type=authorization_code -d code={code}\n\n\n### 2. Implicit Grant (4.2)\n\nThis flow is useful for browser-based add-ons that operate without server-side backends.\n\nRequest the end user for authorization by directing the browser to:\n\n https://bitbucket.org/site/oauth2/authorize?client_id={client_id}&response_type=token\n\nThat will redirect to your preconfigured callback URL with a fragment\ncontaining the access token\n(`#access_token={token}&token_type=bearer`) where your page's js can\npull it out of the URL.\n\n\n### 3. Resource Owner Password Credentials Grant (4.3)\n\nUseful if you have the end user's password but you want to use a more\nsecure end user access token instead. This method will not work when the user has two-step verification enabled.\n\n $ curl -X POST -u \"client_id:secret\" \\\n https://bitbucket.org/site/oauth2/access_token -d grant_type=password \\\n -d username={username} -d password={password}\n\n\n### 4. Client Credentials Grant (4.4)\n\nSomewhat like our existing \"2-LO\" flow for OAuth 1. Obtain an access\ntoken that represents not an end user, but the owner of the\nclient/consumer:\n\n $ curl -X POST -u \"client_id:secret\" \\\n https://bitbucket.org/site/oauth2/access_token \\\n -d grant_type=client_credentials\n\n\n### 5. Bitbucket Cloud JWT Grant (urn:bitbucket:oauth2:jwt)\n\nIf your Atlassian Connect add-on uses JWT authentication, you can swap a\nJWT for an OAuth access token. The resulting access token represents the\naccount for which the add-on is installed.\n\nMake sure you send the JWT token in the Authorization request header\nusing the \"JWT\" scheme (case sensitive). Note that this custom scheme\nmakes this different from HTTP Basic Auth (and so you cannot use \"curl\n-u\").\n\n $ curl -X POST -H \"Authorization: JWT {jwt_token}\" \\\n https://bitbucket.org/site/oauth2/access_token \\\n -d grant_type=urn:bitbucket:oauth2:jwt\n\n\n## Making Requests \n\nOnce you have an access token, as per RFC-6750, you can use it in a request in any of\nthe following ways (in decreasing order of desirability):\n\n1. Send it in a request header: `Authorization: Bearer {access_token}`\n2. Include it in a (application/x-www-form-urlencoded) POST body as `access_token={access_token}`\n3. Put it in the query string of a non-POST: `?access_token={access_token}`\n\n\n## Repository Cloning \n\nSince add-ons will not be able to upload their own SSH keys to clone\nwith, access tokens can be used as Basic HTTP Auth credentials to\nclone securely over HTTPS. This is much like GitHub, yet slightly\ndifferent:\n\n $ git clone https://x-token-auth:{access_token}@bitbucket.org/user/repo.git\n\nThe literal string `x-token-auth` as a substitute for username is\nrequired (note the difference with GitHub where the actual token is in\nthe username field).\n\n\n## Refresh Tokens \n\nOur access tokens expire in one hour. When this happens you'll get 401\nresponses.\n\nMost access tokens grant responses (Implicit and JWT excluded). Therefore, you should include a\nrefresh token that can then be used to generate a new access token,\nwithout the need for end user participation:\n\n $ curl -X POST -u \"client_id:secret\" \\\n https://bitbucket.org/site/oauth2/access_token \\\n -d grant_type=refresh_token -d refresh_token={refresh_token}\n\n\n# Scopes for the Bitbucket Cloud REST API \n\nBitbucket's API applies a number of privilege scopes to endpoints. In order to access an endpoint, a request will need to have the necessary scopes.\n\nScopes are declared in the descriptor as a list of strings, with each string being the name of a unique scope.\n\nA descriptor lacking the `scopes` element is implicitly assumed to require all scopes and as a result, Bitbucket will require end users authorizing/installing the add-on\nto explicitly accept all scopes.\n\nOur best practice suggests you add the scopes your add-on needs, but no more than it needs.\n\nInvalid scope strings will cause the descriptor to be rejected and the installation to fail.\n\nFollowing is the set of all currently available scopes.\n\n### repository\n\nGives the add-on read access to all the repositories the authorizing user has access to.\nNote that this scope does not give access to a repository's pull requests.\n\n* access to the repo's source code\n* clone over https\n* access the the file browsing API\n* download zip archives of the repo's contents\n* the ability to view and use the issue tracker on any repo (created issues, comment, vote, etc)\n* the ability to view and use the wiki on any repo (create/edit pages)\n\n### repository:write\n\nGives the add-on write (not admin) access to all the repositories the authorizing user has access to. No distinction is made between public or private repos. This scope implies `repository`, which does not need to be requested separately.\nThis scope alone does not give access to the pull requests API.\n\n* push access over https\n* fork repos\n\n### repository:admin\n\nGives the add-on admin access to all the repositories the authorizing user has access to. No distinction is made between public or private repos. This scope does not imply `repository` or `repository:write`. It gives access to the admin features of a repo only, not direct access to its contents. Of course it can be (mis)used to grant read access to another user account who can then clone the repo, but repos that need to read of write source code would also request explicit read or write.\nThis scope comes with access to the following functionality:\n\n* view and manipulate committer mappings\n* list and edit deploy keys\n* ability to delete the repo\n* view and edit repo permissions\n* view and edit branch permissions\n* import and export the issue tracker\n* enable and disable the issue tracker\n* list and edit issue tracker version, milestones and components\n* enable and disable the wiki\n* list and edit default reviewers\n* list and edit repo links (Jira/Bamboo/Custom)\n* list and edit the repository web hooks\n* initiate a repo ownership transfer\n\n### snippet\n\nGives the add-on read access to all the snippets the authorizing user has access to.\nNo distinction is made between public and private snippets (public snippets are accessible without any form of authentication).\n\n* view any snippet\n* create snippet comments\n\n### snippet:write\n\nGives the add-on write access to all the snippets the authorizing user can edit.\nNo distinction is made between public and private snippets (public snippets are accessible without any form of authentication).\nThis implies the Snippet Read scope which does not need to be requested separately.\n\n* edit snippets\n* delete snippets\n\n### issue\n\nAbility to interact with issue trackers the way non-repo members can.\nThis scope does not imply any other scopes and does not give implicit access to the repository the issue is attached to.\n\n* view, list and search issues\n* create new issues\n* comment on issues\n* watch issues\n* vote for issues\n\n### issue:write\n\nThis implies `issue`, but adds the ability to transition and delete issues.\nThis scope does not imply any other scopes and does not give implicit access to the repository the issue is attached to.\n\n* transition issues\n* delete issues\n\n### wiki\n\nGives access to wikis. No distinction is made between read and write as wikis are always editable by anyone.\nThis scope does not imply any other scopes and does not give implicit access to the repository the wiki is attached to.\n\n* view wikis\n* create pages\n* edit pages\n* push to wikis\n* clone wikis\n\n### pullrequest\n\nGives the add-on read access to pull requests.\nThis scope implies `repository`, giving read access to the pull request's destination repository.\n\n* see and list pull requests\n* create and resolve tasks\n\n### pullrequest:write\n\nImplies `pullrequest` but adds the ability to create, merge and decline pull requests.\nThis scope implies `repository:write`, giving write access to the pull request's destination repository. This is necessary to facilitate merging.\n\n* merge pull requests\n* decline pull requests\n* create pull requests\n* comment on pull requests\n* approve pull requests\n\n### email\n\nAbility to see the user's primary email address. This should make it easier to use Bitbucket Cloud as a login provider to add-ons or external applications.\n\n### account\n\nAbility to see all the user's account information. Note that this does not include any ability to mutate any of the data.\n\n* see all email addresses\n* language\n* location\n* website\n* full name\n* SSH keys\n* user groups\n\n### account:write\n\nAbility to change properties on the user's account.\n\n* delete the authorizing user's account\n* manage the user's groups\n* manupilate a user's email addresses\n* change username, display name and avatar\n\n### team\n\nThe ability to find out what teams the current user is part of. This is covered by the teams endpoint.\n\n* information about all the groups and teams I am a member or admin of\n\n\n### team:write\n\nImplies `team`, but adds the ability to manage the teams that the authorizing user is an admin on.\n\n* manage team permissions\n\n### webhook\n\nGives access to webhooks. This scope is required for any webhook\nrelated operation.\n\nThis scope gives read access to existing webhook subscriptions on all\nresources you can access, without needing further scopes. This means that\na client can list all existing webhook subscriptions on repository\n`foo/bar` (assuming the principal user has access to this repo). The\nadditional `repository` scope is not required for this.\n\nLikewise, existing webhook subscriptions for a repo's issue tracker can be\nretrieved without holding the `issue` scope. All that is required is the\n`webhook` scope.\n\nHowever, to create a webhook for `issue:created`, the client will need to\nhave both the `webhook` as well as `issue` scope.\n\n* list webhook subscriptions on any accessible repository, user, team, or snippet\n* create/update/delete webhook subscriptions\n\n\n# App passwords \n\nApp passwords allow two-step verification users to make API calls to their Bitbucket account through apps such as Sourcetree.\n\nSome important points about app passwords:\n\n* You cannot view an app password or adjust permissions after you create the app password. Because app passwords are encrypted on our database and cannot be viewed by anyone. They are essentially designed to be disposable. If you need to change the scopes or lost the password just create a new one.\n* You cannot use them to log into your Bitbucket account.\n* You cannot use app passwords to manage team actions.\n\n App passwords are tied to an individual account's credentials and should not be shared. If you're sharing your app password you're essentially giving direct, authenticated, access to everything that password has been scoped to do with the Bitbucket API's.\n\n* You can use them for API call authentication, even if you don't have two-step verification enabled.\n* You can set permission scopes (specific access rights) for each app password.\n\n### Create an app password\n\nTo create an app password:\n\n1. Select **Avatar > Bitbucket settings**.\n2. [Click **App passwords** in the Access management section.](https://bitbucket.org/account/admin/app-passwords)\n3. Click **Create app password**.\n4. Give the app password a name related to the application that will use the password.\n5. Select the specific access and permissions you want this application password to have.\n6. Copy the generated password and either record or paste it into the application you want to give access. The password is only displayed this one time.\n\nThat's all there is to creating an app password. See your applications documentation for how to apply the app password for a specific application.\n\n## Basic auth \n\nBasic HTTP Authentication as per [RFC-2617](https://tools.ietf.org/html/rfc2617) (Digest not supported). Note that Basic Auth with username and password as credentials is only available on accounts that have 2-factor-auth / 2-step-verification disabled. If you use 2fa, you should authenticate using OAuth2 instead.\n", "title": "Authentication methods", "description": "How to authenticate API actions", "key": "authentication", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOTcuNjQ3MyAxODYuODEzOCI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgaXNvbGF0aW9uOiBpc29sYXRlOwogICAgICB9CgogICAgICAuY2xzLTIgewogICAgICAgIGZpbGw6ICNkZTM1MGI7CiAgICAgIH0KCiAgICAgIC5jbHMtMyB7CiAgICAgICAgZmlsbDogI2ZmNTYzMDsKICAgICAgfQoKICAgICAgLmNscy00IHsKICAgICAgICBmaWxsOiAjZGZlMWU1OwogICAgICAgIG1peC1ibGVuZC1tb2RlOiBtdWx0aXBseTsKICAgICAgfQoKICAgICAgLmNscy01IHsKICAgICAgICBmaWxsOiAjZmFmYmZjOwogICAgICB9CgogICAgICAuY2xzLTYgewogICAgICAgIGZpbGw6ICNlYmVjZjA7CiAgICAgIH0KCiAgICAgIC5jbHMtNyB7CiAgICAgICAgZmlsbDogbm9uZTsKICAgICAgICBzdHJva2U6ICMwMDY1ZmY7CiAgICAgICAgc3Ryb2tlLW1pdGVybGltaXQ6IDEwOwogICAgICAgIHN0cm9rZS13aWR0aDogMnB4OwogICAgICB9CgogICAgICAuY2xzLTggewogICAgICAgIGZpbGw6ICM1ZTZjODQ7CiAgICAgIH0KCiAgICAgIC5jbHMtOSB7CiAgICAgICAgZmlsbDogIzI1Mzg1ODsKICAgICAgfQoKICAgICAgLmNscy0xMCB7CiAgICAgICAgZmlsbDogIzI2ODRmZjsKICAgICAgfQoKICAgICAgLmNscy0xMSB7CiAgICAgICAgZmlsbDogIzAwNjVmZjsKICAgICAgfQogICAgPC9zdHlsZT4KICA8L2RlZnM+CiAgPHRpdGxlPlNlY3VyaXR5IHdpdGggS2V5PC90aXRsZT4KICA8ZyB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Q5MzIsMTIyLjgwMjlBMjIuNDkyOSwyMi40OTI5LDAsMSwxLDQ0Ljk4NTgsMTAwLjMxLDIyLjUxODUsMjIuNTE4NSwwLDAsMSwyMi40OTMyLDEyMi44MDI5Wm0wLTM3LjA5NzJBMTQuNjA0MiwxNC42MDQyLDAsMSwwLDM3LjA5NzIsMTAwLjMxLDE0LjYyMDcsMTQuNjIwNywwLDAsMCwyMi40OTMyLDg1LjcwNTdaIi8+CiAgICAgIDwvZz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo=" }, { "content": "\n# Filter and sort API objects\n\nYou can query the 2.0 API for specific objects using a simple language which resembles SQL.\n\nNote that filtering and querying by username has been deprecated, due to privacy changes.\nSee the [announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#changes-to-querying)\nfor details.\n\n---\n**On this page**\n\n* [Supported endpoints](#supp-endpoints)\n* [Operators](#operators)\n* [Data types](#data-types)\n* [Querying](#querying)\n * [Repositoriess](#query-repo)\n * [Pull requests](#query-pullreq)\n * [Issues](#query-issues)\n * [Refs, tags, bookmarks](#query-ref)\n* [Sorting query results](#query-sort)\n\n----\n\n### Supported endpoints \n\nMost 2.0 API resources that return paginated collections of objects support a single, shared, generic querying language that is used to filter down a result set.\n\nThis includes, but is in no way limited to:\n\n /2.0/repositories/{workspace}\n /2.0/repositories/{workspace}/{slug}/refs\n /2.0/repositories/{workspace}/{slug}/refs/branches\n /2.0/repositories/{workspace}/{slug}/refs/tags\n /2.0/repositories/{workspace}/{slug}/forks\n /2.0/repositories/{workspace}/{slug}/src\n /2.0/repositories/{workspace}/{slug}/issues\n /2.0/repositories/{workspace}/{slug}/pullrequests\n\nFiltering and sorting supports several distinct operators and data types as well as basic features, like logical operators (AND, OR).\nAs examples, the following queries could be used on the issue tracker endpoint (`/2.0/repositories/{workspace}/{slug}/issues/`):\n\n\t(state = \"open\" OR state = \"new\") AND assignee = null\n\treporter.nickname != \"evzijst\" AND priority >= \"major\"\n\t(title ~ \"unicode\" OR content.raw ~ \"unicode\") AND created_on > 2015-10-04T14:00:00-07:00\n\nFilter queries can be added to the URL using the q= query parameter. To sort the response, add sort=. Note that the entire query string is put in the q parameter and hence needs to be URL-encoded as shown in the following example:\n\n\t/2.0/repositories/foo/bar/issues?q=state=\"new\"&sort=-updated_on\n\n\n### Operators \n\nFiltering and sorting supports the following operators:\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
OperatorDefinitionExample
\"=\"test for equality nickname = \"evzijst\"
\"!=\"not equalis_private != true
\"~\"case-insensitive text contains description ~ \"beef\"
\"!~\"case-insensitive not contains description !~ \"fubar\"
\">\"greater thanpriority > \"major\"
\">=\"greater than or equalpriority <= \"trivial\"
\"<\"less thanid < 1234
\"<=\"less than or equal updated_on <= 2015-03-04
\n\n### Data types \n\nFiltering and sorting supports the following data types:\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
TypeDescriptionExample
Stringany text inside double quotes\"foo\"
Numberarbitrary precision integers and floats1, -10.302
Nullto test for the absence of a valuenull
booleanthe unquoted strings true or falsetrue, false
datetimean unquoted ISO-8601 date time string with the timezone offset, milliseconds and entire time component being optional2015-03-04T14:08:59.123+02:00, 2015-03-04T14:08:59 Date time strings are assumed to be in UTC, unless an explicit timezone offset is provided.
\n\n## Querying \n\nObjects can be filtered based on their properties. In principle, every element in an object's JSON document schema can be used as a filter criterion.\n\nNote that while the array of objects in a paginated response is wrapped in an\nenvelope with a `values` element, this prefix should not be included in the\nquery fields (so use `/2.0/repositories/foo/bar/issues?q=state=\"new\"`, not\n`/2.0/repositories/foo/bar/issues?q=values.state=\"new\"`).\n\n\n### Examples\n\nFields that contain embedded instances of other object types (e.g. workspace is an embedded workspace object, while parent is an embedded repository) can be traversed recursively. For instance:\n\n\tparent.workspace.slug = \"bitbucket\"\n\nTo find pull requests which merge into master, come from a fork of the repo rather than a branch inside the repo, and on which I am a reviewer:\n\n```\nsource.repository.full_name != \"main/repo\" AND state = \"OPEN\" AND reviewers.nickname = \"evzijst\" AND destination.branch.name = \"master\"\n```\n```\n/2.0/repositories/main/repo/pullrequests?q=source.repository.full_name+%21%3D+%22main%2Frepo%22+AND+state+%3D+%22OPEN%22+AND+reviewers.nickname+%3D+%22evzijst%22+AND+destination.branch.name+%3D+%22master%22\n```\n\nTo find new or on-hold issues related to the UI, created or updated in the last day (SF local time), that have not yet been assigned to anyone:\n\n```\n(state = \"new\" OR state = \"on hold\") AND assignee = null AND component = \"UI\" and updated_on > 2015-11-11T00:00:00-07:00\n```\n```\n/2.0/repositories/main/repo/issues?q=%28state+%3D+%22new%22+OR+state+%3D+%22on+hold%22%29+AND+assignee+%3D+null+AND+component+%3D+%22UI%22+and+updated_on+%3E+2015-11-11T00%3A00%3A00-07%3A00\n```\n\nTo find all tags with the string \"2015\" in the name:\n\n```\nname ~ \"2015\"\n```\n```\n/2.0/repositories/{workspace}/{slug}/refs/tags?q=name+%7E+%222015%22\n```\nOr all my branches:\n\n```\nname ~ \"erik/\"\n```\n```\n/2.0/repositories/{workspace}/{slug}/refs/?q=name+%7E+%22erik%2F%22\n```\n## Sorting query results \n\nYou can sort result sets using the ?sort= query parameter, available on the same resources that support filtering:\n\n* In principle, every field that can be queried can also be used as a key for sorting.\n* By default the sort order is ascending. To reverse the order, prefix the field name with a hyphen (e.g. ?sort=-updated_on).\n* Only one field can be sorted on. Compound fields (e.g. sort on state first, followed by updated_on) are not supported.\n", "title": "Filter and sort API objects", "description": "Query the 2.0 API for specific objects", "key": "filtering", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMTk0LjE5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zA3LTUuOTM5LTI0Ljc5LTE3LjM3ODUtMzkuMDQxNC0yNC41ODIzYTQ4LjMwOTIsNDguMzA5MiwwLDAsMC0xNC4wOTM5LTQuNTNjLS4wODYyLjEzOTUtLjE3OTMuMjczLS4yNjQ0LjQxMzVBNTEuMTkwNyw1MS4xOTA3LDAsMCwwLDc5LjQzMywxMTYuOTgyWiIvPgogICAgICA8L2c+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K" }, { "content": "\n# Pagination\n\nEndpoints that return collections of objects should always apply pagination.\nPaginated collections are always wrapped in the following wrapper object:\n\n```json\n{\n \"size\": 5421,\n \"page\": 2,\n \"pagelen: 10,\n \"next\": \"https://api.bitbucket.org/2.0/repositories/pypy/pypy/commits?page=3\",\n \"previous\": \"https://api.bitbucket.org/2.0/repositories/pypy/pypy/commits?page=1\",\n \"values\": [\n ...\n ]\n}\n```\n\nPagination is often page-bound, with a query parameter page indicating which\npage is to be returned.\n\nHowever, clients are not expected to construct URLs themselves by manipulating\nthe page number query parameter. Instead, the response contains a link to the\nnext page. This link should be treated as an opaque location that is not to be\nconstructed by clients or even assumed to be predictable. The only contract\naround the next link is that it will return the next chunk of results.\n\nLack of a next link in the response indicates the end of the collection.\n\nThe paginated response contains the following fields:\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
FieldValue
sizeTotal number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.
pagePage number of the current results. This is an optional element that is not provided in all responses.
pagelenCurrent number of objects on the existing page. Globally, the minimum length is 10 and the maximum is 100. Some APIs may specify a different default.
nextLink to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.
previousLink to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available.\n Use this link to navigate the result set and refrain from constructing your own URLs.
valuesThe list of objects. This contains at most pagelen objects.
\n\nThe link to the next page is included such that you don't have to hardcode or construct any links. Only values and next are guaranteed (except the last page, which lacks next). This is because the previous and size values can be expensive for some data sets.\n\nIt is important to realize that Bitbucket support both list-based pagination and iterator-based pagination. List-based pagination assumes that the collection is a discrete, immutable, consistently ordered, finite array of objects with a fixed size. Clients navigate a list-based collection by requesting offset-based chunks. In Bitbucket Cloud, list-based responses include the optional size, page, and previous element. The the next and previous links typically resemble something like /foo/bar?page=4.\n\nHowever, not all result sets can be treated as immutable and finite – much like how programming languages tend to distinguish between lists and arrays on one hand and iterators or stream on the other. Where an list-based pagination offers random access into any point in a collection, iterator-based pagination can only navigate forward one element at a time. In Bitbucket such iterator-based pagination contains the next link and pagelen elements, but not necessarily anything else. In these cases, the next link's value often contains an unpredictable hash instead of an explicit page number. The commits resource uses iterator-based pagination.\n", "title": "Pagination", "description": "Learn more about pagination", "key": "pagination", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjM4LjgyIDE1MS42Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2IyZDRmZjt9LmNscy0ye2ZpbGw6IzRjOWFmZjt9LmNscy0ze2ZpbGw6IzAwNTJjYzt9LmNscy00e29wYWNpdHk6MC42O30uY2xzLTV7ZmlsbDp1cmwoI2xpbmVhci1ncmFkaWVudCk7fS5jbHMtNntmaWxsOnVybCgjbGluZWFyLWdyYWRpZW50LTIpO30uY2xzLTd7ZmlsbDp1cmwoI2xpbmVhci1ncmFkaWVudC0zKTt9LmNscy04e2ZpbGw6dXJsKCNsaW5lYXItZ3JhZGllbnQtNCk7fS5jbHMtOXtmaWxsOnVybCgjbGluZWFyLWdyYWRpZW50LTUpO30uY2xzLTEwLC5jbHMtMTEsLmNscy0xMntmaWxsOm5vbmU7fS5jbHMtMTB7c3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PjxsaW5lIGNsYXNzPSJjbHMtMTAiIHgxPSI2Mi45MyIgeTE9IjEwMi4zMyIgeDI9IjcyLjYiIHkyPSIxMDIuMzMiLz48bGluZSBjbGFzcz0iY2xzLTEwIiB4MT0iMTI1Ljk4IiB5MT0iMTEzLjEiIHgyPSIxNDkuMDYiIHkyPSIxMTMuMSIvPjxsaW5lIGNsYXNzPSJjbHMtMTIiIHgxPSI3OS4xNiIgeTE9IjExMy4xIiB4Mj0iMTE3LjI0IiB5Mj0iMTEzLjEiLz48bGluZSBjbGFzcz0iY2xzLTEwIiB4MT0iNjIuOTMiIHkxPSIxMTMuMSIgeDI9IjcyLjYiIHkyPSIxMTMuMSIvPjwvZz48L2c+PC9zdmc+" }, { "content": "\n# Partial responses\n\nBy default, each endpoint returns the full representation of a resource and in\nsome cases that can be a lot of data. For example, retrieving a list of pull\nrequests can amount to quite a large document.\n\nFor better performance, you can ask the server to only return the fields you\nreally need and to omit unwanted data. To request a partial response and to\nadd or remove specific fields from a response, use the `fields` query\nparameter.\n\n\n## Example\n\nMost API resources embed a substantial list of links pointing to related\nresources. This saves the client from constructing its own URLs, but is\nsomewhat wasteful when the client doesn't need them.\n\nTo significantly reduce the size of the response, use `?fields=-links`:\n\n```json\n$ curl https://api.bitbucket.org/2.0/users/evzijst?fields=-links\n{\n \"nickname\": \"evzijst\",\n \"account_status\": \"active\",\n \"website\": \"\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{a288a0ab-e13b-43f0-a689-c4ef0a249875}\",\n \"created_on\": \"2010-07-07T05:16:36+00:00\",\n \"location\": null,\n \"type\": \"user\"\n}\n```\n\n## Fields parameter syntax\n\nThe `fields` parameter supports 3 modes of operation:\n\n1. Removal of select fields (e.g. `-links`)\n2. Pulling in additional fields not normally returned by an endpoint, while\n still getting all the default fields (e.g. `+reviewers`)\n3. Omitting all fields, except those specified (e.g. `owner.display_name`)\n\nThe fields parameter can contain a list of multiple comma-separated field names\n(e.g. `fields=owner.display_name,uuid,links.self.href`). The parameter itself is\nnot repeated.\n\nAs discussed at [Condensed Versus Full Objects](serialization#representations),\nmost objects that are embedded inside other objects (like how `owner` is an\nembedded `user` object in `repository`) appear in \"condensed\" form that omits\nmany fields. The `fields` parameter allows us to pull in additional fields in\nsuch cases.\n\nFor example, the embedded repository object in a pull request does not normally\ncontain its `owner`. To add that in we can use:\n`+values.destination.repository.owner`.\n\n\n## Wildcards\n\nThe asterisk can be used to match all fields on a particular level. For\nexample, removing all entries from the `links` element can be done like this:\n\n```json\n$ curl https://api.bitbucket.org/2.0/users/evzijst?fields=-links.*\n{\n \"nickname\": \"evzijst\",\n \"account_status\": \"active\",\n \"website\": \"\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{a288a0ab-e13b-43f0-a689-c4ef0a249875}\",\n \"links\": {},\n \"created_on\": \"2010-07-07T05:16:36+00:00\",\n \"location\": null,\n \"type\": \"user\"\n}\n```\n\nWildcards can be used in combination with exclusion and inclusion. For\ninstance, `-*,+foo,+bar` will remove all elements from the root level and then\nadd in `foo` and `bar`.\n\n\n## URL encoding\n\nBe aware that when using the `+foo.bar` syntax in the query string, that the\n\"+\" must be URL encoded as \"%2B\" and so the URL will be:\n\n```\nhttps://api.bitbucket.org/2.0/repositories/evzijst/interruptingcow?fields=%2Bowner.created_on\n```\n\nWithout URL escaping, \"+\" is interpreted as an encoded space which will not\nmatch any fields.\n\n\n## Field discovery\n\nWhile a resource's `self` URL, as well its \"collection\" URL typically return\nthe full object with all its fields, there are some exceptions for fields that\nare overly verbose or costly to generate.\n\nFor instance, a pull request contains the embedded lists of reviewers and\nparticipants. These fields are included from the `self` URL, but not from the\n`/pullrequests` collections resource, as it would impact performance too much.\n\nTo discover any additional fields that might not be included by default,\n`fields=*` can be used.\n\n\n## More examples\n\nIf we want to get a list of all reviewer nicknames on pull requests I created,\nwe could combine a [filter](filtering) with a partial response. This will omit\nall other data from the response:\n\n```\n/2.0/repositories/bitbucket/bitbucket/pullrequests?fields=values.id,values.reviewers.nickname,values.state&q=author.uuid%3D%22%7Bd301aafa-d676-4ee0-88be-962be7417567%7D%22\n{\n \"values\": [\n {\n \"reviewers\": [\n {\n \"nickname\": \"abhin\"\n },\n {\n \"nickname\": \"dtao\"\n },\n {\n \"nickname\": \"csomme\"\n }\n ],\n \"state\": \"OPEN\",\n \"id\": 11355\n },\n {\n \"reviewers\": [\n {\n \"nickname\": \"csomme\"\n },\n {\n \"nickname\": \"abhin\"\n },\n {\n \"nickname\": \"dstevens\"\n }\n ],\n \"state\": \"MERGED\",\n \"id\": 11347\n },\n {\n \"reviewers\": [\n {\n \"nickname\": \"csomme\"\n },\n {\n \"nickname\": \"jmooring\"\n },\n {\n \"nickname\": \"zdavis\"\n },\n {\n \"nickname\": \"flexbox\"\n }\n ],\n \"state\": \"OPEN\",\n \"id\": 11344\n }\n ]\n}\n```\n", "title": "Partial responses", "description": "Tweak which fields are returned", "key": "partial-response", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMTYyLjQ0ODcgMjEwLjExMTUiPgogIDxkZWZzPgogICAgPHN0eWxlPgogICAgICAuY2xzLTEgewogICAgICAgIGlzb2xhdGlvbjogaXNvbGF0ZTsKICAgICAgfQoKICAgICAgLmNscy0yLCAuY2xzLTYsIC5jbHMtOCB7CiAgICAgICAgZmlsbDogbm9uZTsKICAgICAgfQoKICAgICAgLmNscy0yLCAuY2xzLTggewogICAgICAgIHN0cm9rZTogIzAwNjVmZjsKICAgICAgICBzdHJva2Utd2lkdGg6IDJweDsKICAgICAgfQoKICAgICAgLmNscy0yIHsKICAgICAgICBzdHJva2UtbGluZWpvaW46IHJvdW5kOwogICAgICB9CgogICAgICAuY2xzLTMgewogICAgICAgIGZpbGw6ICNlN2U4ZWM7CiAgICAgIH0KCiAgICAgIC5j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Y2xhc3M9ImNscy05IiBwb2ludHM9IjE2Mi40NDkgMzguNzQyIDEyMy43MDcgMzguNzQyIDEyMy43MDcgMCAxNjIuNDQ5IDM4Ljc0MiIvPgogICAgICA8L2c+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K" }, { "content": "\n# Open API Specification and Object Representations\n\n----\n\n*On this page*\n\n* [Open API Specification](#oai)\n* [JSON Schema](#jsonschema)\n* [Condensed Versus Full Objects](#representations)\n\n____\n\n\n## Open API Specification \n\nBitbucket uses the [Open API Specification](https://openapis.org) (OAI,\nformerly known as Swagger) to describe its APIs. Our OAI specification schema\nis hosted at [https://api.bitbucket.org/swagger.json](https://api.bitbucket.org/swagger.json)\nand serves as the canonical definition and comprehensive declaration of all\navailable endpoints.\n\nThe OAI specification makes writing client applications easier by:\nauto-generating boilerplate code (like data object classes) and dealing with\nauthentication and error handling.\n\nYou can find a comprehensive set of open tools for the OAI specification at:\n[https://github.com/swagger-api](https://github.com/swagger-api).\n\n\n## JSON Schema \n\nBitbucket uses JSON Schema to describe the layout of every type of object\nconsumed or produced by the API. These schemas are collected under the\n`#definitions` element of our swagger.json file.\n\nWhen an endpoint expects an object as part of a POST or PUT, it also expects\nthe object to validate against the JSON schemas. The same applies to objects\nreturned by an endpoint.\n\n\n## Condensed Versus Full Objects \n\nMost objects in Bitbucket come both in \"full\" and \"partial\" representation.\nThe full representation is when all elements are included. This is the layout\nreturned by a resource's `self` location (e.g. `/2.0/repositories/foo/bar`),\nas well as resource collection endpoints (e.g. `/2.0/repositories`).\n\nHowever, Bitbucket objects often embed other objects. For example, a `repository`\nobject embeds a `user` object for its owner. Likewise, a `pullrequest` object\nembeds its `repository` object.\n\nThese related objects are embedded, or inlined, to reduce the \"chatter\" when\nclients make frequent followup API calls to collect information on common,\nrelated information.\n\nEmbedded related objects are typically limited in their fields to avoid such\nobject graphs from becoming too deep and noisy. They often exclude their own\nnested objects in an attempt to strike a balance between performance and\nutility.\n\nAn object's embedded or condensed representation tends to be standardized,\nmeaning the fields included is the same set, regardless of where the object\nwas embedded.\n", "title": "Schemas and Serialization", "description": "Learn more about object representations", "key": "serialization", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMjAuNzYyNCAyMDUuNTg2Ij4KICA8ZGVmcz4KICAgIDxzdHlsZT4KICAgICAgLmNscy0xIHsKICAgICAgICBpc29sYXRpb246IGlzb2xhdGU7CiAgICAgIH0KCiAgICAgIC5jbHMtMiwgLmNscy02IHsKICAgICAgICBtaXgtYmxlbmQtbW9kZTogbXVsdGlwbHk7CiAgICAgIH0KCiAgICAgIC5jbHMtMTMsIC5jbHMtMywgLmNscy00LCAuY2xzLTYgewogICAgICAgIGZpbGw6IG5vbmU7CiAgICAgICAgc3Ryb2tlOiAjYzFjN2QwOwogICAgICAgIHN0cm9rZS1saW5lY2FwOiByb3VuZDsKICAgICAgICBzdHJva2UtbWl0ZXJsaW1pdDogMTA7CiAgICAgICAgc3Ryb2tlLXdpZHRoOiAycHg7CiAgICAgIH0KCiAgICAgIC5jbHMtNCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMy43ODE2IDUuMjk0MzsKICAgICAgfQoKICAgICAgLmNscy01IHsKICAgICAgICBmaWxsOiAjMDA2NWZmOwogICAgICB9CgogICAgICAuY2xzLTYgewogICAgICAgIHN0cm9rZS1kYXNoYXJyYXk6IDMuOTIxOSA1LjQ5MDc7CiAgICAgIH0KCiAgICAgIC5jbHMtNyB7CiAgICAgICAgZmlsbDogIzAwNTJjYzsKICAgICAgfQoKICAgICAgLmNscy04IHsKICAgICAgICBmaWxsOiAjNGM5YWZmOwogICAgICB9CgogICAgICAuY2xzLTkgewogICAgICAgIGZpbGw6ICMwMDQ5YjA7CiAgICAgIH0KCiAgICAgIC5jbHMtMTAgewogICAgICAgIGZpbGw6ICM1N2Q5YTM7CiAgICAgIH0KCiAgICAgIC5jbHMtMTE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KICAgICAgICA8cG9seWdvbiBjbGFzcz0iY2xzLTE1IiBwb2ludHM9Ijc0Ljg3NSAxODUuNjYyIDc1LjA1NCAyMDUuNTg2IDU3LjMxOSAxOTQuMDU3IDU3LjEzOSAxNzQuMTMyIDc0Ljg3NSAxODUuNjYyIi8+CiAgICAgICAgPHBvbHlnb24gY2xhc3M9ImNscy0xNiIgcG9pbnRzPSI5Mi4zOTQgMTczLjgxNSA5Mi41NzQgMTkzLjczOSA3NS4wNTQgMjA1LjU4NiA3NC44NzUgMTg1LjY2MiA5Mi4zOTQgMTczLjgxNSIvPgogICAgICA8L2c+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K" }, { "content": "\n# URI, UUID, and structures\n\nYou should be familiar with REST architecture before writing an integration. Read this overview page to gain a good understanding of Bitbucket's REST implementation.\n\n----\n**On this page**\n\n* [URI structure](#uri-structure)\n* [HTTP methods](#http-methods)\n* [UUID](#uuid)\n * [User object and UUID](#userobj)\n * [Repository object and UUID](#repo-obj)\n * [Team object and UUID](#teamobj)\n* [Standard error responses](#stand-error)\n* [Standard ISO-8601 timestamps](#timestamp)\n\n----\n\n\n## URI structure \n\nAll Bitbucket Cloud requests start with the `https://api.bitbucket.org/2.0` prefix (for the 2.0 API) and `https://api.bitbucket.org/1.0` prefix (1.0 API).\n\nThe next segment of the URI path depends on the endpoint of the request. For example, using the curl command and the repositories endpoint you can list all the issues on Bitbucket's tutorial repository:\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/tutorials/tutorials.bitbucket.org\n```\nGiven a specific endpoint, you can then drill down to a particular aspect or resource of that endpoint. The issues resource on a repository is an example:\n\n```\ncurl https://api.bitbucket.org/1.0/repositories/tutorials/tutorials.bitbucket.org/issues\n```\n### HTTP methods \nA given endpoint or resource has a series of actions (or methods) associated with it. The Bitbucket service supports these standard HTTP methods:\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
CallDescription
GETRetrieves information.
PUTUpdates existing information.
POSTCreates new information.
DELETERemoves existing information.
\n\nFor example, you can call use the POST action on the issues resource and create an issue on the issue tracker.\n\n**Specifying content length**\n\nYou can get a `411 Length Required` response. If this happens, the API requires a Content-Length header but the client is not sending it. You should add the header yourself, for example using the curl client:\n\n```\ncurl -r PUT --header \"Content-Length: 0\" -u user:pass https://api.bitbucket.org/1.0/emails/rap@atlassian.com\n```\n## Universally Unique Identifier \n\nUUID's provide a single point of recognition for users, teams, and repositories. The UUID is distinct from the username, team name, and repository name fields and remains the same even when those fields change. For example when a user changes their username or moves a repository you will need to modify calls which use those identifiers but not if you are pointing to the UUID.\n\n### UUID examples and structure\n\nUUID's work with both the 1.0 and 2.0 APIs for the user, team, and repository objects. The following examples the following characters are replacements for curly brackets: `%7B` replaces `{` and `%7D` replaces `}`. You will see this structure in the following example sections.\n\n### User object and UUID \n\nWhen you make a call using either the username or the UUID for that user the response is the same.\n\n**Call with username**:\n\n```\ncurl https://api.bitbucket.org/2.0/users/tutorials\n```\n\n***Call with UUID for the user**:\n\n```\ncurl https://api.bitbucket.org/2.0/users/%7Bc788b2da-b7a2-404c-9e26-d3f077557007%7D\n```\n\n**Response**\n```JSON\n{\n \"username\": \"tutorials\",\n \"nickname\": \"tutorials\",\n \"account_status\": \"active\",\n \"website\": \"https://tutorials.bitbucket.org/\",\n \"display_name\": \"tutorials account\",\n \"uuid\": \"{c788b2da-b7a2-404c-9e26-d3f077557007}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials\"\n },\n \"repositories\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/tutorials\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/tutorials\"\n },\n \"followers\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/followers\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2013/Nov/25/tutorials-avatar-1563784409-6_avatar.png\"\n },\n \"following\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/following\"\n }\n },\n \"created_on\": \"2011-12-20T16:34:07.132459+00:00\",\n \"location\": \"Santa Monica, CA\",\n \"type\": \"user\"\n}\n```\n\n### Repository object and UUID \n\nOnce you have the UUID for a repository you no longer need a username or team name to make the API call so long as you use an empty field. This helps you resolve repositories no matter if the username or team name changes.\n\n**Call with team name (1team) and repository name (moxie)**:\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/1team/moxie\n```\n**Call with UUID and empty field**:\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/%7B%7D/%7B21fa9bf8-b5b2-4891-97ed-d590bad0f871%7D\n```\n\n**Call with UUID and teamname**:\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/1team/%7B21fa9bf8-b5b2-4891-97ed-d590bad0f871%7D\n```\n\n**Response**\n\n```JSON\n{\n \"created_on\": \"2013-11-08T01:11:03.222520+00:00\",\n \"description\": \"\",\n \"fork_policy\": \"allow_forks\",\n \"full_name\": \"1team/moxie\",\n \"has_issues\": false,\n \"has_wiki\": false,\n \"is_private\": false,\n \"language\": \"\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/1team/moxie/avatar/32/\"\n },\n \"branches\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/refs/branches\"\n },\n \"clone\": [\n {\n \"href\": \"https://bitbucket.org/1team/moxie.git\",\n \"name\": \"https\"\n },\n {\n \"href\": \"ssh://git@bitbucket.org/1team/moxie.git\",\n \"name\": \"ssh\"\n }\n ],\n \"commits\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/commits\"\n },\n \"downloads\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/downloads\"\n },\n \"forks\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/forks\"\n },\n \"hooks\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/hooks\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/1team/moxie\"\n },\n \"pullrequests\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/pullrequests\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie\"\n },\n \"tags\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/refs/tags\"\n },\n \"watchers\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/watchers\"\n }\n },\n \"name\": \"moxie\",\n \"owner\": {\n \"display_name\": \"the team\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/1team/avatar/32/\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/1team/\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/teams/1team\"\n }\n },\n \"type\": \"team\",\n \"username\": \"1team\",\n \"uuid\": \"{aa559944-83c9-4963-a9a8-69ac8d9cf5d2}\"\n },\n \"project\": {\n \"key\": \"PROJ\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/user/1team/projects/PROJ/avatar/32\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/account/user/1team/projects/PROJ\"\n }\n },\n \"name\": \"Untitled project\",\n \"type\": \"project\",\n \"uuid\": \"{ab52aaeb-16ad-4fb0-bb1d-47e4f00367ff}\"\n },\n \"scm\": \"git\",\n \"size\": 33348,\n \"type\": \"repository\",\n \"updated_on\": \"2013-11-08T01:11:03.263237+00:00\",\n \"uuid\": \"{21fa9bf8-b5b2-4891-97ed-d590bad0f871}\",\n \"website\": \"\"\n}\n```\n\n### Team object and UUID \n\nThis example shows a call for a list of team members using both the team name and with the UUID for the team object. As the call is unauthenticated in the following example the response object will only show members with public profiles. The response is the same in either case.\n\n**Call with teamname**\n\n```\ncurl https://api.bitbucket.org/2.0/teams/1team/members\n```\n**Call with UUID for team object**\n\n```\ncurl https://api.bitbucket.org/2.0/teams/%7Baa559944-83c9-4963-a9a8-69ac8d9cf5d2%7D/members\n```\n\n**Response**\n\n```JSON\n{\n \"page\": 1,\n \"pagelen\": 50,\n \"size\": 2,\n \"values\": [\n {\n \"created_on\": \"2011-12-20T16:34:07.132459+00:00\",\n \"display_name\": \"tutorials account\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/tutorials/avatar/32/\"\n },\n \"followers\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/followers\"\n },\n \"following\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/following\"\n },\n \"hooks\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/hooks\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/tutorials/\"\n },\n \"repositories\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/tutorials\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials\"\n },\n \"snippets\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/tutorials\"\n }\n },\n \"location\": null,\n \"type\": \"user\",\n \"username\": \"tutorials\",\n \"nickname\": \"tutorials\",\n \"account_status\": \"active\",\n \"uuid\": \"{c788b2da-b7a2-404c-9e26-d3f077557007}\",\n \"website\": \"https://tutorials.bitbucket.org/\"\n },\n {\n \"created_on\": \"2013-12-10T14:44:13+00:00\",\n \"display_name\": \"Dan Stevens [Atlassian]\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/dans9190/avatar/32/\"\n },\n \"followers\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/dans9190/followers\"\n },\n \"following\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/dans9190/following\"\n },\n \"hooks\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/dans9190/hooks\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/dans9190/\"\n },\n \"repositories\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/dans9190\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/dans9190\"\n },\n \"snippets\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/dans9190\"\n }\n },\n \"location\": null,\n \"type\": \"user\",\n \"username\": \"dans9190\",\n \"nickname\": \"dans9190\",\n \"account_status\": \"active\",\n \"uuid\": \"{1cd06601-cd0e-4fce-be03-e9ac226978b7}\",\n \"website\": \"\"\n }\n ]\n}\n```\n\n## Standardized error responses \n\nThe 2.0 API standardizes the error response layout. The 2.0 API serves a JSON\nobject along with the appropriate HTTP status code. The JSON object provides a\ndetailed problem description.\n\n```json\n{\n \"type\": \"error\",\n \"error\": {\n \"message\": \"Bad request\",\n \"fields\": {\n \"src\": [\n \"This field is required.\"\n ]\n },\n \"detail\": \"You must specify a valid source branch when creating a pull request.\",\n \"id\": \"d23a1cc5178f7637f3d9bf2d13824258\",\n \"data\": {\n \"extra\": \"Optional, endpoint-specific data to further augment the error.\"\n }\n }\n}\n```\n\nThis object contains an error element which contains the following nested\nelements:\n\n\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
ElementDescription
messageA short description of the problem. This element is always present. Its value may be localized.
fieldsThis optional element is used in response to POST or PUT operations in which clients have provided invalid input. It contains a list of one or more client-provided fields that failed validation. The values may be localized.
detailAn optional detailed explanation of the failure. Its value may be localized.
idAn optional unique error identifier that identifies the error in Bitbucket's logging system. If you feel you hit a bug in an API and this field is provided, please mention it if you decide to contact support as it will greatly help us narrow down the problem.
\n\n## Standard ISO-8601 timestamps \n\nAll 2.0 APIs use standardized ISO-8601 timestamps. In most cases, our APIs return UTC timestamps and for these, the timezone offset part will be 00:00. In rare cases where the original localized timestamp has significance, the timezone offset may identify the event's original timezone.\n", "title": "URI, UUID, and structures", "description": "URL's, UUID's, errors, and timestamps", "key": "uri-uuid", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAg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M9ImNscy0xMCIgeDE9IjEwMiIgeTE9IjEzMS4wNSIgeDI9IjE2My42MiIgeTI9IjEzMS4wNSIvPjxsaW5lIGNsYXNzPSJjbHMtMTMiIHgxPSI1NS44OSIgeTE9IjEzMS4wNSIgeDI9IjkzLjk5IiB5Mj0iMTMxLjA1Ii8+PGxpbmUgY2xhc3M9ImNscy0xMyIgeDE9IjU1Ljg5IiB5MT0iMTQ1LjEzIiB4Mj0iMTM5LjY3IiB5Mj0iMTQ1LjEzIi8+PGxpbmUgY2xhc3M9ImNscy05IiB4MT0iNzguOSIgeTE9IjE1OS4yMSIgeDI9IjExMy41MSIgeTI9IjE1OS4yMSIvPjxsaW5lIGNsYXNzPSJjbHMtOSIgeDE9IjU5LjYxIiB5MT0iODguODIiIHgyPSI5OS4zMyIgeTI9Ijg4LjgyIi8+PGxpbmUgY2xhc3M9ImNscy05IiB4MT0iNTkuNjEiIHkxPSIxMDIuODkiIHgyPSI5OS4zMyIgeTI9IjEwMi44OSIvPjxjaXJjbGUgY2xhc3M9ImNscy02IiBjeD0iMTMuNSIgY3k9IjEyLjA4IiByPSI1LjExIi8+PGNpcmNsZSBjbGFzcz0iY2xzLTciIGN4PSIzMC4xOCIgY3k9IjEyLjA4IiByPSI1LjExIi8+PGNpcmNsZSBjbGFzcz0iY2xzLTgiIGN4PSI0Ni44NiIgY3k9IjEyLjA4IiByPSI1LjExIi8+PC9nPjwvZz48L3N2Zz4=" }, { "content": "\n# Cors and hypermedia\n\nThis section describes [Cross-origin resource sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) (CORS), what content types we support in requests and responses, and hyperlinking resources in each json responses.\n\n\n----\n**On this page**\n\n* [CORS](#cors)\n* [Supported content types](#supported-content)\n* [Resource links](#resource-links)\n\n----\n\n## Cors \n\nThe Bitbucket API supports Cross-origin resource sharing to allow requests for restricted resources across domains. For more information you can refer to:\n\n* [Wikipedia article on CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)\n* [W3C CORS recommendation](https://www.w3.org/TR/cors/)\n\nSending a general request from the api to bitbucket.com:\n\n`curl -i https://api.bitbucket.org -H \"origin: http://bitbucket.com\"`\n\nGives this result:\n\n HTTP/1.1 302 FOUND\n Server: nginx/1.6.2\n Vary: Cookie\n Cache-Control: max-age=900\n Content-Type: text/html; charset=utf-8\n Strict-Transport-Security: max-age=31536000\n Date: Tue, 21 Jun 2016 17:54:37 GMT\n Location: http://confluence.atlassian.com/x/IYBGDQ\n X-Served-By: app-110\n X-Static-Version: 2c820eb0d2b3\n ETag: \"d41d8cd98f00b204e9800998ecf8427e\"\n X-Content-Type-Options: nosniff\n X-Render-Time: 0.00379920005798\n Connection: Keep-Alive\n X-Version: 2c820eb0d2b3\n X-Frame-Options: SAMEORIGIN\n X-Request-Count: 383\n X-Cache-Info: cached\n Content-Length: 0\n\nSending the same request with the CORS check -X OPTIONS in the call:\n\n`curl -i https://api.bitbucket.org -H \"origin: http://bitbucket.com\" -X OPTIONS`\n\nGives this result:\n\n HTTP/1.1 302 FOUND\n Server: nginx/1.6.2\n Vary: Cookie\n Cache-Control: max-age=900\n Content-Type: text/html; charset=utf-8\n Access-Control-Expose-Headers: Accept-Ranges, Content-Encoding, Content-Length, Content-Type, ETag, Last-Modified\n Strict-Transport-Security: max-age=31536000\n Date: Tue, 21 Jun 2016 18:04:30 GMT\n Access-Control-Max-Age: 86400\n Location: http://confluence.atlassian.com/x/IYBGDQ\n X-Served-By: app-111\n Access-Control-Allow-Origin: *\n X-Static-Version: 2c820eb0d2b3\n ETag: \"d41d8cd98f00b204e9800998ecf8427e\"\n X-Content-Type-Options: nosniff\n X-Render-Time: 0.00371098518372\n Connection: keep-alive\n X-Version: 2c820eb0d2b3\n X-Frame-Options: SAMEORIGIN\n X-Request-Count: 357\n Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS\n Access-Control-Allow-Headers: Accept, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, Origin, Range, X-CsrftokenX-Requested-With\n X-Cache-Info: not cacheable; request wasn't a GET or HEAD\n Content-Length: 0\n\n\n\n## Supported content types \n\nThe default and primary content type for 2.0 APIs is JSON. This applies both to responses from the server and to the request bodies provided by the client.\n\nUnless documented otherwise, whenever creating a new (POST) or modifying an existing (PUT) object, your client must provide the object's normal representation. Not every object element can be mutated. For example, a repository's created_on date is an auto-generated, immutable field. Your client can omit immutable fields from a request body.\n\nIn some cases, a resource might also accept regular application/x-www-url-form-encoded POST and PUT bodies. Such bodies can be more convenient in scripts and command line usage. Requests bodies can contain contain nested elements or they can be flat (without nested elements). Clients can send flat request bodies as either as application/json or as application/x-www-url-form-encoded. Nested objects always require JSON.\n\n## Resource links \n\nEvery 2.0 object contains a links element that points to related resources or alternate representations. Use links to quickly discover and traverse to related objects. Links serve a \"self-documenting\" function for each endpoint. For example, the following request for a specific user:\n\n\n`$ curl https://api.bitbucket.org/2.0/users/tutorials`\n\n```json\n{\n \"username\": \"tutorials\",\n \"nickname\": \"tutorials\",\n \"account_status\": \"active\",\n \"website\": \"https://tutorials.bitbucket.org/\",\n \"display_name\": \"tutorials account\",\n \"uuid\": \"{c788b2da-b7a2-404c-9e26-d3f077557007}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials\"\n },\n \"repositories\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/tutorials\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/tutorials\"\n },\n \"followers\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/followers\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2013/Nov/25/tutorials-avatar-1563784409-6_avatar.png\"\n },\n \"following\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/following\"\n }\n },\n \"created_on\": \"2011-12-20T16:34:07.132459+00:00\",\n \"location\": \"Santa Monica, CA\",\n \"type\": \"user\"\n}\n```\nLinks can be actual REST API resources or they can be informational. In this example, informative resources include the user's avatar and the HTML URL for the user's Bitbucket account. Your client should avoid hardcoding an API's URL and instead use the URLs returned in API responses.\n\nA link's key is its `rel` (relationship) attribute and it contains a mandatory href element. For example, the following link:\n\n```json\n\"self\": {\n \"href\": \"https://api.bitbucket.org/api/2.0/users/tutorials\"\n}\n```\n\nThe rel for this link is self and the href is https://api.bitbucket.org/api/2.0/users/tutorials. A single rel key can contain an list (array) of href objects. Your client should anticipate that any rel key can contain one or more href objects.\n\nFinally, links can also contain optional elements. Two common optional elements are the name element and the title element. They are often used to disambiguate links that share the same rel key. In the example below, the repository object that contains a clone link with two href objects. Each object contains the optional name element to clarify its use.\n\n```json\n\"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/evzijst/bitbucket\"\n },\n \"clone\": [\n {\n \"href\": \"https://api.bitbucket.org/evzijst/bitbucket.git\",\n \"name\": \"https\"\n },\n {\n \"href\": \"ssh://git@bitbucket.org/erik/bitbucket.git\",\n \"name\": \"ssh\"\n }\n ],\n ...\n}\n```\nLinks can support [URI Templates](https://tools.ietf.org/html/rfc6570); Those that do contain a `\"templated\": \"true\"` element.\n", "title": "Cors and hypermedia", "description": "Learn about resources and linking", "key": "cors-hypermedia", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjM2LjYgMjE4LjQzIj48ZGVmcz48c3R5bGU+LmNscy0xe2lzb2xhdGlvbjppc29sYXRlO30uY2xzLTIsLmNscy0zLC5jbHMtNHtmaWxsOm5vbmU7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MTA7c3Ryb2tlLXdpZHRoOjExcHg7fS5jbHMtMntzdHJva2U6dXJsKCNsaW5lYXItZ3JhZGllbnQpO30uY2xzLTN7c3Ryb2t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U4LjksNTguOSwwLDAsMCwxODgsMTY5LjA4cy0yLjM1LTkuNDQtNy4zMy0xNi44M0E0My44OSw0My44OSwwLDAsMCwxNjksMTQxLjA4YTMxLjc3LDMxLjc3LDAsMCwwLDI5LjI4LDU2LjEzQzE5My43OSwxOTIuNDQsMTkwLjE4LDE4Ni45LDE4OS42MiwxODAuMzZaIi8+PGcgaWQ9Il9Hcm91cF8yIiBkYXRhLW5hbWU9IiZsdDtHcm91cCZndDsiPjxwYXRoIGNsYXNzPSJjbHMtOSIgZD0iTTg5LjksMzMuNzhhMzIuNDYsMzIuNDYsMCwxLDEsMTEuODgsNDQuMzRBMzIuNDksMzIuNDksMCwwLDEsODkuOSwzMy43OFoiLz48L2c+PHBhdGggY2xhc3M9ImNscy0xMCIgZD0iTTEyMi4yMyw2Ni4xM2E1OC45LDU4LjksMCwwLDAtMS41OS0xMS4yN3MtMi4zNS05LjQ0LTcuMzMtMTYuODNjLTMuMzctNS05LjA2LTkuNzktMTUuNDMtMTMuNDhBMzIuNDQsMzIuNDQsMCwwLDAsMTI4Ljc3LDgwLjZDMTI1LjMxLDc2LjM5LDEyMi43LDcxLjYxLDEyMi4yMyw2Ni4xM1oiLz48L2c+PC9nPjwvZz48L3N2Zz4=" }, { "content": "\n# Atlassian Connect for Bitbucket\n\nYou can use the Atlassian Connect for Bitbucket Cloud to build add-ons which\ncan connect with the Bitbucket UI and your own application set. An add-on could\nbe an integration with another existing service, new features for the Atlassian\napplication, or even a new product that runs within the Atlassian application.\n\nFor complete information see:\n[Atlassian Connect for Bitbucket Cloud](https://developer.atlassian.com/bitbucket/index.html)\n", "title": "Atlassian Connect", "description": "Build Bitbucket add-ons with Connect", "key": "bb-connect", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjU3LjMxNjMgMTYyLjU5OTQiPgogIDxkZWZzPgogICAgPHN0eWxlPgogICAgICAuY2xzLTEgewogICAgICAgIGlzb2xhdGlvbjogaXNvbGF0ZTsKICAgICAgfQoKICAgICAgLmNscy0yIHsKICAgICAgICBmaWxsOiAjMzQ0NTYzOwogICAgICB9CgogICAgICAuY2xzLTMgewogICAgICAgIGZpbGw6ICMxZGI5ZDQ7CiAgICAgIH0KCiAgICAgIC5jbHMtNCB7CiAgICAgICAgZmlsbDogIzAwNTdkODsKICAgICAgfQoKICAgICAgLmNscy01LCAuY2xzLTcsIC5jbHMtOSB7CiAgICAgICAgbWl4LWJsZW5kLW1vZGU6IG11bHRpcGx5OwogICAgICB9CgogICAgICAuY2xzLTUgewogICAgICAgIGZpbGw6IHVybCgjTjc1KTsKICAgICAgfQoKICAgICAgLmNscy02IHsKICAgICAgICBmaWxsOiAjMDA2NWZmOwogICAgICB9CgogICAgICAuY2xzLTcgewogICAgICAgIGZpbGw6IHVybCgjTjc1LTIpOwogICAgICB9CgogICAgICAuY2xzLTggewogICAgICAgIGZpbGw6IHVybCgjbGluZWFyLWdyYWRpZW50KTsKICAgICAgfQoKICAgICAgLmNscy05IHsKICAgICAgICBmaWxsOiB1cmwoI043NS0zKTsKICAgICAgfQoKICAgICAgLmNscy0xMCB7CiAgICAgICAgZmlsbDogdXJsKCNUMjAwLVQ3NSk7CiAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9Ik43NSIgeDE9Ii0yMTg5LjU1NiIgeTE9IjI4MDguMjI4NCIgeDI9Ii0yMDkxLjE1NTEiIHkyPSIyODA4LjIyODQiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMC4xNjgxLCAwLjk4NTgsIDAuOTg1OCwgLTAuMTY4MSwgLTIzNzMuNzM2LCAyNzIyLjEyNzgpIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIG9mZnNldD0iM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MiIHk9Ijc0Ljg1OSIgd2lkdGg9IjI0Ljc1MzYiIGhlaWdodD0iMTIuODgxNSIvPgogICAgICAgIDxyZWN0IGNsYXNzPSJjbHMtNCIgeD0iOTMuNzQ0MSIgeT0iNzQuODU5IiB3aWR0aD0iMjQuNzUzNiIgaGVpZ2h0PSIxMi44ODE1Ii8+CiAgICAgICAgPHJlY3QgY2xhc3M9ImNscy0yIiB4PSIxMzguODE4NiIgeT0iNzQuODU5IiB3aWR0aD0iMjQuNzUzNiIgaGVpZ2h0PSIxMi44ODE1Ii8+CiAgICAgICAgPHJlY3QgY2xhc3M9ImNscy0yIiB4PSIxODAuNjEwNCIgeT0iNzQuODU5IiB3aWR0aD0iMjQuNzUzNiIgaGVpZ2h0PSIxMi44ODE1Ii8+CiAgICAgICAgPHJlY3QgY2xhc3M9ImNscy0yIiB4PSIyMjIuNDAyMiIgeT0iNzQuODU5IiB3aWR0aD0iMjQuNzUzNiIgaGVpZ2h0PSIxMi44ODE1Ii8+CiAgICAgICAgPHJlY3QgY2xhc3M9ImNscy0zIiB4PSI3NC40ODk1IiB3aWR0aD0iMjQuNzUzNiIgaGVpZ2h0PSIxMi44ODE1Ii8+CiAgICAgICAgPHJlY3QgY2xhc3M9ImNscy0zIiB4PSIxMTYuMjgxNCIgd2lkdGg9IjI0Ljc1MzYiIGhlaWdodD0iMTIuODgxNSIvPgogICAgICAgIDxyZWN0IGNsYXNzPSJjbHMtMyIgeD0iMTU4LjA3MzIiIHdpZHRoPSIyNC43NTM2IiBoZWlnaHQ9IjEyLjg4MTUiLz4KICAgICAgPC9nPgogICAgPC9nPgogIDwvZz4KPC9zdmc+Cg==" } ], "schemes": [ "https" ], "produces": [ "application/json" ], "basePath": "/2.0", "tags": [ { "name": "users", "description": "" }, { "name": "teams", "description": "" }, { "name": "repositories", "description": "" }, { "name": "source", "description": "Browse the source code in the repository and\n create new commits by uploading." }, { "name": "refs", "description": "" }, { "name": "commits", "description": "" }, { "name": "pullrequests", "description": "" }, { "name": "issue_tracker", "description": "The issue resources provide functionality for getting information on\nissues in an issue tracker, creating new issues, updating them and deleting\nthem.\n\nYou can access public issues without authentication, but you can't gain access\nto private repositories' issues. By authenticating, you will get the ability\nto create issues, as well as access to updating data or deleting issues you\nhave access to." }, { "name": "wiki", "description": "" }, { "name": "downloads", "description": "" }, { "name": "snippets", "description": "" }, { "name": "webhooks", "description": "Webhooks provide a way to configure Bitbucket Cloud to make requests to\nyour server (or another external service) whenever certain events occur in\nBitbucket Cloud.\n\nA webhook consists of:\n\n* A subject -- The resource that generates the events. Currently, this resource\n is the repository, user account, or team where you create the webhook.\n* One or more event -- The default event is a repository push, but you can\n select multiple events that can trigger the webhook.\n* A URL -- The endpoint where you want Bitbucket to send the event payloads\n when a matching event happens.\n\nThere are two parts to getting a webhook to work: creating the webhook and\ntriggering the webhook. After you create a webhook for an event, every time\nthat event occurs, Bitbucket sends a payload request that describes the event\nto the specified URL. Thus, you can think of webhooks as a kind of\nnotification system.\n\nUse webhooks to integrate applications with Bitbucket Cloud. The following\nuse cases provides examples of when you would want to use webhooks:\n\n* Every time a user pushes commits in a repository, you may want to notify\n your CI server to start a build.\n* Every time a user pushes commits or creates a pull request, you may want to\n display a notification in your application.\n" }, { "name": "commitstatuses", "description": "Commit statuses provide a way to tag commits with meta data,\nlike automated build results.\n" }, { "name": "branchrestrictions", "description": "Repository owners and administrators can set branch management\nrules on a repository that control what can be pushed by whom.\nThrough these rules, you can enforce a project or team\nworkflow. For example, owners or administrators can:\n\n* Limit push powers\n* Prevent branch (bookmark) deletion\n* Prevent history re-writes (Git only)\n" }, { "name": "projects", "description": "Bitbucket Cloud projects make it easier for teams to focus on\na goal, product, or process by organizing their repositories.\n" }, { "name": "pipelines", "description": "Bitbucket Pipelines brings continuous delivery to Bitbucket\nCloud, empowering teams with full branching to deployment\nvisibility and faster feedback loops.\n" }, { "name": "deployments", "description": "Teams are deploying code faster than ever, thanks to continuous\ndelivery practices and tools like Bitbucket Pipelines. Bitbucket\nDeployments gives teams visibility into their deployment\nenvironments and helps teams to track how far changes have\nprogressed in their deployment pipeline.\n" } ], "securityDefinitions": { "basic": { "type": "basic", "description": "Basic HTTP Authentication as per [RFC-2617](https://tools.ietf.org/html/rfc2617) (Digest not supported). Note that Basic Auth with username and password as credentials is only available on accounts that have 2-factor-auth / 2-step-verification disabled. If you use 2fa, you should authenticate using OAuth2 instead." }, "api_key": { "description": "API Keys can be used as Basic HTTP Authentication credentials and provide a substitute for the account's actual username and password. API Keys are only available to team accounts and there is only 1 key per account. API Keys do not support scopes and have therefore access to all contents of the account.", "type": "apiKey", "name": "Authorization", "in": "header" }, "oauth2": { "scopes": { "wiki": "Read and modify your repositories' wikis", "pullrequest:write": "Read and modify your repositories and their pull requests", "pipeline:variable": "Access your repositories' build pipelines and configure their variables", "project:write": "Read and modify your workspace's project settings, and read and transfer repositories within your workspace's projects", "pipeline:write": "Access and rerun your repositories' build pipelines", "snippet": "Read your snippets", "repository:delete": "Delete your repositories", "repository:write": "Read and modify your repositories", "issue": "Read your repositories' issues", "email": "Read your account's primary email address", "repository": "Read your repositories", "issue:write": "Read and modify your repositories' issues", "webhook": "Read and modify your repositories' webhooks", "pipeline": "Access your repositories' build pipelines", "snippet:write": "Read and modify your snippets", "account": "Read your account information", "repository:admin": "Administer your repositories", "pullrequest": "Read your repositories and their pull requests", "project": "Read your workspace's project settings and read repositories contained within your workspace's projects", "team": "Read your team membership information", "team:write": "Read and modify your team membership information", "account:write": "Read and modify your account information" }, "tokenUrl": "https://bitbucket.org/site/oauth2/access_token", "description": "OAuth 2 as per [RFC-6749](https://tools.ietf.org/html/rfc6749).", "flow": "accessCode", "type": "oauth2", "authorizationUrl": "https://bitbucket.org/site/oauth2/authorize" } }, "x-revision": "b7921b3f3b21", "host": "api.bitbucket.org", "swagger": "2.0", "definitions": { "paginated_files": { "type": "object", "description": "A paginated list of commit_file objects.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/commit_file" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "paginated_repository_permissions": { "type": "object", "description": "A paginated list of repository permissions.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/repository_permission" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "pipeline_image": { "type": "object", "description": "The definition of a Docker image that can be used for a Bitbucket Pipelines step execution context.", "properties": { "name": { "type": "string", "description": "The name of the image. If the image is hosted on DockerHub the short name can be used, otherwise the fully qualified name is required here." }, "username": { "type": "string", "description": "The username needed to authenticate with the Docker registry. Only required when using a private Docker image." }, "password": { "type": "string", "description": "The password needed to authenticate with the Docker registry. Only required when using a private Docker image." }, "email": { "type": "string", "description": "The email needed to authenticate with the Docker registry. Only required when using a private Docker image." } } }, "pipeline_ref_target": { "allOf": [ { "$ref": "#/definitions/pipeline_target" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines reference target.", "properties": { "ref_type": { "enum": [ "branch", "tag", "named_branch", "bookmark" ], "type": "string", "description": "The type of reference (branch/tag)." }, "ref_name": { "type": "string", "description": "The name of the reference." }, "commit": { "$ref": "#/definitions/commit" }, "selector": { "$ref": "#/definitions/pipeline_selector" } } } ] }, "paginated_repositories": { "type": "object", "description": "A paginated list of repositories.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/repository" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "deployment_state_completed_status_successful": { "allOf": [ { "$ref": "#/definitions/deployment_state_completed_status" }, { "additionalProperties": true, "type": "object", "description": "A SUCCESSFUL completed deployment status.", "properties": { "name": { "enum": [ "SUCCESSFUL" ], "type": "string", "description": "The name of the completed deployment status (SUCCESSFUL)." } } } ] }, "subject_types": { "type": "object", "description": "The mapping of resource/subject types pointing to their individual event types.", "properties": { "repository": { "type": "object", "properties": { "events": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "user": { "type": "object", "properties": { "events": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "team": { "type": "object", "properties": { "events": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false } }, "additionalProperties": false }, "pipeline_state_completed_expired": { "allOf": [ { "$ref": "#/definitions/pipeline_state_completed_result" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines EXPIRED pipeline result.", "properties": { "name": { "enum": [ "EXPIRED" ], "type": "string", "description": "The name of the stopped result (EXPIRED)." } } } ] }, "paginated_projects": { "type": "object", "description": "A paginated list of projects", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/project" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "search_content_match": { "type": "object", "properties": { "lines": { "type": "array", "readOnly": true, "items": { "$ref": "#/definitions/search_line" } } } }, "pullrequest_merge_parameters": { "type": "object", "description": "The metadata that describes a pull request merge.", "properties": { "type": { "type": "string" }, "message": { "type": "string", "description": "The commit message that will be used on the resulting commit." }, "close_source_branch": { "type": "boolean", "description": "Whether the source branch should be deleted. If this is not provided, we fallback to the value used when the pull request was created, which defaults to False" }, "merge_strategy": { "type": "string", "description": "The merge strategy that will be used to merge the pull request.", "enum": [ "merge_commit", "squash", "fast_forward" ], "default": "merge_commit" } }, "required": [ "type" ], "additionalProperties": true }, "pipeline_step_state_pending": { "allOf": [ { "$ref": "#/definitions/pipeline_step_state" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines PENDING pipeline step state.", "properties": { "name": { "enum": [ "PENDING" ], "type": "string", "description": "The name of pipeline step state (PENDING)." } } } ] }, "pipelines_ddev_pipeline_step": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A step of a Bitbucket pipeline. This represents the actual result of the step execution." } ], "x-bb-default-fields": [ "uuid" ], "x-bb-url": "/rest/1.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/pipelines/{pipeline.uuid}/steps/{uuid}" }, "group": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A group object", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "html": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "owner": { "$ref": "#/definitions/account" }, "workspace": { "$ref": "#/definitions/workspace" }, "name": { "type": "string" }, "slug": { "type": "string", "description": "The \"sluggified\" version of the group's name. This contains only ASCII\ncharacters and can therefore be slightly different than the name" }, "full_slug": { "type": "string", "description": "The concatenation of the workspace's slug and the group's slug,\nseparated with a colon (e.g. `acme:developers`)\n" } }, "additionalProperties": true } ] }, "paginated_milestones": { "type": "object", "description": "A paginated list of issue tracker milestones.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/milestone" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "paginated_pipeline_variables": { "type": "object", "description": "A paged list of variables.", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/pipeline_variable" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "pipeline_step_state_completed_stopped": { "allOf": [ { "$ref": "#/definitions/pipeline_step_state_completed_result" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines STOPPED pipeline step result.", "properties": { "name": { "enum": [ "STOPPED" ], "type": "string", "description": "The name of the result (STOPPED)" } } } ] }, "pipeline_schedule_execution_executed": { "allOf": [ { "$ref": "#/definitions/pipeline_schedule_execution" }, { "additionalProperties": true, "type": "object", "description": "A Pipelines executed schedule execution.", "properties": { "pipeline": { "$ref": "#/definitions/pipeline", "description": "The pipeline that was triggered by this execution of a schedule." } } } ] }, "paginated_deploy_keys": { "type": "object", "description": "A paginated list of deploy keys.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/deploy_key" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "pipeline_ssh_public_key": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Pipelines known host public key.", "properties": { "key_type": { "type": "string", "description": "The type of the public key." }, "key": { "type": "string", "description": "The base64 encoded public key." }, "md5_fingerprint": { "type": "string", "description": "The MD5 fingerprint of the public key." }, "sha256_fingerprint": { "type": "string", "description": "The SHA-256 fingerprint of the public key." } } } ] }, "paginated_pipeline_steps": { "type": "object", "description": "A paged list of pipeline steps.", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/pipeline_step" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "paginated_team_permissions": { "type": "object", "description": "A paginated list of team permissions.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/team_permission" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "deployment_environment": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Deployment Environment.", "properties": { "uuid": { "type": "string", "description": "The UUID identifying the environment." }, "name": { "type": "string", "description": "The name of the environment." } } } ], "x-bb-default-fields": [ "uuid" ], "x-bb-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments/{uuid}" }, "deployment_state_completed_status_stopped": { "allOf": [ { "$ref": "#/definitions/deployment_state_completed_status" }, { "additionalProperties": true, "type": "object", "description": "A STOPPED completed deployment status.", "properties": { "name": { "enum": [ "STOPPED" ], "type": "string", "description": "The name of the completed deployment status (STOPPED)." } } } ] }, "paginated_environments": { "type": "object", "description": "A paged list of environments", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/deployment_environment" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "report_annotation": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A report for a commit.", "properties": { "external_id": { "type": "string", "required": true, "description": "ID of the annotation provided by the annotation creator. It can be used to identify the annotation as an alternative to it's generated uuid. It is not used by Bitbucket, but only by the annotation creator for updating or deleting this specific annotation. Needs to be unique." }, "uuid": { "type": "string", "description": "The UUID that can be used to identify the annotation." }, "annotation_type": { "enum": [ "VULNERABILITY", "CODE_SMELL", "BUG" ], "type": "string", "description": "The type of the report." }, "path": { "type": "string", "description": "The path of the file on which this annotation should be placed. This is the path of the file relative to the git repository. If no path is provided, then it will appear in the overview modal on all pull requests where the tip of the branch is the given commit, regardless of which files were modified." }, "line": { "type": "integer", "description": "The line number that the annotation should belong to. If no line number is provided, then it will default to 0 and in a pull request it will appear at the top of the file specified by the path field.", "minimum": 1 }, "summary": { "type": "string", "required": true, "description": "The message to display to users." }, "details": { "type": "string", "description": "The details to show to users when clicking on the annotation." }, "result": { "enum": [ "PASSED", "FAILED", "SKIPPED", "IGNORED" ], "type": "string", "description": "The state of the report. May be set to PENDING and later updated." }, "severity": { "enum": [ "CRITICAL", "HIGH", "MEDIUM", "LOW" ], "type": "string", "description": "The severity of the annotation." }, "link": { "type": "string", "format": "uri", "description": "A URL linking to the annotation in an external tool." }, "created_on": { "type": "string", "format": "date-time", "description": "The timestamp when the report was created." }, "updated_on": { "type": "string", "format": "date-time", "description": "The timestamp when the report was updated." } } } ], "x-bb-default-fields": [ "uuid" ], "x-bb-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/commits/{commit.hash}/reports/{reportUuid}/annotations/{uuid}" }, "deployment": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Deployment.", "properties": { "uuid": { "type": "string", "description": "The UUID identifying the deployment." }, "state": { "$ref": "#/definitions/deployment_state" }, "environment": { "$ref": "#/definitions/deployment_environment", "description": "A deployment environment." }, "release": { "$ref": "#/definitions/deployment_release", "description": "The release associated with this deployment." } } } ] }, "report": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A report for a commit.", "properties": { "uuid": { "type": "string", "description": "The UUID that can be used to identify the report." }, "title": { "type": "string", "required": true, "description": "The title of the report." }, "details": { "type": "string", "required": true, "description": "A string to describe the purpose of the report." }, "external_id": { "type": "string", "required": true, "description": "ID of the report provided by the report creator. It can be used to identify the report as an alternative to it's generated uuid. It is not used by Bitbucket, but only by the report creator for updating or deleting this specific report. Needs to be unique." }, "reporter": { "type": "string", "description": "A string to describe the tool or company who created the report." }, "link": { "type": "string", "format": "uri", "description": "A URL linking to the results of the report in an external tool." }, "remote_link_enabled": { "type": "boolean", "description": "If enabled, a remote link is created in Jira for the issue associated with the commit the report belongs to." }, "logo_url": { "type": "string", "format": "uri", "description": "A URL to the report logo. If none is provided, the default insights logo will be used." }, "report_type": { "enum": [ "SECURITY", "COVERAGE", "TEST", "BUG" ], "type": "string", "description": "The type of the report." }, "result": { "enum": [ "PASSED", "FAILED", "PENDING" ], "type": "string", "description": "The state of the report. May be set to PENDING and later updated." }, "data": { "type": "array", "items": { "$ref": "#/definitions/report_data" }, "description": "An array of data fields to display information on the report. Maximum 10." }, "created_on": { "type": "string", "format": "date-time", "description": "The timestamp when the report was created." }, "updated_on": { "type": "string", "format": "date-time", "description": "The timestamp when the report was updated." } } } ], "x-bb-default-fields": [ "uuid", "commitHash" ], "x-bb-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/commits/{commitHash}/reports/{uuid}" }, "pipeline_step_state_completed_error": { "allOf": [ { "$ref": "#/definitions/pipeline_step_state_completed_result" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines ERROR pipeline step result.", "properties": { "name": { "enum": [ "ERROR" ], "type": "string", "description": "The name of the result (ERROR)" }, "error": { "$ref": "#/definitions/pipeline_step_error", "description": "An error result of a completed state of a Bitbucket Pipeline step." } } } ] }, "pipeline_step_state_completed_failed": { "allOf": [ { "$ref": "#/definitions/pipeline_step_state_completed_result" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines FAILED pipeline step result.", "properties": { "name": { "enum": [ "FAILED" ], "type": "string", "description": "The name of the result (FAILED)" } } } ] }, "issue_job_status": { "type": "object", "description": "The status of an import or export job", "properties": { "type": { "type": "string" }, "status": { "type": "string", "description": "The status of the import/export job", "enum": [ "ACCEPTED", "STARTED", "RUNNING", "FAILURE" ] }, "phase": { "type": "string", "description": "The phase of the import/export job" }, "total": { "type": "integer", "description": "The total number of issues being imported/exported" }, "count": { "type": "integer", "description": "The total number of issues already imported/exported" }, "pct": { "type": "number", "description": "The percentage of issues already imported/exported", "minimum": 0, "maximum": 100 } }, "additionalProperties": false }, "commit_comment": { "allOf": [ { "$ref": "#/definitions/comment" }, { "type": "object", "description": "A commit comment.", "properties": { "commit": { "$ref": "#/definitions/commit" } }, "additionalProperties": true } ] }, "issue": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "An issue.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "html": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "comments": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "attachments": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "watch": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "vote": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "id": { "type": "integer" }, "repository": { "$ref": "#/definitions/repository" }, "title": { "type": "string" }, "reporter": { "$ref": "#/definitions/user" }, "assignee": { "$ref": "#/definitions/user" }, "created_on": { "type": "string", "format": "date-time" }, "updated_on": { "type": "string", "format": "date-time" }, "edited_on": { "type": "string", "format": "date-time" }, "state": { "type": "string", "enum": [ "new", "open", "resolved", "on hold", "invalid", "duplicate", "wontfix", "closed" ] }, "kind": { "type": "string", "enum": [ "bug", "enhancement", "proposal", "task" ] }, "priority": { "type": "string", "enum": [ "trivial", "minor", "major", "critical", "blocker" ] }, "milestone": { "$ref": "#/definitions/milestone" }, "version": { "$ref": "#/definitions/version" }, "component": { "$ref": "#/definitions/component" }, "votes": { "type": "integer" }, "content": { "type": "object", "properties": { "raw": { "type": "string", "description": "The text as it was typed by a user." }, "markup": { "type": "string", "description": "The type of markup language the raw content is to be interpreted in.", "enum": [ "markdown", "creole", "plaintext" ] }, "html": { "type": "string", "description": "The user's content rendered as HTML." } }, "additionalProperties": false } }, "additionalProperties": true } ] }, "deployment_state_completed_status_failed": { "allOf": [ { "$ref": "#/definitions/deployment_state_completed_status" }, { "additionalProperties": true, "type": "object", "description": "A FAILED completed deployment status.", "properties": { "name": { "enum": [ "FAILED" ], "type": "string", "description": "The name of the completed deployment status (FAILED)." } } } ] }, "pullrequest": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A pull request object.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "html": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "commits": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "approve": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "diff": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "diffstat": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "comments": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "activity": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "merge": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "decline": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "id": { "type": "integer", "description": "The pull request's unique ID. Note that pull request IDs are only unique within their associated repository." }, "title": { "type": "string", "description": "Title of the pull request." }, "rendered": { "type": "object", "properties": { "title": { "type": "object", "properties": { "raw": { "type": "string", "description": "The text as it was typed by a user." }, "markup": { "type": "string", "description": "The type of markup language the raw content is to be interpreted in.", "enum": [ "markdown", "creole", "plaintext" ] }, "html": { "type": "string", "description": "The user's content rendered as HTML." } }, "additionalProperties": false }, "description": { "type": "object", "properties": { "raw": { "type": "string", "description": "The text as it was typed by a user." }, "markup": { "type": "string", "description": "The type of markup language the raw content is to be interpreted in.", "enum": [ "markdown", "creole", "plaintext" ] }, "html": { "type": "string", "description": "The user's content rendered as HTML." } }, "additionalProperties": false }, "reason": { "type": "object", "properties": { "raw": { "type": "string", "description": "The text as it was typed by a user." }, "markup": { "type": "string", "description": "The type of markup language the raw content is to be interpreted in.", "enum": [ "markdown", "creole", "plaintext" ] }, "html": { "type": "string", "description": "The user's content rendered as HTML." } }, "additionalProperties": false } }, "additionalProperties": false }, "summary": { "type": "object", "properties": { "raw": { "type": "string", "description": "The text as it was typed by a user." }, "markup": { "type": "string", "description": "The type of markup language the raw content is to be interpreted in.", "enum": [ "markdown", "creole", "plaintext" ] }, "html": { "type": "string", "description": "The user's content rendered as HTML." } }, "additionalProperties": false }, "state": { "type": "string", "description": "The pull request's current status.", "enum": [ "MERGED", "SUPERSEDED", "OPEN", "DECLINED" ] }, "author": { "$ref": "#/definitions/account" }, "source": { "$ref": "#/definitions/pullrequest_endpoint" }, "destination": { "$ref": "#/definitions/pullrequest_endpoint" }, "merge_commit": { "type": "object", "properties": { "hash": { "type": "string", "pattern": "[0-9a-f]{7,}?" } }, "additionalProperties": false }, "comment_count": { "type": "integer", "description": "The number of comments for a specific pull request.", "minimum": 0 }, "task_count": { "type": "integer", "description": "The number of open tasks for a specific pull request.", "minimum": 0 }, "close_source_branch": { "type": "boolean", "description": "A boolean flag indicating if merging the pull request closes the source branch." }, "closed_by": { "$ref": "#/definitions/account" }, "reason": { "type": "string", "description": "Explains why a pull request was declined. This field is only applicable to pull requests in rejected state." }, "created_on": { "type": "string", "description": "The ISO8601 timestamp the request was created.", "format": "date-time" }, "updated_on": { "type": "string", "description": "The ISO8601 timestamp the request was last updated.", "format": "date-time" }, "reviewers": { "type": "array", "description": "The list of users that were added as reviewers on this pull request when it was created. For performance reasons, the API only includes this list on a pull request's `self` URL.", "items": { "$ref": "#/definitions/account" } }, "participants": { "type": "array", "description": " The list of users that are collaborating on this pull request.\n Collaborators are user that:\n\n * are added to the pull request as a reviewer (part of the reviewers\n list)\n * are not explicit reviewers, but have commented on the pull request\n * are not explicit reviewers, but have approved the pull request\n\n Each user is wrapped in an object that indicates the user's role and\n whether they have approved the pull request. For performance reasons,\n the API only returns this list when an API requests a pull request by\n id.\n ", "items": { "$ref": "#/definitions/participant" } } }, "additionalProperties": true } ] }, "issue_comment": { "allOf": [ { "$ref": "#/definitions/comment" }, { "type": "object", "description": "A issue comment.", "properties": { "issue": { "$ref": "#/definitions/issue" } }, "additionalProperties": true } ] }, "paginated_snippet_comments": { "type": "object", "description": "A paginated list of snippet comments.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/snippet_comment" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "pipeline_step_state_completed_successful": { "allOf": [ { "$ref": "#/definitions/pipeline_step_state_completed_result" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines SUCCESSFUL pipeline step result.", "properties": { "name": { "enum": [ "SUCCESSFUL" ], "type": "string", "description": "The name of the result (SUCCESSFUL)" } } } ] }, "team": { "allOf": [ { "$ref": "#/definitions/account" }, { "type": "object", "description": "A team object.", "properties": {}, "additionalProperties": true } ] }, "export_options": { "type": "object", "description": "Options for issue export.", "properties": { "type": { "type": "string" }, "project_key": { "type": "string" }, "project_name": { "type": "string" }, "send_email": { "type": "boolean" }, "include_attachments": { "type": "boolean" } }, "required": [ "type" ], "additionalProperties": true }, "paginated_snippets": { "type": "object", "description": "A paginated list of snippets.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/snippet" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "paginated_pipeline_schedules": { "type": "object", "description": "A paged list of schedules", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/pipeline_schedule" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "branching_model_settings": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A repository's branching model settings", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "branch_types": { "type": "array", "items": { "type": "object", "properties": { "enabled": { "type": "boolean", "description": "Whether the branch type is enabled or not. A disabled branch type may contain an invalid `prefix`." }, "kind": { "type": "string", "description": "The kind of the branch type.", "enum": [ "feature", "bugfix", "release", "hotfix" ] }, "prefix": { "type": "string", "description": "The prefix for this branch type. A branch with this prefix will be classified as per `kind`. The `prefix` of an enabled branch type must be a valid branch prefix.Additionally, it cannot be blank, empty or `null`. The `prefix` for a disabled branch type can be empty or invalid." } }, "required": [ "kind" ], "additionalProperties": false }, "minItems": 0, "maxItems": 4, "uniqueItems": true }, "development": { "type": "object", "properties": { "is_valid": { "type": "boolean", "description": "Indicates if the configured branch is valid, that is, if the configured branch actually exists currently. Is always `true` when `use_mainbranch` is `true` (even if the main branch does not exist). This field is read-only. This field is ignored when updating/creating settings." }, "name": { "type": "string", "description": "The configured branch. It must be `null` when `use_mainbranch` is `true`. Otherwise it must be a non-empty value. It is possible for the configured branch to not exist (e.g. it was deleted after the settings are set). In this case `is_valid` will be `false`. The branch must exist when updating/setting the `name` or an error will occur." }, "use_mainbranch": { "type": "boolean", "description": "Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`). When `true` the `name` must be `null` or not provided. When `false` the `name` must contain a non-empty branch name." } }, "additionalProperties": false }, "production": { "type": "object", "properties": { "is_valid": { "type": "boolean", "description": "Indicates if the configured branch is valid, that is, if the configured branch actually exists currently. Is always `true` when `use_mainbranch` is `true` (even if the main branch does not exist). This field is read-only. This field is ignored when updating/creating settings." }, "name": { "type": "string", "description": "The configured branch. It must be `null` when `use_mainbranch` is `true`. Otherwise it must be a non-empty value. It is possible for the configured branch to not exist (e.g. it was deleted after the settings are set). In this case `is_valid` will be `false`. The branch must exist when updating/setting the `name` or an error will occur." }, "use_mainbranch": { "type": "boolean", "description": "Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`). When `true` the `name` must be `null` or not provided. When `false` the `name` must contain a non-empty branch name." }, "enabled": { "type": "boolean", "description": "Indicates if branch is enabled or not." } }, "additionalProperties": false } }, "additionalProperties": true } ] }, "pipeline_state_in_progress_stage": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A result of an in progress pipeline state.", "properties": {} } ] }, "deployment_state_completed": { "allOf": [ { "$ref": "#/definitions/deployment_state" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Deployment COMPLETED deployment state.", "properties": { "name": { "enum": [ "COMPLETED" ], "type": "string", "description": "The name of deployment state (COMPLETED)." }, "url": { "type": "string", "format": "uri", "description": "Link to the deployment result." }, "deployer": { "$ref": "#/definitions/account", "description": "The Bitbucket account that was used to perform the deployment." }, "status": { "$ref": "#/definitions/deployment_state_completed_status", "description": "The status of the completed deployment." }, "start_date": { "type": "string", "format": "date-time", "description": "The timestamp when the deployment was started." }, "completion_date": { "type": "string", "format": "date-time", "description": "The timestamp when the deployment completed." } } } ] }, "pipeline_step_state_ready": { "allOf": [ { "$ref": "#/definitions/pipeline_step_state" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines READY pipeline step state.", "properties": { "name": { "enum": [ "READY" ], "type": "string", "description": "The name of pipeline step state (READY)." } } } ] }, "paginated_issue_comments": { "type": "object", "description": "A paginated list of issue comments.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/issue_comment" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "pipeline_known_host": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Pipelines known host.", "properties": { "uuid": { "type": "string", "description": "The UUID identifying the known host." }, "hostname": { "type": "string", "description": "The hostname of the known host." }, "public_key": { "$ref": "#/definitions/pipeline_ssh_public_key", "description": "The public key of the known host." } } } ] }, "pipeline_state_completed_stopped": { "allOf": [ { "$ref": "#/definitions/pipeline_state_completed_result" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines STOPPED pipeline result.", "properties": { "name": { "enum": [ "STOPPED" ], "type": "string", "description": "The name of the stopped result (STOPPED)." } } } ] }, "pipeline_state_completed": { "allOf": [ { "$ref": "#/definitions/pipeline_state" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines COMPLETED pipeline state.", "properties": { "name": { "enum": [ "COMPLETED" ], "type": "string", "description": "The name of pipeline state (COMPLETED)." }, "result": { "$ref": "#/definitions/pipeline_state_completed_result", "description": "A result of a completed state of a pipeline." } } } ] }, "paginated_ssh_user_keys": { "type": "object", "description": "A paginated list of SSH keys.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/ssh_account_key" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "pipeline_schedule_execution_errored": { "allOf": [ { "$ref": "#/definitions/pipeline_schedule_execution" }, { "additionalProperties": true, "type": "object", "description": "A Pipelines schedule execution that failed to be executed.", "properties": { "error": { "$ref": "#/definitions/pipeline_error", "description": "The error that caused the execution to fail." } } } ] }, "team_permission": { "type": "object", "description": "A user's permission for a given team.", "properties": { "type": { "type": "string" }, "permission": { "type": "string", "enum": [ "admin", "collaborator", "member" ] }, "user": { "$ref": "#/definitions/user" }, "team": { "$ref": "#/definitions/team" } }, "required": [ "type" ], "additionalProperties": true }, "jira_site": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Jira Site." } ], "x-bb-default-fields": [ "type", "cloudId", "cloudUrl", "cloudName" ], "x-bb-detail-fields": [ "connected" ], "x-bb-url": "/api/{target_user.uuid}/jira/sites/{cloudId}?atlassian_account_id={user.account_id}" }, "paginated_log_entries": { "type": "object", "description": "A paginated list of issue changes.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/issue_change" }, "minItems": 0 } }, "additionalProperties": false }, "pipelines_config": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "The Pipelines configuration for a repository.", "properties": { "enabled": { "type": "boolean", "description": "Whether Pipelines is enabled for the repository." }, "repository": { "$ref": "#/definitions/repository" } } } ] }, "version": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A version as defined in a repository's issue tracker.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "name": { "type": "string" }, "id": { "type": "integer" } }, "additionalProperties": true } ] }, "paginated_branches": { "type": "object", "description": "A paginated list of branches.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/branch" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "paginated_commit_comments": { "type": "object", "description": "A paginated list of commit comments.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/commit_comment" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "ref": { "type": "object", "description": "A ref object, representing a branch or tag in a repository.", "properties": { "type": { "type": "string" }, "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "commits": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "html": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "name": { "type": "string", "description": "The name of the ref." }, "target": { "$ref": "#/definitions/commit" } }, "required": [ "type" ], "additionalProperties": true }, "webhook_subscription": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A Webhook subscription.", "properties": { "uuid": { "type": "string", "description": "The webhook's id" }, "url": { "type": "string", "description": "The URL events get delivered to.", "format": "uri" }, "description": { "type": "string", "description": "A user-defined description of the webhook." }, "subject_type": { "type": "string", "description": "The type of entity, which is `repository` in the case of webhook subscriptions on repositories.", "enum": [ "workspace", "user", "repository", "team" ] }, "subject": { "$ref": "#/definitions/object" }, "active": { "type": "boolean" }, "created_at": { "type": "string", "format": "date-time" }, "events": { "type": "array", "description": "The events this webhook is subscribed to.", "items": { "type": "string", "enum": [ "pullrequest:unapproved", "issue:comment_created", "pullrequest:approved", "repo:created", "repo:deleted", "repo:imported", "pullrequest:comment_updated", "issue:updated", "project:updated", "pullrequest:comment_created", "repo:commit_status_updated", "pullrequest:updated", "issue:created", "repo:fork", "pullrequest:comment_deleted", "repo:commit_status_created", "repo:updated", "pullrequest:rejected", "pullrequest:fulfilled", "repo:push", "pullrequest:created", "repo:transfer", "repo:commit_comment_created" ] }, "minItems": 1, "uniqueItems": true } }, "additionalProperties": true } ] }, "pipeline_variable": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Pipelines variable.", "properties": { "uuid": { "type": "string", "description": "The UUID identifying the variable." }, "key": { "type": "string", "description": "The unique name of the variable." }, "value": { "type": "string", "description": "The value of the variable. If the variable is secured, this will be empty." }, "secured": { "type": "boolean", "description": "If true, this variable will be treated as secured. The value will never be exposed in the logs or the REST API." } } } ] }, "repository": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A Bitbucket repository.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "html": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "avatar": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "pullrequests": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "commits": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "forks": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "watchers": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "downloads": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "clone": { "type": "array", "items": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "hooks": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "uuid": { "type": "string", "description": "The repository's immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user." }, "full_name": { "type": "string", "description": "The concatenation of the repository owner's username and the slugified name, e.g. \"evzijst/interruptingcow\". This is the same string used in Bitbucket URLs." }, "is_private": { "type": "boolean" }, "parent": { "$ref": "#/definitions/repository" }, "scm": { "type": "string", "enum": [ "hg", "git" ] }, "owner": { "$ref": "#/definitions/account" }, "name": { "type": "string" }, "description": { "type": "string" }, "created_on": { "type": "string", "format": "date-time" }, "updated_on": { "type": "string", "format": "date-time" }, "size": { "type": "integer" }, "language": { "type": "string" }, "has_issues": { "type": "boolean" }, "has_wiki": { "type": "boolean" }, "fork_policy": { "type": "string", "description": "\nControls the rules for forking this repository.\n\n* **allow_forks**: unrestricted forking\n* **no_public_forks**: restrict forking to private forks (forks cannot\n be made public later)\n* **no_forks**: deny all forking\n", "enum": [ "allow_forks", "no_public_forks", "no_forks" ] }, "project": { "$ref": "#/definitions/project" }, "mainbranch": { "$ref": "#/definitions/branch" } }, "additionalProperties": true } ] }, "snippet_commit": { "allOf": [ { "$ref": "#/definitions/base_commit" }, { "type": "object", "description": "", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "html": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "diff": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "snippet": { "$ref": "#/definitions/snippet" } }, "additionalProperties": true } ] }, "pipeline_state_in_progress_paused": { "allOf": [ { "$ref": "#/definitions/pipeline_state_in_progress_stage" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines PAUSED stage of a pipeline that is in progress.", "properties": { "name": { "enum": [ "PAUSED" ], "type": "string", "description": "The name of the stage (PAUSED)" } } } ] }, "search_line": { "type": "object", "properties": { "line": { "type": "integer", "format": "int32", "readOnly": true }, "segments": { "type": "array", "readOnly": true, "items": { "$ref": "#/definitions/search_segment" } } } }, "pipeline_error": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "An error causing a pipeline failure.", "properties": { "key": { "type": "string", "description": "The error key." }, "message": { "type": "string", "description": "The error message." } } } ] }, "component": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A component as defined in a repository's issue tracker.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "name": { "type": "string" }, "id": { "type": "integer" } }, "additionalProperties": true } ] }, "base_commit": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "The common base type for both repository and snippet commits.", "properties": { "hash": { "type": "string", "pattern": "[0-9a-f]{7,}?" }, "date": { "type": "string", "format": "date-time" }, "author": { "$ref": "#/definitions/author" }, "message": { "type": "string" }, "summary": { "type": "object", "properties": { "raw": { "type": "string", "description": "The text as it was typed by a user." }, "markup": { "type": "string", "description": "The type of markup language the raw content is to be interpreted in.", "enum": [ "markdown", "creole", "plaintext" ] }, "html": { "type": "string", "description": "The user's content rendered as HTML." } }, "additionalProperties": false }, "parents": { "type": "array", "items": { "$ref": "#/definitions/base_commit" }, "minItems": 0 } }, "additionalProperties": true } ] }, "pipeline_step_state_completed_expired": { "allOf": [ { "$ref": "#/definitions/pipeline_step_state_completed_result" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines EXPIRED pipeline step result.", "properties": { "name": { "enum": [ "EXPIRED" ], "type": "string", "description": "The name of the result (EXPIRED)" } } } ] }, "deployment_release": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Deployment Release.", "properties": { "uuid": { "type": "string", "description": "The UUID identifying the release." }, "name": { "type": "string", "description": "The name of the release." }, "url": { "type": "string", "format": "uri", "description": "Link to the pipeline that produced the release." }, "commit": { "$ref": "#/definitions/commit", "description": "The commit associated with this release." }, "created_on": { "type": "string", "format": "date-time", "description": "The timestamp when the release was created." } } } ] }, "pipeline_schedule_execution": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Pipelines schedule execution.", "properties": {} } ] }, "search_segment": { "type": "object", "properties": { "text": { "type": "string", "readOnly": true }, "match": { "type": "boolean", "readOnly": true } } }, "paginated_issue_attachments": { "type": "object", "description": "A paginated list of issue attachments.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/issue_attachment" }, "minItems": 0 } }, "additionalProperties": false }, "pipeline_step_state_completed": { "allOf": [ { "$ref": "#/definitions/pipeline_step_state" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines COMPLETED pipeline step state.", "properties": { "name": { "enum": [ "COMPLETED" ], "type": "string", "description": "The name of pipeline step state (COMPLETED)." }, "result": { "$ref": "#/definitions/pipeline_step_state_completed_result", "description": "A result of a completed state of a pipeline step." } } } ] }, "pipeline_schedule": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Pipelines schedule.", "properties": { "uuid": { "type": "string", "description": "The UUID identifying the schedule." }, "enabled": { "type": "boolean", "description": "Whether the schedule is enabled." }, "target": { "$ref": "#/definitions/pipeline_target", "description": "The target on which the schedule will be executed." }, "selector": { "$ref": "#/definitions/pipeline_selector" }, "cron_pattern": { "type": "string", "description": "The cron expression that the schedule applies." }, "created_on": { "type": "string", "format": "date-time", "description": "The timestamp when the schedule was created." }, "updated_on": { "type": "string", "format": "date-time", "description": "The timestamp when the schedule was updated." } } } ] }, "branching_model": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A repository's branching model", "properties": { "branch_types": { "type": "array", "description": "The active branch types.", "items": { "type": "object", "properties": { "kind": { "type": "string", "description": "The kind of branch.", "enum": [ "feature", "bugfix", "release", "hotfix" ] }, "prefix": { "type": "string", "description": "The prefix for this branch type. A branch with this prefix will be classified as per `kind`. The prefix must be a valid prefix for a branch and must always exist. It cannot be blank, empty or `null`." } }, "required": [ "kind", "prefix" ], "additionalProperties": false }, "minItems": 0, "maxItems": 4, "uniqueItems": true }, "development": { "type": "object", "properties": { "branch": { "$ref": "#/definitions/branch" }, "name": { "type": "string", "description": "Name of the target branch. Will be listed here even when the target branch does not exist. Will be `null` if targeting the main branch and the repository is empty." }, "use_mainbranch": { "type": "boolean", "description": "Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`)." } }, "required": [ "name", "use_mainbranch" ], "additionalProperties": false }, "production": { "type": "object", "properties": { "branch": { "$ref": "#/definitions/branch" }, "name": { "type": "string", "description": "Name of the target branch. Will be listed here even when the target branch does not exist. Will be `null` if targeting the main branch and the repository is empty." }, "use_mainbranch": { "type": "boolean", "description": "Indicates if the setting points at an explicit branch (`false`) or tracks the main branch (`true`)." } }, "required": [ "name", "use_mainbranch" ], "additionalProperties": false } }, "additionalProperties": true } ] }, "pipeline_step_state_completed_not_run": { "allOf": [ { "$ref": "#/definitions/pipeline_step_state_completed_result" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines NOT_RUN pipeline step result.", "properties": { "name": { "enum": [ "NOT_RUN" ], "type": "string", "description": "The name of the result (NOT_RUN)" } } } ] }, "issue_attachment": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "An issue file attachment's meta data. Note this does not contain the file's actual contents.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "name": { "type": "string" } }, "additionalProperties": true } ] }, "paginated_teams": { "type": "object", "description": "A paginated list of teams.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/team" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "pipeline_trigger_manual": { "allOf": [ { "$ref": "#/definitions/pipeline_trigger" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines MANUAL trigger.", "properties": {} } ] }, "pipeline_cache_content_uri": { "type": "object", "description": "A representation of the location of pipeline cache content.", "properties": { "uri": { "type": "string", "format": "uri", "description": "The uri for pipeline cache content." } } }, "ssh_account_key": { "allOf": [ { "$ref": "#/definitions/ssh_key" }, { "type": "object", "description": "Represents an SSH public key for a user.", "properties": { "owner": { "$ref": "#/definitions/account" } }, "additionalProperties": true } ] }, "pipeline_state_pending": { "allOf": [ { "$ref": "#/definitions/pipeline_state" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines PENDING pipeline state.", "properties": { "name": { "enum": [ "PENDING" ], "type": "string", "description": "The name of pipeline state (PENDING)." } } } ] }, "commit": { "allOf": [ { "$ref": "#/definitions/base_commit" }, { "type": "object", "description": "A repository commit object.", "properties": { "repository": { "$ref": "#/definitions/repository" }, "participants": { "type": "array", "items": { "$ref": "#/definitions/participant" }, "minItems": 0 } }, "additionalProperties": true } ] }, "deploy_key": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "Represents deploy key for a repository.", "properties": { "key": { "type": "string", "description": "The deploy key value." }, "repository": { "$ref": "#/definitions/repository" }, "comment": { "type": "string", "description": "The comment parsed from the deploy key (if present)" }, "label": { "type": "string", "description": "The user-defined label for the deploy key" }, "added_on": { "type": "string", "format": "date-time" }, "last_used": { "type": "string", "format": "date-time" }, "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "owner": { "$ref": "#/definitions/account" } }, "additionalProperties": true } ] }, "paginated_deployment_variable": { "type": "object", "description": "A paged list of deployment variables.", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/deployment_variable" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "paginated_pipeline_caches": { "type": "object", "description": "A paged list of pipeline caches", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/pipeline_cache" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "comment": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "The base type for all comments. This type should be considered abstract. Each of the \"commentable\" resources defines its own subtypes (e.g. `issue_comment`).", "properties": { "id": { "type": "integer" }, "created_on": { "type": "string", "format": "date-time" }, "updated_on": { "type": "string", "format": "date-time" }, "content": { "type": "object", "properties": { "raw": { "type": "string", "description": "The text as it was typed by a user." }, "markup": { "type": "string", "description": "The type of markup language the raw content is to be interpreted in.", "enum": [ "markdown", "creole", "plaintext" ] }, "html": { "type": "string", "description": "The user's content rendered as HTML." } }, "additionalProperties": false }, "user": { "$ref": "#/definitions/user" }, "deleted": { "type": "boolean" }, "parent": { "$ref": "#/definitions/comment" }, "inline": { "type": "object", "properties": { "to": { "type": "integer", "description": "The comment's anchor line in the new version of the file. If the 'from' line is also provided, this value will be removed.", "minimum": 1 }, "from": { "type": "integer", "description": "The comment's anchor line in the old version of the file.", "minimum": 1 }, "path": { "type": "string", "description": "The path of the file this comment is anchored to." } }, "required": [ "path" ], "additionalProperties": false }, "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "html": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "code": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false } }, "additionalProperties": true } ] }, "paginated_pullrequest_comments": { "type": "object", "description": "A paginated list of pullrequest comments.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/pullrequest_comment" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "deployments_ddev_deployment_environment": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Deployment Environment." } ], "x-bb-default-fields": [ "uuid" ], "x-bb-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments/{uuid}" }, "paginated_pipeline_schedule_executions": { "type": "object", "description": "A paged list of the executions of a schedule.", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/pipeline_schedule_execution" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "paginated_annotations": { "type": "object", "description": "A paginated list of annotations.", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/report_annotation" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "pipeline_target": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A representation of the target that a pipeline executes on.", "properties": {} } ] }, "pipeline_state_completed_result": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A result of a completed pipeline state.", "properties": {} } ] }, "pipeline_state_in_progress": { "allOf": [ { "$ref": "#/definitions/pipeline_state" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines IN_PROGRESS pipeline state.", "properties": { "name": { "enum": [ "IN_PROGRESS" ], "type": "string", "description": "The name of pipeline state (IN_PROGRESS)." }, "stage": { "$ref": "#/definitions/pipeline_state_in_progress_stage", "description": "A stage of an in progress state of a pipeline." } } } ] }, "deployment_state_completed_status": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "The status of a completed deployment.", "properties": {} } ] }, "report_data": { "type": "object", "description": "A key-value element that will be displayed along with the report.", "properties": { "type": { "enum": [ "BOOLEAN", "DATE", "DURATION", "LINK", "NUMBER", "PERCENTAGE", "TEXT" ], "type": "string", "description": "The type of data contained in the value field. If not provided, then the value will be detected as a boolean, number or string." }, "title": { "type": "string", "description": "A string describing what this data field represents." }, "value": { "type": "object", "description": "The value of the data element." } } }, "pipeline_step_error": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "An error causing a step failure.", "properties": { "key": { "type": "string", "description": "The error key." }, "message": { "type": "string", "description": "The error message." } } } ] }, "issue_change": { "type": "object", "description": "An issue change.", "properties": { "type": { "type": "string" }, "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "issue": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "name": { "type": "string" }, "created_on": { "type": "string", "format": "date-time" }, "user": { "$ref": "#/definitions/user" }, "issue": { "$ref": "#/definitions/issue" }, "changes": { "type": "object", "properties": { "assignee": { "type": "object", "properties": { "old": { "type": "string" }, "new": { "type": "string" } }, "additionalProperties": false }, "state": { "type": "object", "properties": { "old": { "type": "string" }, "new": { "type": "string" } }, "additionalProperties": false }, "title": { "type": "object", "properties": { "old": { "type": "string" }, "new": { "type": "string" } }, "additionalProperties": false }, "kind": { "type": "object", "properties": { "old": { "type": "string" }, "new": { "type": "string" } }, "additionalProperties": false }, "milestone": { "type": "object", "properties": { "old": { "type": "string" }, "new": { "type": "string" } }, "additionalProperties": false }, "component": { "type": "object", "properties": { "old": { "type": "string" }, "new": { "type": "string" } }, "additionalProperties": false }, "priority": { "type": "object", "properties": { "old": { "type": "string" }, "new": { "type": "string" } }, "additionalProperties": false }, "version": { "type": "object", "properties": { "old": { "type": "string" }, "new": { "type": "string" } }, "additionalProperties": false }, "content": { "type": "object", "properties": { "old": { "type": "string" }, "new": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "message": { "type": "object", "properties": { "raw": { "type": "string", "description": "The text as it was typed by a user." }, "markup": { "type": "string", "description": "The type of markup language the raw content is to be interpreted in.", "enum": [ "markdown", "creole", "plaintext" ] }, "html": { "type": "string", "description": "The user's content rendered as HTML." } }, "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": true }, "repository_permission": { "type": "object", "description": "A user's permission for a given repository.", "properties": { "type": { "type": "string" }, "permission": { "type": "string", "enum": [ "admin", "write", "read" ] }, "user": { "$ref": "#/definitions/user" }, "repository": { "$ref": "#/definitions/repository" } }, "required": [ "type" ], "additionalProperties": true }, "pipeline_commit_target": { "allOf": [ { "$ref": "#/definitions/pipeline_target" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines commit target.", "properties": { "commit": { "$ref": "#/definitions/commit" }, "selector": { "$ref": "#/definitions/pipeline_selector" } } } ] }, "paginated_diffstats": { "type": "object", "description": "A paginated list of diffstats.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/diffstat" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "paginated_pipelines": { "type": "object", "description": "A paged list of pipelines", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/pipeline" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "pipeline_state_completed_successful": { "allOf": [ { "$ref": "#/definitions/pipeline_state_completed_result" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines SUCCESSFUL pipeline result.", "properties": { "name": { "enum": [ "SUCCESSFUL" ], "type": "string", "description": "The name of the successful result (SUCCESSFUL)." } } } ] }, "paginated_deployments": { "type": "object", "description": "A paged list of deployments", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/deployment" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "pullrequest_endpoint": { "type": "object", "properties": { "repository": { "$ref": "#/definitions/repository" }, "branch": { "type": "object", "properties": { "name": { "type": "string" }, "merge_strategies": { "type": "array", "description": "Available merge strategies, when this endpoint is the destination of the pull request.", "items": { "type": "string", "enum": [ "merge_commit", "squash", "fast_forward" ] } }, "default_merge_strategy": { "type": "string", "description": "The default merge strategy, when this endpoint is the destination of the pull request." } }, "additionalProperties": false }, "commit": { "type": "object", "properties": { "hash": { "type": "string", "pattern": "[0-9a-f]{7,}?" } }, "additionalProperties": false } }, "additionalProperties": false }, "pipeline_state": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "The representation of the progress state of a pipeline.", "properties": {} } ] }, "jira_project": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Jira Project." } ], "x-bb-default-fields": [ "type", "cloudId", "id" ], "x-bb-detail-fields": [ "key", "name", "url", "avatarUrls.*", "site" ], "x-bb-url": "/api/{target_user.uuid}/jira/sites/{cloudId}/projects/{id}?atlassian_account_id={user.account_id}" }, "paginated_pullrequests": { "type": "object", "description": "A paginated list of pullrequests.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/pullrequest" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "pipeline_step": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A step of a Bitbucket pipeline. This represents the actual result of the step execution.", "properties": { "uuid": { "type": "string", "description": "The UUID identifying the step." }, "started_on": { "type": "string", "format": "date-time", "description": "The timestamp when the step execution was started. This is not set when the step hasn't executed yet." }, "completed_on": { "type": "string", "format": "date-time", "description": "The timestamp when the step execution was completed. This is not set if the step is still in progress." }, "state": { "$ref": "#/definitions/pipeline_step_state", "description": "The current state of the step" }, "image": { "$ref": "#/definitions/pipeline_image", "description": "The Docker image used as the build container for the step." }, "setup_commands": { "type": "array", "items": { "$ref": "#/definitions/pipeline_command" }, "description": "The list of commands that are executed as part of the setup phase of the build. These commands are executed outside the build container." }, "script_commands": { "type": "array", "items": { "$ref": "#/definitions/pipeline_command" }, "description": "The list of build commands. These commands are executed in the build container." } } } ], "x-bb-default-fields": [ "uuid" ], "x-bb-url": "/rest/1.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/pipelines/{pipeline.uuid}/steps/{uuid}" }, "search_code_search_result": { "type": "object", "properties": { "type": { "type": "string", "readOnly": true }, "content_match_count": { "type": "integer", "format": "int64", "readOnly": true }, "content_matches": { "type": "array", "readOnly": true, "items": { "$ref": "#/definitions/search_content_match" } }, "path_matches": { "type": "array", "readOnly": true, "items": { "$ref": "#/definitions/search_segment" } }, "file": { "readOnly": true, "$ref": "#/definitions/commit_file" } } }, "paginated_branchrestrictions": { "type": "object", "description": "A paginated list of branch restriction rules.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/branchrestriction" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "workspace_membership": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A Bitbucket workspace membership.\n Links a user to a workspace.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "user": { "$ref": "#/definitions/account" }, "workspace": { "$ref": "#/definitions/workspace" } }, "additionalProperties": true } ] }, "deployment_variable": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Pipelines deployment variable.", "properties": { "uuid": { "type": "string", "description": "The UUID identifying the variable." }, "key": { "type": "string", "description": "The unique name of the variable." }, "value": { "type": "string", "description": "The value of the variable. If the variable is secured, this will be empty." }, "secured": { "type": "boolean", "description": "If true, this variable will be treated as secured. The value will never be exposed in the logs or the REST API." } } } ] }, "pipeline": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipeline. This represents an actual pipeline result.", "properties": { "uuid": { "type": "string", "description": "The UUID identifying the pipeline." }, "build_number": { "type": "integer", "description": "The build number of the pipeline." }, "creator": { "$ref": "#/definitions/account", "description": "The Bitbucket account that was used to create the pipeline." }, "repository": { "$ref": "#/definitions/repository" }, "target": { "$ref": "#/definitions/pipeline_target", "description": "The target that the pipeline built." }, "trigger": { "$ref": "#/definitions/pipeline_trigger", "description": "The trigger used for the pipeline." }, "state": { "$ref": "#/definitions/pipeline_state" }, "created_on": { "type": "string", "format": "date-time", "description": "The timestamp when the pipeline was created." }, "completed_on": { "type": "string", "format": "date-time", "description": "The timestamp when the Pipeline was completed. This is not set if the pipeline is still in progress." }, "build_seconds_used": { "type": "integer", "description": "The number of build seconds used by this pipeline." } } } ] }, "paginated_issues": { "type": "object", "description": "A paginated list of issues.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/issue" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "commitstatus": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A commit status object.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "commit": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "uuid": { "type": "string", "description": "The commit status' id." }, "key": { "type": "string", "description": "An identifier for the status that's unique to\n its type (current \"build\" is the only supported type) and the vendor,\n e.g. BB-DEPLOY" }, "refname": { "type": "string", "description": "\nThe name of the ref that pointed to this commit at the time the status\nobject was created. Note that this the ref may since have moved off of\nthe commit. This optional field can be useful for build systems whose\nbuild triggers and configuration are branch-dependent (e.g. a Pipeline\nbuild).\nIt is legitimate for this field to not be set, or even apply (e.g. a\nstatic linting job)." }, "url": { "type": "string", "description": "A URL linking back to the vendor or build system, for providing more information about whatever process produced this status. Accepts context variables `repository` and `commit` that Bitbucket will evaluate at runtime whenever at runtime. For example, one could use https://foo.com/builds/{repository.full_name} which Bitbucket will turn into https://foo.com/builds/foo/bar at render time." }, "state": { "type": "string", "description": "Provides some indication of the status of this commit", "enum": [ "SUCCESSFUL", "FAILED", "INPROGRESS", "STOPPED" ] }, "name": { "type": "string", "description": "An identifier for the build itself, e.g. BB-DEPLOY-1" }, "description": { "type": "string", "description": "A description of the build (e.g. \"Unit tests in Bamboo\")" }, "created_on": { "type": "string", "format": "date-time" }, "updated_on": { "type": "string", "format": "date-time" } }, "additionalProperties": true } ] }, "paginated_reports": { "type": "object", "description": "A paginated list of reports.", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/report" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "search_result_page": { "type": "object", "properties": { "size": { "type": "integer", "format": "int64", "readOnly": true }, "page": { "type": "integer", "format": "int32", "readOnly": true }, "pagelen": { "type": "integer", "format": "int32", "readOnly": true }, "query_substituted": { "type": "boolean", "readOnly": true }, "next": { "type": "string", "format": "uri", "readOnly": true }, "previous": { "type": "string", "format": "uri", "readOnly": true }, "values": { "type": "array", "readOnly": true, "items": { "$ref": "#/definitions/search_code_search_result" } } } }, "account": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "An account object.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "html": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "avatar": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "followers": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "following": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "repositories": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "username": { "type": "string", "pattern": "^[a-zA-Z0-9_\\-]+$" }, "nickname": { "type": "string", "description": "Account name defined by the owner. Should be used instead of the \"username\" field. Note that \"nickname\" cannot be used in place of \"username\" in URLs and queries, as \"nickname\" is not guaranteed to be unique." }, "account_status": { "type": "string", "description": "The status of the account. Currently the only possible value is \"active\", but more values may be added in the future." }, "display_name": { "type": "string" }, "website": { "type": "string" }, "created_on": { "type": "string", "format": "date-time" }, "uuid": { "type": "string" }, "has_2fa_enabled": { "type": "boolean" } }, "additionalProperties": true } ] }, "deployment_state_in_progress": { "allOf": [ { "$ref": "#/definitions/deployment_state" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Deployment IN_PROGRESS deployment state.", "properties": { "name": { "enum": [ "IN_PROGRESS" ], "type": "string", "description": "The name of deployment state (IN_PROGRESS)." }, "url": { "type": "string", "format": "uri", "description": "Link to the deployment result." }, "deployer": { "$ref": "#/definitions/account", "description": "The Bitbucket account that was used to perform the deployment." }, "start_date": { "type": "string", "format": "date-time", "description": "The timestamp when the deployment was started." } } } ] }, "paginated_commitstatuses": { "type": "object", "description": "A paginated list of commit status objects.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/commitstatus" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "pipeline_state_in_progress_running": { "allOf": [ { "$ref": "#/definitions/pipeline_state_in_progress_stage" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines RUNNING stage of a pipeline that is in progress.", "properties": { "name": { "enum": [ "RUNNING" ], "type": "string", "description": "The name of the stage (RUNNING)" } } } ] }, "paginated_refs": { "type": "object", "description": "A paginated list of refs.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/ref" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "paginated_snippet_commit": { "type": "object", "description": "A paginated list of snippet commits.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/snippet_commit" }, "minItems": 0 } }, "additionalProperties": false }, "branchrestriction": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A branch restriction rule.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "id": { "type": "integer", "description": "The branch restriction status' id." }, "kind": { "type": "string", "description": "The type of restriction that is being applied.", "enum": [ "require_tasks_to_be_completed", "force", "restrict_merges", "enforce_merge_checks", "reset_pullrequest_changes_requested_on_change", "require_approvals_to_merge", "allow_auto_merge_when_builds_pass", "delete", "require_all_dependencies_merged", "require_no_changes_requested", "push", "require_passing_builds_to_merge", "reset_pullrequest_approvals_on_change", "require_default_reviewer_approvals_to_merge" ] }, "branch_match_kind": { "type": "string", "description": "Indicates how the restriction is matched against a branch. The default is `glob`.", "enum": [ "branching_model", "glob" ] }, "branch_type": { "type": "string", "description": "Apply the restriction to branches of this type. Active when `branch_match_kind` is `branching_model`. The branch type will be calculated using the branching model configured for the repository.", "enum": [ "feature", "bugfix", "release", "hotfix", "development", "production" ] }, "pattern": { "type": "string", "description": "Apply the restriction to branches that match this pattern. Active when `branch_match_kind` is `glob`. Will be empty when `branch_match_kind` is `branching_model`." }, "users": { "type": "array", "items": { "$ref": "#/definitions/account" }, "minItems": 0 }, "groups": { "type": "array", "items": { "$ref": "#/definitions/group" }, "minItems": 0 }, "value": { "type": "integer", "description": "Value with kind-specific semantics: \"require_approvals_to_merge\" uses it to require a minimum number of approvals on a PR; \"require_default_reviewer_approvals_to_merge\" uses it to require a minimum number of approvals from default reviewers on a PR; \"require_passing_builds_to_merge\" uses it to require a minimum number of passing builds." } }, "required": [ "kind", "branch_match_kind", "pattern" ], "additionalProperties": true } ] }, "pipeline_step_state_completed_result": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A result of a completed pipeline step state.", "properties": {} } ] }, "pipeline_trigger": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A representation of the trigger used for a pipeline.", "properties": {} } ] }, "project": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A Bitbucket project.\n Projects are used by teams to organize repositories.", "properties": { "links": { "type": "object", "properties": { "html": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "avatar": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "uuid": { "type": "string", "description": "The project's immutable id." }, "key": { "type": "string", "description": "The project's key." }, "owner": { "$ref": "#/definitions/team" }, "name": { "type": "string", "description": "The name of the project." }, "description": { "type": "string" }, "is_private": { "type": "boolean", "description": "\nIndicates whether the project is publicly accessible, or whether it is\nprivate to the team and consequently only visible to team members.\nNote that private projects cannot contain public repositories." }, "created_on": { "type": "string", "format": "date-time" }, "updated_on": { "type": "string", "format": "date-time" } }, "additionalProperties": true } ] }, "error": { "type": "object", "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`.", "properties": { "type": { "type": "string" }, "error": { "type": "object", "properties": { "message": { "type": "string" }, "detail": { "type": "string" }, "data": { "type": "object", "description": "Optional structured data that is endpoint-specific.", "properties": {}, "additionalProperties": true } }, "required": [ "message" ], "additionalProperties": false } }, "required": [ "type" ], "additionalProperties": true }, "paginated_hook_events": { "type": "object", "description": "A paginated list of webhook types available to subscribe on.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/hook_event" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "diffstat": { "type": "object", "description": "A diffstat object that includes a summary of changes made to a file between two commits.", "properties": { "type": { "type": "string" }, "status": { "type": "string", "enum": [ "added", "removed", "modified", "renamed" ] }, "lines_added": { "type": "integer" }, "lines_removed": { "type": "integer" }, "old": { "$ref": "#/definitions/commit_file" }, "new": { "$ref": "#/definitions/commit_file" } }, "required": [ "type" ], "additionalProperties": true }, "pullrequest_comment": { "allOf": [ { "$ref": "#/definitions/comment" }, { "type": "object", "description": "A pullrequest comment.", "properties": { "pullrequest": { "$ref": "#/definitions/pullrequest" } }, "additionalProperties": true } ] }, "tag": { "allOf": [ { "$ref": "#/definitions/ref" }, { "type": "object", "description": "A tag object, representing a tag in a repository.", "properties": { "message": { "type": "string", "description": "The message associated with the tag, if available." }, "date": { "type": "string", "description": "The date that the tag was created, if available", "format": "date-time" }, "tagger": { "$ref": "#/definitions/author" } }, "additionalProperties": true } ] }, "ddev_report": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A report for a commit." } ], "x-bb-default-fields": [ "uuid", "commitHash" ], "x-bb-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/commits/{commitHash}/reports/{uuid}" }, "paginated_workspace_memberships": { "type": "object", "description": "A paginated list of workspace memberships.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/workspace_membership" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "paginated_treeentries": { "type": "object", "description": "A paginated list of commit_file and/or commit_directory objects.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/treeentry" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "participant": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "Object describing a user's role on resources like commits or pull requests.", "properties": { "user": { "$ref": "#/definitions/user" }, "role": { "type": "string", "enum": [ "PARTICIPANT", "REVIEWER" ] }, "approved": { "type": "boolean" }, "state": { "type": "string", "enum": [ "approved", "changes_requested", null ] }, "participated_on": { "type": "string", "description": "The ISO8601 timestamp of the participant's action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.", "format": "date-time" } }, "additionalProperties": true } ] }, "paginated_versions": { "type": "object", "description": "A paginated list of issue tracker versions.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/version" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "pipeline_step_state": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "The representation of the progress state of a pipeline step.", "properties": {} } ] }, "author": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "The author of a change in a repository", "properties": { "raw": { "type": "string", "description": "The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket." }, "user": { "$ref": "#/definitions/account" } }, "additionalProperties": true } ] }, "commit_file": { "type": "object", "description": "A file object, representing a file at a commit in a repository", "properties": { "type": { "type": "string" }, "path": { "type": "string", "description": "The path in the repository" }, "commit": { "$ref": "#/definitions/commit" }, "attributes": { "type": "string", "enum": [ "link", "executable", "subrepository", "binary", "lfs" ] }, "escaped_path": { "type": "string", "description": "The escaped version of the path as it appears in a diff. If the path does not require escaping this will be the same as path." } }, "required": [ "type" ], "additionalProperties": true }, "deployments_stg_west_deployment_environment": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Deployment Environment." } ], "x-bb-default-fields": [ "uuid" ], "x-bb-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/environments/{uuid}" }, "snippet": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A snippet object.", "properties": { "id": { "type": "integer", "minimum": 0 }, "title": { "type": "string" }, "scm": { "type": "string", "description": "The DVCS used to store the snippet.", "enum": [ "hg", "git" ] }, "created_on": { "type": "string", "format": "date-time" }, "updated_on": { "type": "string", "format": "date-time" }, "owner": { "$ref": "#/definitions/account" }, "creator": { "$ref": "#/definitions/account" }, "is_private": { "type": "boolean" } }, "additionalProperties": true } ] }, "hook_event": { "type": "object", "description": "An event, associated with a resource or subject type.", "properties": { "event": { "type": "string", "description": "The event identifier.", "enum": [ "pullrequest:unapproved", "issue:comment_created", "pullrequest:approved", "repo:created", "repo:deleted", "repo:imported", "pullrequest:comment_updated", "issue:updated", "project:updated", "pullrequest:comment_created", "repo:commit_status_updated", "pullrequest:updated", "issue:created", "repo:fork", "pullrequest:comment_deleted", "repo:commit_status_created", "repo:updated", "pullrequest:rejected", "pullrequest:fulfilled", "repo:push", "pullrequest:created", "repo:transfer", "repo:commit_comment_created" ] }, "category": { "type": "string", "description": "The category this event belongs to." }, "label": { "type": "string", "description": "Summary of the webhook event type." }, "description": { "type": "string", "description": "More detailed description of the webhook event type." } }, "additionalProperties": false }, "branch": { "allOf": [ { "$ref": "#/definitions/ref" }, { "type": "object", "description": "A branch object, representing a branch in a repository.", "properties": {}, "additionalProperties": true } ] }, "page": { "type": "object", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" } }, "additionalProperties": false }, "deployment_state_undeployed": { "allOf": [ { "$ref": "#/definitions/deployment_state" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Deployment UNDEPLOYED deployment state.", "properties": { "name": { "enum": [ "UNDEPLOYED" ], "type": "string", "description": "The name of deployment state (UNDEPLOYED)." }, "trigger_url": { "type": "string", "format": "uri", "description": "Link to trigger the deployment." } } } ] }, "pipeline_command": { "type": "object", "description": "An executable pipeline command.", "properties": { "name": { "type": "string", "description": "The name of the command." }, "command": { "type": "string", "description": "The executable command." } } }, "pipeline_state_completed_error": { "allOf": [ { "$ref": "#/definitions/pipeline_state_completed_result" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines ERROR pipeline result.", "properties": { "name": { "enum": [ "ERROR" ], "type": "string", "description": "The name of the result (ERROR)" }, "error": { "$ref": "#/definitions/pipeline_error", "description": "An error result of a completed state of a Bitbucket Pipeline." } } } ] }, "milestone": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A milestone as defined in a repository's issue tracker.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "name": { "type": "string" }, "id": { "type": "integer" } }, "additionalProperties": true } ] }, "object": { "type": "object", "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`.", "properties": { "type": { "type": "string" } }, "required": [ "type" ], "additionalProperties": true, "discriminator": "type" }, "pipeline_step_state_in_progress": { "allOf": [ { "$ref": "#/definitions/pipeline_step_state" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines IN_PROGRESS pipeline step state.", "properties": { "name": { "enum": [ "IN_PROGRESS" ], "type": "string", "description": "The name of pipeline step state (IN_PROGRESS)." } } } ] }, "ssh_key": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "Base type for representing SSH public keys.", "properties": { "uuid": { "type": "string", "description": "The SSH key's immutable ID." }, "key": { "type": "string", "description": "The SSH public key value in OpenSSH format." }, "comment": { "type": "string", "description": "The comment parsed from the SSH key (if present)" }, "label": { "type": "string", "description": "The user-defined label for the SSH key" }, "created_on": { "type": "string", "format": "date-time" }, "last_used": { "type": "string", "format": "date-time" }, "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false } }, "additionalProperties": true } ] }, "paginated_components": { "type": "object", "description": "A paginated list of issue tracker components.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/component" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "user": { "allOf": [ { "$ref": "#/definitions/account" }, { "type": "object", "description": "A user object.", "properties": { "is_staff": { "type": "boolean" }, "account_id": { "type": "string", "description": "The user's Atlassian account ID." } }, "additionalProperties": true } ] }, "paginated_webhook_subscriptions": { "type": "object", "description": "A paginated list of webhook subscriptions", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/webhook_subscription" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "pipelines_stg_west_pipeline_step": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A step of a Bitbucket pipeline. This represents the actual result of the step execution." } ], "x-bb-default-fields": [ "uuid" ], "x-bb-url": "/rest/1.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/pipelines/{pipeline.uuid}/steps/{uuid}" }, "snippet_comment": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A comment on a snippet.", "properties": { "links": { "type": "object", "properties": { "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "html": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "snippet": { "$ref": "#/definitions/snippet" } }, "additionalProperties": true } ] }, "deployment_state": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "The representation of the progress state of a deployment.", "properties": {} } ] }, "pipeline_build_number": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Pipelines build number.", "properties": { "next": { "type": "integer", "description": "The next number that will be used as build number." } } } ] }, "pipeline_state_completed_failed": { "allOf": [ { "$ref": "#/definitions/pipeline_state_completed_result" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines FAILED pipeline result.", "properties": { "name": { "enum": [ "FAILED" ], "type": "string", "description": "The name of the failed result (FAILED)." } } } ] }, "paginated_users": { "type": "object", "description": "A paginated list of users.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/user" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "paginated_pipeline_known_hosts": { "type": "object", "description": "A paged list of known hosts.", "properties": { "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses." }, "values": { "type": "array", "minItems": 0, "items": { "$ref": "#/definitions/pipeline_known_host" }, "description": "The values of the current page." }, "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute." }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values." }, "next": { "type": "string", "format": "uri", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs." }, "previous": { "type": "string", "format": "uri", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs." } } }, "pipeline_ssh_key_pair": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A Pipelines SSH key pair.", "properties": { "private_key": { "type": "string", "description": "The SSH private key. This value will be empty when retrieving the SSH key pair." }, "public_key": { "type": "string", "description": "The SSH public key." } } } ] }, "paginated_workspaces": { "type": "object", "description": "A paginated list of workspaces.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/workspace" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "pipeline_cache": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A representation of metadata for a pipeline cache for given repository.", "properties": { "uuid": { "type": "string", "description": "The UUID identifying the pipeline cache." }, "pipeline_uuid": { "type": "string", "description": "The UUID of the pipeline that created the cache." }, "step_uuid": { "type": "string", "description": "The uuid of the step that created the cache." }, "name": { "type": "string", "description": "The name of the cache." }, "path": { "type": "string", "description": "The path where the cache contents were retrieved from." }, "file_size_bytes": { "type": "integer", "description": "The size of the file containing the archive of the cache." }, "created_on": { "type": "string", "format": "date-time", "description": "The timestamp when the cache was created." } } } ] }, "paginated_tags": { "type": "object", "description": "A paginated list of tags.", "properties": { "size": { "type": "integer", "description": "Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.", "minimum": 0 }, "page": { "type": "integer", "description": "Page number of the current results. This is an optional element that is not provided in all responses.", "minimum": 1 }, "pagelen": { "type": "integer", "description": "Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.", "minimum": 1 }, "next": { "type": "string", "description": "Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "previous": { "type": "string", "description": "Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.", "format": "uri" }, "values": { "type": "array", "items": { "$ref": "#/definitions/tag" }, "minItems": 0, "uniqueItems": true } }, "additionalProperties": false }, "workspace": { "allOf": [ { "$ref": "#/definitions/object" }, { "type": "object", "description": "A Bitbucket workspace.\n Workspaces are used to organize repositories.", "properties": { "links": { "type": "object", "properties": { "avatar": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "html": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "members": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "owners": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "projects": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "repositories": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "snippets": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false }, "self": { "type": "object", "properties": { "href": { "type": "string", "format": "uri" }, "name": { "type": "string" } }, "additionalProperties": false } }, "additionalProperties": false }, "uuid": { "type": "string", "description": "The workspace's immutable id." }, "name": { "type": "string", "description": "The name of the workspace." }, "slug": { "type": "string", "description": "The short label that identifies this workspace." }, "is_private": { "type": "boolean", "description": "Indicates whether the workspace is publicly accessible, or whether it is\nprivate to the members and consequently only visible to members.\nNote that private workspaces cannot contain public repositories." }, "created_on": { "type": "string", "format": "date-time" }, "updated_on": { "type": "string", "format": "date-time" } }, "additionalProperties": true } ] }, "pipeline_selector": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A representation of the selector that was used to identify the pipeline in the YML file.", "properties": { "type": { "enum": [ "branches", "tags", "bookmarks", "default", "custom" ], "type": "string", "description": "The type of selector." }, "pattern": { "type": "string", "description": "The name of the matching pipeline definition." } } } ] }, "stg_west_report": { "allOf": [ { "$ref": "#/definitions/object" }, { "additionalProperties": true, "type": "object", "description": "A report for a commit." } ], "x-bb-default-fields": [ "uuid", "commitHash" ], "x-bb-url": "/rest/2.0/accounts/{target_user.uuid}/repositories/{repository.uuid}/commits/{commitHash}/reports/{uuid}" }, "pipeline_trigger_push": { "allOf": [ { "$ref": "#/definitions/pipeline_trigger" }, { "additionalProperties": true, "type": "object", "description": "A Bitbucket Pipelines PUSH trigger.", "properties": {} } ] }, "treeentry": { "type": "object", "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`.", "properties": { "type": { "type": "string" }, "path": { "type": "string", "description": "The path in the repository" }, "commit": { "$ref": "#/definitions/commit" } }, "required": [ "type" ], "additionalProperties": true } }, "paths": { "/addon": { "delete": { "responses": { "204": { "description": "Request has succeeded. The application has been deleted for the user." }, "401": { "description": "No authorization.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "Improper authentication.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the application for the user.\n\nThis endpoint is intended to be used by Bitbucket Connect apps\nand only supports JWT authentication -- that is how Bitbucket\nidentifies the particular installation of the app. Developers\nwith applications registered in the \"Develop Apps\" section\nof Bitbucket Marketplace need not use this endpoint as\nupdates for those applications can be sent out via the\nUI of that section.\n\n```\n$ curl -X DELETE https://api.bitbucket.org/2.0/addon \\\n -H \"Authorization: JWT \"\n```", "parameters": [], "tags": [ "addon" ] }, "put": { "responses": { "204": { "description": "Request has succeeded. The installation has been updated to the new descriptor." }, "400": { "description": "Scopes have increased or decreased to none.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "No authorization.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "Improper authentication.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates the application installation for the user.\n\nThis endpoint is intended to be used by Bitbucket Connect apps\nand only supports JWT authentication -- that is how Bitbucket\nidentifies the particular installation of the app. Developers\nwith applications registered in the \"Develop Apps\" section\nof Bitbucket Marketplace need not use this endpoint as\nupdates for those applications can be sent out via the\nUI of that section.\n\nA new, valid descriptor must be provided in the body of the\nPUT request.\n\n```\n$ curl -X PUT https://api.bitbucket.org/2.0/addon \\\n -H \"Authorization: JWT \" \\\n --header \"Content-Type: application/json\" \\\n --data '{\"descriptor\": $NEW_DESCRIPTOR}'\n```\n\nNote that the scopes of the application cannot be increased\nin the new descriptor nor reduced to none.", "parameters": [], "tags": [ "addon" ] }, "parameters": [] }, "/addon/linkers": { "get": { "responses": { "200": { "description": "Successful." }, "401": { "description": "Authentication must use app JWT", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Gets a list of all [linkers](/cloud/bitbucket/modules/linker/)\nfor the authenticated application.", "parameters": [], "tags": [ "addon" ] }, "parameters": [] }, "/addon/linkers/{linker_key}": { "get": { "responses": { "200": { "description": "Successful." }, "401": { "description": "Authentication must use app JWT", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The linker does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Gets a [linker](/cloud/bitbucket/modules/linker/) specified by `linker_key`\nfor the authenticated application.", "parameters": [], "tags": [ "addon" ] }, "parameters": [ { "name": "linker_key", "in": "path", "description": "The unique key of a [linker module](/cloud/bitbucket/modules/linker/)\nas defined in an application descriptor.", "required": true, "type": "string" } ] }, "/addon/linkers/{linker_key}/values": { "delete": { "responses": { "204": { "description": "Successfully deleted the linker values." }, "401": { "description": "Authentication must use app JWT", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The linker does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Delete all [linker](/cloud/bitbucket/modules/linker/) values for the\nspecified linker of the authenticated application.", "parameters": [], "tags": [ "addon" ] }, "get": { "responses": { "200": { "description": "Successful." }, "401": { "description": "Authentication must use app JWT", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The linker does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Gets a list of all [linker](/cloud/bitbucket/modules/linker/) values for the\nspecified linker of the authenticated application.\n\nA linker value lets applications supply values to modify its regular expression.\n\nThe base regular expression must use a Bitbucket-specific match group `(?K)`\nwhich will be translated to `([\\w\\-]+)`. A value must match this pattern.\n\n[Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)", "parameters": [], "tags": [ "addon" ] }, "post": { "responses": { "201": { "description": "Successfully created the linker value." }, "401": { "description": "Authentication must use app JWT", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The linker does not exist.", "schema": { "$ref": "#/definitions/error" } }, "409": { "description": "The linker already has the value being added.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a [linker](/cloud/bitbucket/modules/linker/) value for the specified\nlinker of authenticated application.\n\nA linker value lets applications supply values to modify its regular expression.\n\nThe base regular expression must use a Bitbucket-specific match group `(?K)`\nwhich will be translated to `([\\w\\-]+)`. A value must match this pattern.\n\n[Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)", "parameters": [], "tags": [ "addon" ] }, "put": { "responses": { "204": { "description": "Successfully updated the linker values." }, "400": { "description": "Invalid input.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "Authentication must use app JWT", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The linker does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Bulk update [linker](/cloud/bitbucket/modules/linker/) values for the specified\nlinker of the authenticated application.\n\nA linker value lets applications supply values to modify its regular expression.\n\nThe base regular expression must use a Bitbucket-specific match group `(?K)`\nwhich will be translated to `([\\w\\-]+)`. A value must match this pattern.\n\n[Read more about linker values](/cloud/bitbucket/modules/linker/#usingthebitbucketapitosupplyvalues)", "parameters": [], "tags": [ "addon" ] }, "parameters": [ { "name": "linker_key", "in": "path", "description": "The unique key of a [linker module](/cloud/bitbucket/modules/linker/)\nas defined in an application descriptor.", "required": true, "type": "string" } ] }, "/addon/linkers/{linker_key}/values/{value_id}": { "delete": { "responses": { "204": { "description": "Successfully deleted the linker value." }, "401": { "description": "Authentication must use app JWT", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The linker value does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Delete a single [linker](/cloud/bitbucket/modules/linker/) value\nof the authenticated application.", "parameters": [], "tags": [ "addon" ] }, "get": { "responses": { "200": { "description": "Successful." }, "401": { "description": "Authentication must use app JWT", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The linker value does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Get a single [linker](/cloud/bitbucket/modules/linker/) value\nof the authenticated application.", "parameters": [], "tags": [ "addon" ] }, "parameters": [ { "name": "linker_key", "in": "path", "description": "The unique key of a [linker module](/cloud/bitbucket/modules/linker/)\nas defined in an application descriptor.", "required": true, "type": "string" }, { "name": "value_id", "in": "path", "description": "The numeric ID of the linker value.", "required": true, "type": "integer" } ] }, "/hook_events": { "get": { "responses": { "200": { "description": "A mapping of resource/subject types pointing to their individual event types.", "schema": { "$ref": "#/definitions/subject_types" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the webhook resource or subject types on which webhooks can\nbe registered.\n\nEach resource/subject type contains an `events` link that returns the\npaginated list of specific events each individual subject type can\nemit.\n\nThis endpoint is publicly accessible and does not require\nauthentication or scopes.\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/hook_events\n\n{\n \"repository\": {\n \"links\": {\n \"events\": {\n \"href\": \"https://api.bitbucket.org/2.0/hook_events/repository\"\n }\n }\n },\n \"team\": {\n \"links\": {\n \"events\": {\n \"href\": \"https://api.bitbucket.org/2.0/hook_events/team\"\n }\n }\n },\n \"user\": {\n \"links\": {\n \"events\": {\n \"href\": \"https://api.bitbucket.org/2.0/hook_events/user\"\n }\n }\n }\n}\n```", "parameters": [], "tags": [ "webhooks" ] }, "parameters": [] }, "/hook_events/{subject_type}": { "get": { "responses": { "200": { "description": "A paginated list of webhook types available to subscribe on.", "schema": { "$ref": "#/definitions/paginated_hook_events" } }, "404": { "description": "If an invalid `{subject_type}` value was specified.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all valid webhook events for the\nspecified entity.\n\nThis is public data that does not require any scopes or authentication.\n\nExample:\n\nNOTE: The following example is a truncated response object for the `team` `subject_type`.\nWe return the same structure for the other `subject_type` objects.\n\n```\n$ curl https://api.bitbucket.org/2.0/hook_events/team\n{\n \"page\": 1,\n \"pagelen\": 30,\n \"size\": 21,\n \"values\": [\n {\n \"category\": \"Repository\",\n \"description\": \"Whenever a repository push occurs\",\n \"event\": \"repo:push\",\n \"label\": \"Push\"\n },\n {\n \"category\": \"Repository\",\n \"description\": \"Whenever a repository fork occurs\",\n \"event\": \"repo:fork\",\n \"label\": \"Fork\"\n },\n ...\n {\n \"category\": \"Repository\",\n \"description\": \"Whenever a repository import occurs\",\n \"event\": \"repo:imported\",\n \"label\": \"Import\"\n }\n ]\n}\n```", "parameters": [], "tags": [ "webhooks" ] }, "parameters": [ { "name": "subject_type", "in": "path", "description": "A resource or subject type.", "required": true, "type": "string", "enum": [ "workspace", "user", "repository", "team" ] } ] }, "/pullrequests/{selected_user}": { "get": { "responses": { "200": { "description": "All pull requests authored by the specified user.", "schema": { "$ref": "#/definitions/paginated_pullrequests" } }, "404": { "description": "If the specified user does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all pull requests authored by the specified user.\n\nBy default only open pull requests are returned. This can be controlled\nusing the `state` query parameter. To retrieve pull requests that are\nin one of multiple states, repeat the `state` parameter for each\nindividual state.\n\nThis endpoint also supports filtering and sorting of the results. See\n[filtering and sorting](../../../../meta/filtering) for more details.", "parameters": [ { "name": "state", "in": "query", "description": "Only return pull requests that are in this state. This parameter can be repeated.", "type": "string", "enum": [ "MERGED", "SUPERSEDED", "OPEN", "DECLINED" ] } ], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "selected_user", "in": "path", "description": "This can either be the username of the pull request author, the author's UUID\nsurrounded by curly-braces, for example: `{account UUID}`, or the author's Atlassian ID.\n", "required": true, "type": "string" } ] }, "/repositories": { "get": { "responses": { "200": { "description": "All public repositories.", "schema": { "$ref": "#/definitions/paginated_repositories" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all public repositories.\n\nThis endpoint also supports filtering and sorting of the results. See\n[filtering and sorting](../meta/filtering) for more details.", "parameters": [ { "name": "after", "in": "query", "description": "Filter the results to include only repositories created on or\nafter this [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601)\n timestamp. Example: `YYYY-MM-DDTHH:mm:ss.sssZ`", "required": false, "type": "string" }, { "name": "role", "in": "query", "description": "Filters the result based on the authenticated user's role on each repository.\n\n* **member**: returns repositories to which the user has explicit read access\n* **contributor**: returns repositories to which the user has explicit write access\n* **admin**: returns repositories to which the user has explicit administrator access\n* **owner**: returns all repositories owned by the current user\n", "required": false, "type": "string", "enum": [ "admin", "contributor", "member", "owner" ] }, { "name": "q", "in": "query", "description": "Query string to narrow down the response as per [filtering and sorting](../meta/filtering).\n`role` parameter must also be specified.\n", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "Field by which the results should be sorted as per [filtering and sorting](../meta/filtering).\n", "required": false, "type": "string" } ], "tags": [ "repositories" ] }, "parameters": [] }, "/repositories/{workspace}": { "get": { "responses": { "200": { "description": "The repositories owned by the specified account.", "schema": { "$ref": "#/definitions/paginated_repositories" } }, "404": { "description": "If the specified account does not exist.", "schema": { "$ref": "#/definitions/error" } }, "410": { "description": "If the specified account marked as spam.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all repositories owned by the specified\naccount or UUID.\n\nThe result can be narrowed down based on the authenticated user's role.\n\nE.g. with `?role=contributor`, only those repositories that the\nauthenticated user has write access to are returned (this includes any\nrepo the user is an admin on, as that implies write access).\n\nThis endpoint also supports filtering and sorting of the results. See\n[filtering and sorting](../../meta/filtering) for more details.", "parameters": [ { "name": "role", "in": "query", "description": "\nFilters the result based on the authenticated user's role on each repository.\n\n* **member**: returns repositories to which the user has explicit read access\n* **contributor**: returns repositories to which the user has explicit write access\n* **admin**: returns repositories to which the user has explicit administrator access\n* **owner**: returns all repositories owned by the current user\n", "required": false, "type": "string", "enum": [ "admin", "contributor", "member", "owner" ] }, { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per [filtering and sorting](../../meta/filtering).\n", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nField by which the results should be sorted as per [filtering and sorting](../../meta/filtering).\n ", "required": false, "type": "string" } ], "tags": [ "repositories" ] }, "parameters": [ { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}": { "delete": { "responses": { "204": { "description": "Indicates successful deletion." }, "403": { "description": "If the caller either does not have admin access to the repository, or the repository is set to read-only.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:delete" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the repository. This is an irreversible operation.\n\nThis does not affect its forks.", "parameters": [ { "name": "redirect_to", "in": "query", "description": "If a repository has been moved to a new location, use this parameter to\nshow users a friendly message in the Bitbucket UI that the repository\nhas moved to a new location. However, a GET to this endpoint will still\nreturn a 404.\n", "required": false, "type": "string" } ], "tags": [ "repositories" ] }, "get": { "responses": { "200": { "description": "The repository object.", "examples": { "application/json": { "scm": "git", "website": "www.example.com", "has_wiki": false, "description": "A repository for my bits and bobs", "language": "python", "fork_policy": "allow_forks", "links": { "clone": [ { "href": "https://bitbucket.org/example-username/bits_and_bobs.git", "name": "https" }, { "href": "git@bitbucket.org:example-username/bits_and_bobs.git", "name": "ssh" } ], "watchers": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/watchers" }, "branches": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/branches" }, "tags": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/tags" }, "commits": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commits" }, "downloads": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/downloads" }, "source": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/src" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" }, "forks": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/forks" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "pullrequests": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests" } }, "name": "bits_and_bobs", "created_on": "2018-06-20T23:17:33.616037+00:00", "mainbranch": { "type": "branch", "name": "master" }, "full_name": "example-username/bits_and_bobs", "has_issues": false, "owner": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" }, "updated_on": "2018-06-20T23:17:33.616037+00:00", "size": 33348, "type": "repository", "slug": "bits_and_bobs", "is_private": true, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "schema": { "$ref": "#/definitions/repository" } }, "403": { "description": "If the repository is private and the authenticated user does not have access to it.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If no repository exists at this location.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the object describing this repository.", "parameters": [], "tags": [ "repositories" ], "produces": [ "application/json" ] }, "post": { "responses": { "200": { "description": "The newly created repository.", "examples": { "application/json": { "scm": "git", "website": "www.example.com", "has_wiki": false, "description": "A repository for my bits and bobs", "language": "python", "fork_policy": "allow_forks", "links": { "clone": [ { "href": "https://bitbucket.org/example-username/bits_and_bobs.git", "name": "https" }, { "href": "git@bitbucket.org:example-username/bits_and_bobs.git", "name": "ssh" } ], "watchers": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/watchers" }, "branches": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/branches" }, "tags": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/tags" }, "commits": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commits" }, "downloads": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/downloads" }, "source": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/src" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" }, "forks": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/forks" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "pullrequests": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests" } }, "name": "bits_and_bobs", "created_on": "2018-06-20T23:17:33.616037+00:00", "mainbranch": { "type": "branch", "name": "master" }, "full_name": "example-username/bits_and_bobs", "has_issues": false, "owner": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" }, "updated_on": "2018-06-20T23:17:33.616037+00:00", "size": 33348, "type": "repository", "slug": "bits_and_bobs", "is_private": true, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "schema": { "$ref": "#/definitions/repository" } }, "400": { "description": "If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "If the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new repository.\n\nNote: In order to set the project for the newly created repository,\npass in either the project key or the project UUID as part of the\nrequest body as shown in the examples below:\n\n```\n$ curl -X POST -H \"Content-Type: application/json\" -d '{\n \"scm\": \"git\",\n \"project\": {\n \"key\": \"MARS\"\n }\n}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding\n```\n\nor\n\n```\n$ curl -X POST -H \"Content-Type: application/json\" -d '{\n \"scm\": \"git\",\n \"project\": {\n \"key\": \"{ba516952-992a-4c2d-acbd-17d502922f96}\"\n }\n}' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding\n```\n\nThe project must be assigned for all repositories. If the project is not provided,\nthe repository is automatically assigned to the oldest project in the workspace.\n\nNote: In the examples above, the workspace ID `teamsinspace`,\nand/or the repository name `hablanding` can be replaced by UUIDs.", "parameters": [ { "name": "_body", "in": "body", "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, "schema": { "$ref": "#/definitions/repository" } } ], "tags": [ "repositories" ], "produces": [ "application/json" ] }, "put": { "responses": { "200": { "description": "The existing repository has been updated", "examples": { "application/json": { "scm": "git", "website": "www.example.com", "has_wiki": false, "description": "A repository for my bits and bobs", "language": "python", "fork_policy": "allow_forks", "links": { "clone": [ { "href": "https://bitbucket.org/example-username/bits_and_bobs.git", "name": "https" }, { "href": "git@bitbucket.org:example-username/bits_and_bobs.git", "name": "ssh" } ], "watchers": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/watchers" }, "branches": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/branches" }, "tags": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/tags" }, "commits": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commits" }, "downloads": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/downloads" }, "source": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/src" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" }, "forks": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/forks" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "pullrequests": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests" } }, "name": "bits_and_bobs", "created_on": "2018-06-20T23:17:33.616037+00:00", "mainbranch": { "type": "branch", "name": "master" }, "full_name": "example-username/bits_and_bobs", "has_issues": false, "owner": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" }, "updated_on": "2018-06-20T23:17:33.616037+00:00", "size": 33348, "type": "repository", "slug": "bits_and_bobs", "is_private": true, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "schema": { "$ref": "#/definitions/repository" }, "headers": { "Location": { "type": "string", "description": "The location of the repository. This header is only\nprovided when the repository's name is changed." } } }, "201": { "description": "A new repository has been created", "examples": { "application/json": { "scm": "git", "website": "www.example.com", "has_wiki": false, "description": "A repository for my bits and bobs", "language": "python", "fork_policy": "allow_forks", "links": { "clone": [ { "href": "https://bitbucket.org/example-username/bits_and_bobs.git", "name": "https" }, { "href": "git@bitbucket.org:example-username/bits_and_bobs.git", "name": "ssh" } ], "watchers": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/watchers" }, "branches": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/branches" }, "tags": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/tags" }, "commits": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commits" }, "downloads": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/downloads" }, "source": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/src" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" }, "forks": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/forks" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "pullrequests": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests" } }, "name": "bits_and_bobs", "created_on": "2018-06-20T23:17:33.616037+00:00", "mainbranch": { "type": "branch", "name": "master" }, "full_name": "example-username/bits_and_bobs", "has_issues": false, "owner": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" }, "updated_on": "2018-06-20T23:17:33.616037+00:00", "size": 33348, "type": "repository", "slug": "bits_and_bobs", "is_private": true, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "schema": { "$ref": "#/definitions/repository" }, "headers": { "Location": { "type": "string", "description": "The location of the newly created repository" } } }, "400": { "description": "If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "If the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Since this endpoint can be used to both update and to create a\nrepository, the request body depends on the intent.\n\n### Creation\n\nSee the POST documentation for the repository endpoint for an example\nof the request body.\n\n### Update\n\nNote: Changing the `name` of the repository will cause the location to\nbe changed. This is because the URL of the repo is derived from the\nname (a process called slugification). In such a scenario, it is\npossible for the request to fail if the newly created slug conflicts\nwith an existing repository's slug. But if there is no conflict,\nthe new location will be returned in the `Location` header of the\nresponse.", "parameters": [ { "name": "_body", "in": "body", "description": "The repository that is to be updated.\n\nNote that the elements \"owner\" and \"full_name\" are ignored since the\nURL implies them.\n", "required": false, "schema": { "$ref": "#/definitions/repository" } } ], "tags": [ "repositories" ], "produces": [ "application/json" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/branch-restrictions": { "get": { "responses": { "200": { "description": "A paginated list of branch restrictions", "schema": { "$ref": "#/definitions/paginated_branchrestrictions" } }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the authenticated user does not have admin access to the repository", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all branch restrictions on the\nrepository.", "parameters": [ { "name": "kind", "in": "query", "description": "Branch restrictions of this type", "required": false, "type": "string" }, { "name": "pattern", "in": "query", "description": "Branch restrictions applied to branches of this pattern", "required": false, "type": "string" } ], "tags": [ "branchrestrictions" ] }, "post": { "responses": { "201": { "description": "A paginated list of branch restrictions", "schema": { "$ref": "#/definitions/branchrestriction" } }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the authenticated user does not have admin access to the repository", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new branch restriction rule for a repository.\n\n`kind` describes what will be restricted. Allowed values include:\n`push`, `force`, `delete` and `restrict_merges`.\n\nDifferent kinds of branch restrictions have different requirements:\n\n* `push` and `restrict_merges` require `users` and `groups` to be\n specified. Empty lists are allowed, in which case permission is\n denied for everybody.\n* `force` can not be specified in a Mercurial repository.\n\nThe restriction applies to all branches that match. There are\ntwo ways to match a branch. It is configured in `branch_match_kind`:\n\n1. `glob`: Matches a branch against the `pattern`. A `'*'` in\n `pattern` will expand to match zero or more characters, and every\n other character matches itself. For example, `'foo*'` will match\n `'foo'` and `'foobar'`, but not `'barfoo'`. `'*'` will match all\n branches.\n2. `branching_model`: Matches a branch against the repository's\n branching model. The `branch_type` controls the type of branch\n to match. Allowed values include: `production`, `development`,\n `bugfix`, `release`, `feature` and `hotfix`.\n\nThe combination of `kind` and match must be unique. This means that\ntwo `glob` restrictions in a repository cannot have the same `kind` and\n`pattern`. Additionally, two `branching_model` restrictions in a\nrepository cannot have the same `kind` and `branch_type`.\n\n`users` and `groups` are lists of users and groups that are except from\nthe restriction. They can only be configured in `push` and\n`restrict_merges` restrictions. The `push` restriction stops a user\npushing to matching branches unless that user is in `users` or is a\nmember of a group in `groups`. The `restrict_merges` stops a user\nmerging pull requests to matching branches unless that user is in\n`users` or is a member of a group in `groups`. Adding new users or\ngroups to an existing restriction should be done via `PUT`.\n\nNote that branch restrictions with overlapping matchers is allowed,\nbut the resulting behavior may be surprising.", "parameters": [ { "name": "_body", "in": "body", "description": "The new rule", "required": true, "schema": { "$ref": "#/definitions/branchrestriction" } } ], "tags": [ "branchrestrictions" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/branch-restrictions/{id}": { "delete": { "responses": { "204": { "description": "" }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the authenticated user does not have admin access to the repository", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository or branch restriction id does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes an existing branch restriction rule.", "parameters": [], "tags": [ "branchrestrictions" ] }, "get": { "responses": { "200": { "description": "The branch restriction rule", "schema": { "$ref": "#/definitions/branchrestriction" } }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the authenticated user does not have admin access to the repository", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository or branch restriction id does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a specific branch restriction rule.", "parameters": [], "tags": [ "branchrestrictions" ] }, "put": { "responses": { "200": { "description": "The updated branch restriction rule", "schema": { "$ref": "#/definitions/branchrestriction" } }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the authenticated user does not have admin access to the repository", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository or branch restriction id does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates an existing branch restriction rule.\n\nFields not present in the request body are ignored.\n\nSee [`POST`](../branch-restrictions#post) for details.", "parameters": [ { "name": "_body", "in": "body", "description": "The new version of the existing rule", "required": true, "schema": { "$ref": "#/definitions/branchrestriction" } } ], "tags": [ "branchrestrictions" ] }, "parameters": [ { "name": "id", "in": "path", "description": "The restriction rule's id", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/branching-model": { "get": { "responses": { "200": { "description": "The branching model object", "schema": { "$ref": "#/definitions/branching_model" } }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the authenticated user does not have read access to the repository", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Return the branching model as applied to the repository. This view is\nread-only. The branching model settings can be changed using the\n[settings](branching-model/settings#get) API.\n\nThe returned object:\n\n1. Always has a `development` property. `development.branch` contains\n the actual repository branch object that is considered to be the\n `development` branch. `development.branch` will not be present\n if it does not exist.\n2. Might have a `production` property. `production` will not\n be present when `production` is disabled.\n `production.branch` contains the actual branch object that is\n considered to be the `production` branch. `production.branch` will\n not be present if it does not exist.\n3. Always has a `branch_types` array which contains all enabled branch\n types.\n\nExample body:\n\n```\n{\n \"development\": {\n \"name\": \"master\",\n \"branch\": {\n \"type\": \"branch\",\n \"name\": \"master\",\n \"target\": {\n \"hash\": \"16dffcb0de1b22e249db6799532074cf32efe80f\"\n }\n },\n \"use_mainbranch\": true\n },\n \"production\": {\n \"name\": \"production\",\n \"branch\": {\n \"type\": \"branch\",\n \"name\": \"production\",\n \"target\": {\n \"hash\": \"16dffcb0de1b22e249db6799532074cf32efe80f\"\n }\n },\n \"use_mainbranch\": false\n },\n \"branch_types\": [\n {\n \"kind\": \"release\",\n \"prefix\": \"release/\"\n },\n {\n \"kind\": \"hotfix\",\n \"prefix\": \"hotfix/\"\n },\n {\n \"kind\": \"feature\",\n \"prefix\": \"feature/\"\n },\n {\n \"kind\": \"bugfix\",\n \"prefix\": \"bugfix/\"\n }\n ],\n \"type\": \"branching_model\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/.../branching-model\"\n }\n }\n}\n```", "parameters": [], "tags": [ "branching_model" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/branching-model/settings": { "get": { "responses": { "200": { "description": "The branching model configuration", "schema": { "$ref": "#/definitions/branching_model_settings" } }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the authenticated user does not have admin access to the repository", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Return the branching model configuration for a repository. The returned\nobject:\n\n1. Always has a `development` property for the development branch.\n2. Always a `production` property for the production branch. The\n production branch can be disabled.\n3. The `branch_types` contains all the branch types.\n\nThis is the raw configuration for the branching model. A client\nwishing to see the branching model with its actual current branches may\nfind the [active model API](../branching-model#get) more useful.\n\nExample body:\n\n```\n{\n \"development\": {\n \"is_valid\": true,\n \"name\": null,\n \"use_mainbranch\": true\n },\n \"production\": {\n \"is_valid\": true,\n \"name\": \"production\",\n \"use_mainbranch\": false,\n \"enabled\": false\n },\n \"branch_types\": [\n {\n \"kind\": \"release\",\n \"enabled\": true,\n \"prefix\": \"release/\"\n },\n {\n \"kind\": \"hotfix\",\n \"enabled\": true,\n \"prefix\": \"hotfix/\"\n },\n {\n \"kind\": \"feature\",\n \"enabled\": true,\n \"prefix\": \"feature/\"\n },\n {\n \"kind\": \"bugfix\",\n \"enabled\": false,\n \"prefix\": \"bugfix/\"\n }\n ],\n \"type\": \"branching_model_settings\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/.../branching-model/settings\"\n }\n }\n}\n```", "parameters": [], "tags": [ "branching_model" ] }, "put": { "responses": { "200": { "description": "The updated branching model configuration", "schema": { "$ref": "#/definitions/branching_model_settings" } }, "400": { "description": "If the request contains invalid branching model configuration", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the authenticated user does not have admin access to the repository", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Update the branching model configuration for a repository.\n\nThe `development` branch can be configured to a specific branch or to\ntrack the main branch. When set to a specific branch it must\ncurrently exist. Only the passed properties will be updated. The\nproperties not passed will be left unchanged. A request without a\n`development` property will leave the development branch unchanged.\n\nIt is possible for the `development` branch to be invalid. This\nhappens when it points at a specific branch that has been\ndeleted. This is indicated in the `is_valid` field for the branch. It is\nnot possible to update the settings for `development` if that\nwould leave the branch in an invalid state. Such a request will be\nrejected.\n\nThe `production` branch can be a specific branch, the main\nbranch or disabled. When set to a specific branch it must currently\nexist. The `enabled` property can be used to enable (`true`) or\ndisable (`false`) it. Only the passed properties will be updated. The\nproperties not passed will be left unchanged. A request without a\n`production` property will leave the production branch unchanged.\n\nIt is possible for the `production` branch to be invalid. This\nhappens when it points at a specific branch that has been\ndeleted. This is indicated in the `is_valid` field for the branch. A\nrequest that would leave `production` enabled and invalid will be\nrejected. It is possible to update `production` and make it invalid if\nit would also be left disabled.\n\nThe `branch_types` property contains the branch types to be updated.\nOnly the branch types passed will be updated. All updates will be\nrejected if it would leave the branching model in an invalid state.\nFor branch types this means that:\n\n1. The prefixes for all enabled branch types are valid. For example,\n it is not possible to use '*' inside a Git prefix.\n2. A prefix of an enabled branch type must not be a prefix of another\n enabled branch type. This is to ensure that a branch can be easily\n classified by its prefix unambiguously.\n\nIt is possible to store an invalid prefix if that branch type would be\nleft disabled. Only the passed properties will be updated. The\nproperties not passed will be left unchanged. Each branch type must\nhave a `kind` property to identify it.\n\nExample Body:\n\n```\n {\n \"development\": {\n \"use_mainbranch\": true\n },\n \"production\": {\n \"enabled\": true,\n \"use_mainbranch\": false,\n \"name\": \"production\"\n },\n \"branch_types\": [\n {\n \"kind\": \"bugfix\",\n \"enabled\": true,\n \"prefix\": \"bugfix/\"\n },\n {\n \"kind\": \"feature\",\n \"enabled\": true,\n \"prefix\": \"feature/\"\n },\n {\n \"kind\": \"hotfix\",\n \"prefix\": \"hotfix/\"\n },\n {\n \"kind\": \"release\",\n \"enabled\": false,\n }\n ]\n }\n```", "parameters": [], "tags": [ "branching_model" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/commit/{commit}": { "get": { "responses": { "200": { "description": "The commit object", "schema": { "$ref": "#/definitions/commit" } }, "404": { "description": "If the specified commit or repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified commit.\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a1\n{\n \"rendered\": {\n \"message\": {\n \"raw\": \"Add a GEORDI_OUTPUT_DIR setting\",\n \"markup\": \"markdown\",\n \"html\": \"

Add a GEORDI_OUTPUT_DIR setting

\",\n \"type\": \"rendered\"\n }\n },\n \"hash\": \"f7591a13eda445d9a9167f98eb870319f4b6c2d8\",\n \"repository\": {\n \"name\": \"geordi\",\n \"type\": \"repository\",\n \"full_name\": \"bitbucket/geordi\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/bitbucket/geordi\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B85d08b4e-571d-44e9-a507-fa476535aa98%7D?ts=1730260\"\n }\n },\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8\"\n },\n \"comments\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8/comments\"\n },\n \"patch\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/patch/f7591a13eda445d9a9167f98eb870319f4b6c2d8\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/bitbucket/geordi/commits/f7591a13eda445d9a9167f98eb870319f4b6c2d8\"\n },\n \"diff\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/diff/f7591a13eda445d9a9167f98eb870319f4b6c2d8\"\n },\n \"approve\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8/approve\"\n },\n \"statuses\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f7591a13eda445d9a9167f98eb870319f4b6c2d8/statuses\"\n }\n },\n \"author\": {\n \"raw\": \"Brodie Rao \",\n \"type\": \"author\",\n \"user\": {\n \"display_name\": \"Brodie Rao\",\n \"uuid\": \"{9484702e-c663-4afd-aefb-c93a8cd31c28}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/%7B9484702e-c663-4afd-aefb-c93a8cd31c28%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B9484702e-c663-4afd-aefb-c93a8cd31c28%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/557058:3aae1e05-702a-41e5-81c8-f36f29afb6ca/613070db-28b0-421f-8dba-ae8a87e2a5c7/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"brodie\",\n \"account_id\": \"557058:3aae1e05-702a-41e5-81c8-f36f29afb6ca\"\n }\n },\n \"summary\": {\n \"raw\": \"Add a GEORDI_OUTPUT_DIR setting\",\n \"markup\": \"markdown\",\n \"html\": \"

Add a GEORDI_OUTPUT_DIR setting

\",\n \"type\": \"rendered\"\n },\n \"participants\": [],\n \"parents\": [\n {\n \"type\": \"commit\",\n \"hash\": \"f06941fec4ef6bcb0c2456927a0cf258fa4f899b\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/commit/f06941fec4ef6bcb0c2456927a0cf258fa4f899b\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/bitbucket/geordi/commits/f06941fec4ef6bcb0c2456927a0cf258fa4f899b\"\n }\n }\n }\n ],\n \"date\": \"2012-07-16T19:37:54+00:00\",\n \"message\": \"Add a GEORDI_OUTPUT_DIR setting\",\n \"type\": \"commit\"\n}\n```", "parameters": [], "tags": [ "commits" ] }, "parameters": [ { "name": "commit", "in": "path", "description": "The commit's SHA1.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/approve": { "delete": { "responses": { "204": { "description": "An empty response indicating the authenticated user's approval has been withdrawn." }, "404": { "description": "If the specified commit, or the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Redact the authenticated user's approval of the specified commit.\n\nThis operation is only available to users that have explicit access to\nthe repository. In contrast, just the fact that a repository is\npublicly accessible to users does not give them the ability to approve\ncommits.", "parameters": [], "tags": [ "commits" ] }, "post": { "responses": { "200": { "description": "The `participant` object recording that the authenticated user approved the commit.", "schema": { "$ref": "#/definitions/participant" } }, "404": { "description": "If the specified commit, or the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Approve the specified commit as the authenticated user.\n\nThis operation is only available to users that have explicit access to\nthe repository. In contrast, just the fact that a repository is\npublicly accessible to users does not give them the ability to approve\ncommits.", "parameters": [], "tags": [ "commits" ] }, "parameters": [ { "name": "commit", "in": "path", "description": "The commit's SHA1.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/comments": { "get": { "responses": { "200": { "description": "A paginated list of commit comments.", "schema": { "$ref": "#/definitions/paginated_commit_comments" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the commit's comments.\n\nThis includes both global and inline comments.\n\nThe default sorting is oldest to newest and can be overridden with\nthe `sort` query parameter.", "parameters": [ { "name": "q", "in": "query", "description": "Query string to narrow down the response as per\n[filtering and sorting](../../../../../../meta/filtering).\n", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "Field by which the results should be sorted as per\n[filtering and sorting](../../../../../../meta/filtering).\n", "required": false, "type": "string" } ], "tags": [ "commits" ] }, "post": { "responses": { "201": { "description": "The newly created comment.", "headers": { "Location": { "type": "string", "description": "The location of the newly created comment." } } }, "400": { "description": "If the comment was detected as spam, or if the parent comment is not attached to the same node as the new comment" }, "404": { "description": "If a parent ID was passed in that cannot be found" } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates new comment on the specified commit.\n\nTo post a reply to an existing comment, include the `parent.id` field:\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/commit/db9ba1e031d07a02603eae0e559a7adc010257fc/comments/ \\\n -X POST -u evzijst \\\n -H 'Content-Type: application/json' \\\n -d '{\"content\": {\"raw\": \"One more thing!\"},\n \"parent\": {\"id\": 5728901}}'\n```", "parameters": [ { "name": "_body", "in": "body", "description": "The specified comment.", "required": true, "schema": { "$ref": "#/definitions/commit_comment" } } ], "tags": [ "commits" ] }, "parameters": [ { "name": "commit", "in": "path", "description": "The commit's SHA1.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/comments/{comment_id}": { "get": { "responses": { "200": { "description": "The commit comment.", "schema": { "$ref": "#/definitions/commit_comment" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified commit comment.", "parameters": [], "tags": [ "commits" ] }, "parameters": [ { "name": "comment_id", "in": "path", "description": "The id of the comment.", "required": true, "type": "integer" }, { "name": "commit", "in": "path", "description": "The commit's SHA1.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}": { "put": { "responses": { "204": { "description": "An empty response." } }, "operationId": "updateCommitHostedPropertyValue", "description": "Update an [application property](/cloud/bitbucket/application-properties/) value stored against a commit.", "parameters": [ { "required": true, "type": "string", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "in": "path", "name": "workspace" }, { "required": true, "type": "string", "description": "The repository.", "in": "path", "name": "repo_slug" }, { "required": true, "type": "string", "description": "The commit.", "in": "path", "name": "commit" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] }, "delete": { "responses": { "204": { "description": "An empty response." } }, "operationId": "deleteCommitHostedPropertyValue", "description": "Delete an [application property](/cloud/bitbucket/application-properties/) value stored against a commit.", "parameters": [ { "required": true, "type": "string", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "in": "path", "name": "workspace" }, { "required": true, "type": "string", "description": "The repository.", "in": "path", "name": "repo_slug" }, { "required": true, "type": "string", "description": "The commit.", "in": "path", "name": "commit" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] }, "get": { "responses": { "200": { "description": "The value of the property." } }, "operationId": "getCommitHostedPropertyValue", "description": "Retrieve an [application property](/cloud/bitbucket/application-properties/) value stored against a commit.", "parameters": [ { "required": true, "type": "string", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "in": "path", "name": "workspace" }, { "required": true, "type": "string", "description": "The repository.", "in": "path", "name": "repo_slug" }, { "required": true, "type": "string", "description": "The commit.", "in": "path", "name": "commit" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] } }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/pullrequests": { "get": { "responses": { "200": { "description": "The paginated list of pull requests.", "schema": { "$ref": "#/definitions/paginated_pullrequests" } }, "202": { "description": "The repository's pull requests are still being indexed.", "schema": { "$ref": "#/definitions/paginated_pullrequests" } }, "404": { "description": "Either the repository does not exist, or pull request commit links have not yet been indexed.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The account; either the UUID in curly braces, or the account_id", "in": "path", "name": "username" }, { "required": true, "type": "string", "description": "The repository; either the UUID in curly braces, or the slug", "in": "path", "name": "repo_slug" }, { "required": true, "type": "string", "description": "The SHA1 of the commit", "in": "path", "name": "commit" }, { "description": "Which page to retrieve", "format": "int32", "default": 1, "required": false, "in": "query", "type": "integer", "name": "page" }, { "description": "How many pull requests to retrieve per page", "format": "int32", "default": 30, "required": false, "in": "query", "type": "integer", "name": "pagelen" } ], "tags": [ "pullrequests" ], "produces": [ "application/json" ], "summary": "Returns a paginated list of all pull requests as part of which this commit was reviewed. Pull Request Commit Links app must be installed first before using this API; installation automatically occurs when 'Go to pull request' is clicked from the web interface for a commit's details.", "operationId": "getPullrequestsForCommit" } }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/reports": { "get": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/paginated_reports" } } }, "description": "Returns a paginated list of Reports linked to this commit.", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The commit for which to retrieve reports.", "required": true, "type": "string", "name": "commit", "in": "path" } ], "tags": [ "reports", "commits" ], "produces": [ "application/json" ], "operationId": "getReportsForCommit" } }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}": { "put": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/report" } }, "400": { "description": "The provided Report object is malformed or incomplete.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Creates or updates a report for the specified commit.\nTo upload a report, make sure to generate an ID that is unique across all reports for that commit. If you want to use an existing id from your own system, we recommend prefixing it with your system's name to avoid collisions, for example, mySystem-001.\n\n### Sample cURL request:\n```\ncurl --request PUT 'https://api.bitbucket.org/2.0/repositories///commit//reports/mysystem-001' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"Security scan report\",\n \"details\": \"This pull request introduces 10 new dependency vulnerabilities.\",\n \"report_type\": \"SECURITY\",\n \"reporter\": \"mySystem\",\n \"link\": \"http://www.mysystem.com/reports/001\",\n \"result\": \"FAILED\",\n \"data\": [\n {\n \"title\": \"Duration (seconds)\",\n \"type\": \"DURATION\",\n \"value\": 14\n },\n {\n \"title\": \"Safe to merge?\",\n \"type\": \"BOOLEAN\",\n \"value\": false\n }\n ]\n}'\n```\n\n### Possible field values:\nreport_type: SECURITY, COVERAGE, TEST, BUG\nresult: PASSED, FAILED, PENDING\ndata.type: BOOLEAN, DATE, DURATION, LINK, NUMBER, PERCENTAGE, TEXT\n\nPlease refer to the [Code Insights documentation](https://confluence.atlassian.com/bitbucket/code-insights-994316785.html) for more information.\n", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The commit the report belongs to.", "required": true, "type": "string", "name": "commit", "in": "path" }, { "description": "Either the uuid or external-id of the report.", "required": true, "type": "string", "name": "reportId", "in": "path" }, { "required": true, "in": "body", "description": "The report to create or update", "name": "_body", "schema": { "$ref": "#/definitions/report" } } ], "tags": [ "reports", "commits" ], "produces": [ "application/json" ], "operationId": "createOrUpdateReport" }, "get": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/report" } }, "404": { "description": "The report with the given ID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Returns a single Report matching the provided ID.", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The commit the report belongs to.", "required": true, "type": "string", "name": "commit", "in": "path" }, { "description": "Either the uuid or external-id of the report.", "required": true, "type": "string", "name": "reportId", "in": "path" } ], "tags": [ "reports", "commits" ], "produces": [ "application/json" ], "operationId": "getReport" }, "delete": { "responses": { "204": { "description": "No content" } }, "description": "Deletes a single Report matching the provided ID.", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The commit the report belongs to.", "required": true, "type": "string", "name": "commit", "in": "path" }, { "description": "Either the uuid or external-id of the report.", "required": true, "type": "string", "name": "reportId", "in": "path" } ], "tags": [ "reports", "commits" ], "produces": [ "application/json" ], "operationId": "deleteReport" } }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations": { "post": { "responses": { "200": { "description": "OK", "schema": { "items": { "$ref": "#/definitions/report_annotation" }, "type": "array" } } }, "description": "Bulk upload of annotations.\nAnnotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations.\n\nAdd the annotations you want to upload as objects in a JSON array and make sure each annotation has the external_id field set to a unique value. If you want to use an existing id from your own system, we recommend prefixing it with your system's name to avoid collisions, for example, mySystem-annotation001. The external id can later be used to identify the report as an alternative to the generated [UUID](https://developer.atlassian.com/bitbucket/api/2/reference/meta/uri-uuid#uuid). You can upload up to 100 annotations per POST request.\n\n### Sample cURL request:\n```\ncurl --location 'https://api.bitbucket.org/2.0/repositories///commit//reports/mysystem-001/annotations' \\\n--header 'Content-Type: application/json' \\\n--data-raw '[\n {\n \"external_id\": \"mysystem-annotation001\",\n \"title\": \"Security scan report\",\n \"annotation_type\": \"VULNERABILITY\",\n \"summary\": \"This line represents a security threat.\",\n \"severity\": \"HIGH\",\n \"path\": \"my-service/src/main/java/com/myCompany/mysystem/logic/Main.java\",\n \"line\": 42\n },\n {\n \"external_id\": \"mySystem-annotation002\",\n \"title\": \"Bug report\",\n \"annotation_type\": \"BUG\",\n \"result\": \"FAILED\",\n \"summary\": \"This line might introduce a bug.\",\n \"severity\": \"MEDIUM\",\n \"path\": \"my-service/src/main/java/com/myCompany/mysystem/logic/Helper.java\",\n \"line\": 13\n }\n]'\n```\n\n### Possible field values:\nannotation_type: VULNERABILITY, CODE_SMELL, BUG\nresult: PASSED, FAILED, IGNORED, SKIPPED\nseverity: HIGH, MEDIUM, LOW, CRITICAL\n\nPlease refer to the [Code Insights documentation](https://confluence.atlassian.com/bitbucket/code-insights-994316785.html) for more information.\n", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The commit for which to retrieve reports.", "required": true, "type": "string", "name": "commit", "in": "path" }, { "description": "Uuid or external-if of the report for which to get annotations for.", "required": true, "type": "string", "name": "reportId", "in": "path" }, { "required": true, "in": "body", "description": "The annotations to create or update", "name": "_body", "schema": { "minItems": 1, "items": { "$ref": "#/definitions/report_annotation" }, "type": "array", "maxItems": 100 } } ], "tags": [ "reports", "commits" ], "produces": [ "application/json" ], "operationId": "bulkCreateOrUpdateAnnotations" }, "get": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/paginated_annotations" } } }, "description": "Returns a paginated list of Annotations for a specified report.", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The commit for which to retrieve reports.", "required": true, "type": "string", "name": "commit", "in": "path" }, { "description": "Uuid or external-if of the report for which to get annotations for.", "required": true, "type": "string", "name": "reportId", "in": "path" } ], "tags": [ "reports", "commits" ], "produces": [ "application/json" ], "operationId": "getAnnotationsForReport" } }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/reports/{reportId}/annotations/{annotationId}": { "put": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/report_annotation" } }, "400": { "description": "The provided Annotation object is malformed or incomplete.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Creates or updates an individual annotation for the specified report.\nAnnotations are individual findings that have been identified as part of a report, for example, a line of code that represents a vulnerability. These annotations can be attached to a specific file and even a specific line in that file, however, that is optional. Annotations are not mandatory and a report can contain up to 1000 annotations.\n\nJust as reports, annotation needs to be uploaded with a unique ID that can later be used to identify the report as an alternative to the generated [UUID](https://developer.atlassian.com/bitbucket/api/2/reference/meta/uri-uuid#uuid). If you want to use an existing id from your own system, we recommend prefixing it with your system's name to avoid collisions, for example, mySystem-annotation001.\n\n### Sample cURL request:\n```\ncurl --request PUT 'https://api.bitbucket.org/2.0/repositories///commit//reports/mySystem-001/annotations/mysystem-annotation001' \\\n--header 'Content-Type: application/json' \\\n--data-raw '{\n \"title\": \"Security scan report\",\n \"annotation_type\": \"VULNERABILITY\",\n \"summary\": \"This line represents a security thread.\",\n \"severity\": \"HIGH\",\n \"path\": \"my-service/src/main/java/com/myCompany/mysystem/logic/Main.java\",\n \"line\": 42\n}'\n```\n\n### Possible field values:\nannotation_type: VULNERABILITY, CODE_SMELL, BUG\nresult: PASSED, FAILED, IGNORED, SKIPPED\nseverity: HIGH, MEDIUM, LOW, CRITICAL\n\nPlease refer to the [Code Insights documentation](https://confluence.atlassian.com/bitbucket/code-insights-994316785.html) for more information.\n", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The commit the report belongs to.", "required": true, "type": "string", "name": "commit", "in": "path" }, { "description": "Either the uuid or external-id of the report.", "required": true, "type": "string", "name": "reportId", "in": "path" }, { "description": "Either the uuid or external-id of the annotation.", "required": true, "type": "string", "name": "annotationId", "in": "path" }, { "required": true, "in": "body", "description": "The annotation to create or update", "name": "_body", "schema": { "$ref": "#/definitions/report_annotation" } } ], "tags": [ "reports", "commits" ], "produces": [ "application/json" ], "operationId": "createOrUpdateAnnotation" }, "get": { "responses": { "200": { "description": "OK", "schema": { "$ref": "#/definitions/report_annotation" } }, "404": { "description": "The annotation with the given ID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Returns a single Annotation matching the provided ID.", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The commit the report belongs to.", "required": true, "type": "string", "name": "commit", "in": "path" }, { "description": "Either the uuid or external-id of the report.", "required": true, "type": "string", "name": "reportId", "in": "path" }, { "description": "Either the uuid or external-id of the annotation.", "required": true, "type": "string", "name": "annotationId", "in": "path" } ], "tags": [ "reports", "commits" ], "produces": [ "application/json" ], "operationId": "getAnnotation" }, "delete": { "responses": { "204": { "description": "No content" } }, "description": "Deletes a single Annotation matching the provided ID.", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The commit the annotation belongs to.", "required": true, "type": "string", "name": "commit", "in": "path" }, { "description": "Either the uuid or external-id of the annotation.", "required": true, "type": "string", "name": "reportId", "in": "path" }, { "description": "Either the uuid or external-id of the annotation.", "required": true, "type": "string", "name": "annotationId", "in": "path" } ], "tags": [ "reports", "commits" ], "produces": [ "application/json" ], "operationId": "deleteAnnotation" } }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses": { "get": { "responses": { "200": { "description": "A paginated list of all commit statuses for this commit.", "schema": { "$ref": "#/definitions/paginated_commitstatuses" } }, "401": { "description": "If the repository is private and the request was not authenticated." }, "404": { "description": "If the repository or commit does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all statuses (e.g. build results) for a specific commit.", "parameters": [ { "name": "q", "in": "query", "description": "Query string to narrow down the response as per\n[filtering and sorting](../../../../../../meta/filtering).\n", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "Field by which the results should be sorted as per\n[filtering and sorting](../../../../../../meta/filtering).\nDefaults to `created_on`.\n", "required": false, "type": "string" } ], "tags": [ "repositories", "commitstatuses" ] }, "parameters": [ { "name": "commit", "in": "path", "description": "The commit's SHA1.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build": { "post": { "responses": { "201": { "description": "The newly created build status object.", "schema": { "$ref": "#/definitions/commitstatus" } }, "401": { "description": "If the repository is private and the request was not authenticated." }, "404": { "description": "If the repository, commit, or build status key does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new build status against the specified commit.\n\nIf the specified key already exists, the existing status object will\nbe overwritten.\n\nExample:\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -X POST -u jdoe -H 'Content-Type: application/json' -d '{\n \"key\": \"MY-BUILD\",\n \"state\": \"SUCCESSFUL\",\n \"description\": \"42 tests passed\",\n \"url\": \"https://www.example.org/my-build-result\"\n }'\n```\n\nWhen creating a new commit status, you can use a URI template for the URL.\nTemplates are URLs that contain variable names that Bitbucket will\nevaluate at runtime whenever the URL is displayed anywhere similar to\nparameter substitution in\n[Bitbucket Connect](https://developer.atlassian.com/bitbucket/concepts/context-parameters.html).\nFor example, one could use `https://foo.com/builds/{repository.full_name}`\nwhich Bitbucket will turn into `https://foo.com/builds/foo/bar` at render time.\nThe context variables available are `repository` and `commit`.", "parameters": [ { "name": "_body", "in": "body", "description": "The new commit status object.", "required": false, "schema": { "$ref": "#/definitions/commitstatus" } } ], "tags": [ "repositories", "commitstatuses" ] }, "parameters": [ { "name": "commit", "in": "path", "description": "The commit's SHA1.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/commit/{commit}/statuses/build/{key}": { "get": { "responses": { "200": { "description": "The build status object with the specified key.", "schema": { "$ref": "#/definitions/commitstatus" } }, "401": { "description": "If the repository is private and the request was not authenticated." }, "404": { "description": "If the repository, commit, or build status key does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified build status for a commit.", "parameters": [], "tags": [ "repositories", "commitstatuses" ] }, "put": { "responses": { "200": { "description": "The updated build status object.", "schema": { "$ref": "#/definitions/commitstatus" } }, "401": { "description": "If the repository is private and the request was not authenticated." }, "404": { "description": "If the repository or build does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Used to update the current status of a build status object on the\nspecific commit.\n\nThis operation can also be used to change other properties of the\nbuild status:\n\n* `state`\n* `name`\n* `description`\n* `url`\n* `refname`\n\nThe `key` cannot be changed.", "parameters": [ { "name": "_body", "in": "body", "description": "The updated build status object", "required": false, "schema": { "$ref": "#/definitions/commitstatus" } } ], "tags": [ "repositories", "commitstatuses" ] }, "parameters": [ { "name": "commit", "in": "path", "description": "The commit's SHA1.", "required": true, "type": "string" }, { "name": "key", "in": "path", "description": "The build status' unique key", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/commits": { "get": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "These are the repository's commits. They are paginated and returned\nin reverse chronological order, similar to the output of `git log` and\n`hg log`. Like these tools, the DAG can be filtered.\n\n## GET /repositories/{workspace}/{repo_slug}/commits/\n\nReturns all commits in the repo in topological order (newest commit\nfirst). All branches and tags are included (similar to\n`git log --all` and `hg log`).\n\n## GET /repositories/{workspace}/{repo_slug}/commits/master\n\nReturns all commits on rev `master` (similar to `git log master`,\n`hg log master`).\n\n## GET /repositories/{workspace}/{repo_slug}/commits/dev?exclude=master\n\nReturns all commits on ref `dev`, except those that are reachable on\n`master` (similar to `git log dev ^master`).\n\n## GET /repositories/{workspace}/{repo_slug}/commits/?exclude=master\n\nReturns all commits in the repo that are not on master\n(similar to `git log --all ^master`).\n\n## GET /repositories/{workspace}/{repo_slug}/commits/?include=foo&include=bar&exclude=fu&exclude=fubar\n\nReturns all commits that are on refs `foo` or `bar`, but not on `fu` or\n`fubar` (similar to `git log foo bar ^fu ^fubar`).\n\nAn optional `path` parameter can be specified that will limit the\nresults to commits that affect that path. `path` can either be a file\nor a directory. If a directory is specified, commits are returned that\nhave modified any file in the directory tree rooted by `path`. It is\nimportant to note that if the `path` parameter is specified, the commits\nreturned by this endpoint may no longer be a DAG, parent commits that\ndo not modify the path will be omitted from the response.\n\n## GET /repositories/{workspace}/{repo_slug}/commits/?path=README.md&include=foo&include=bar&exclude=master\n\nReturns all commits that are on refs `foo` or `bar`, but not on `master`\nthat changed the file README.md.\n\n## GET /repositories/{workspace}/{repo_slug}/commits/?path=src/&include=foo&include=bar&exclude=master\n\nReturns all commits that are on refs `foo` or `bar`, but not on `master`\nthat changed to a file in any file in the directory src or its children.\n\nBecause the response could include a very large number of commits, it\nis paginated. Follow the 'next' link in the response to navigate to the\nnext page of commits. As with other paginated resources, do not\nconstruct your own links.\n\nWhen the include and exclude parameters are more than can fit in a\nquery string, clients can use a `x-www-form-urlencoded` POST instead.", "parameters": [], "tags": [ "commits" ] }, "post": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Identical to `GET /repositories/{workspace}/{repo_slug}/commits`,\nexcept that POST allows clients to place the include and exclude\nparameters in the request body to avoid URL length issues.\n\n**Note that this resource does NOT support new commit creation.**", "parameters": [], "tags": [ "commits" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "revision", "in": "path", "description": "(optional) The commit's SHA1.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/commits/{revision}": { "get": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "These are the repository's commits. They are paginated and returned\nin reverse chronological order, similar to the output of `git log` and\n`hg log`. Like these tools, the DAG can be filtered.\n\n## GET /repositories/{workspace}/{repo_slug}/commits/\n\nReturns all commits in the repo in topological order (newest commit\nfirst). All branches and tags are included (similar to\n`git log --all` and `hg log`).\n\n## GET /repositories/{workspace}/{repo_slug}/commits/master\n\nReturns all commits on rev `master` (similar to `git log master`,\n`hg log master`).\n\n## GET /repositories/{workspace}/{repo_slug}/commits/dev?exclude=master\n\nReturns all commits on ref `dev`, except those that are reachable on\n`master` (similar to `git log dev ^master`).\n\n## GET /repositories/{workspace}/{repo_slug}/commits/?exclude=master\n\nReturns all commits in the repo that are not on master\n(similar to `git log --all ^master`).\n\n## GET /repositories/{workspace}/{repo_slug}/commits/?include=foo&include=bar&exclude=fu&exclude=fubar\n\nReturns all commits that are on refs `foo` or `bar`, but not on `fu` or\n`fubar` (similar to `git log foo bar ^fu ^fubar`).\n\nAn optional `path` parameter can be specified that will limit the\nresults to commits that affect that path. `path` can either be a file\nor a directory. If a directory is specified, commits are returned that\nhave modified any file in the directory tree rooted by `path`. It is\nimportant to note that if the `path` parameter is specified, the commits\nreturned by this endpoint may no longer be a DAG, parent commits that\ndo not modify the path will be omitted from the response.\n\n## GET /repositories/{workspace}/{repo_slug}/commits/?path=README.md&include=foo&include=bar&exclude=master\n\nReturns all commits that are on refs `foo` or `bar`, but not on `master`\nthat changed the file README.md.\n\n## GET /repositories/{workspace}/{repo_slug}/commits/?path=src/&include=foo&include=bar&exclude=master\n\nReturns all commits that are on refs `foo` or `bar`, but not on `master`\nthat changed to a file in any file in the directory src or its children.\n\nBecause the response could include a very large number of commits, it\nis paginated. Follow the 'next' link in the response to navigate to the\nnext page of commits. As with other paginated resources, do not\nconstruct your own links.\n\nWhen the include and exclude parameters are more than can fit in a\nquery string, clients can use a `x-www-form-urlencoded` POST instead.", "parameters": [], "tags": [ "commits" ] }, "post": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Identical to `GET /repositories/{workspace}/{repo_slug}/commits`,\nexcept that POST allows clients to place the include and exclude\nparameters in the request body to avoid URL length issues.\n\n**Note that this resource does NOT support new commit creation.**", "parameters": [], "tags": [ "commits" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "revision", "in": "path", "description": "(optional) The commit's SHA1.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/components": { "get": { "responses": { "200": { "description": "The components that have been defined in the issue tracker.", "schema": { "$ref": "#/definitions/paginated_components" } }, "404": { "description": "The specified repository does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the components that have been defined in the issue tracker.\n\nThis resource is only available on repositories that have the issue\ntracker enabled.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/components/{component_id}": { "get": { "responses": { "200": { "description": "The specified component object.", "schema": { "$ref": "#/definitions/component" } }, "404": { "description": "The specified repository or component does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified issue tracker component object.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "component_id", "in": "path", "description": "The component's id", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/default-reviewers": { "get": { "responses": { "200": { "description": "The paginated list of default reviewers" } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the repository's default reviewers.\n\nThese are the users that are automatically added as reviewers on every\nnew pull request that is created.", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/default-reviewers/{target_username}": { "delete": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Removes a default reviewer from the repository.", "parameters": [], "tags": [ "pullrequests" ] }, "get": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified reviewer.\n\nThis can be used to test whether a user is among the repository's\ndefault reviewers list. A 404 indicates that that specified user is not\na default reviewer.", "parameters": [], "tags": [ "pullrequests" ] }, "put": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Adds the specified user to the repository's list of default\nreviewers.\n\nThis method is idempotent. Adding a user a second time has no effect.", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "target_username", "in": "path", "description": "This can either be the username or the UUID of the default reviewer,\nsurrounded by curly-braces, for example: `{account UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/deploy-keys": { "get": { "responses": { "200": { "description": "Deploy keys matching the repository", "schema": { "$ref": "#/definitions/paginated_deploy_keys" } }, "403": { "description": "If the specified user or repository is not accessible to the current user" }, "404": { "description": "If the specified user or repository does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository", "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all deploy-keys belonging to a repository.\n\nExample:\n```\n$ curl -H \"Authorization \" \\\nhttps://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys\n\nOutput:\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"id\": 123,\n \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\",\n \"label\": \"mykey\",\n \"type\": \"deploy_key\",\n \"created_on\": \"2018-08-15T23:50:59.993890+00:00\",\n \"repository\": {\n \"full_name\": \"mleu/test\",\n \"name\": \"test\",\n \"type\": \"repository\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"links\":{\n \"self\":{\n \"href\": \"https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/123\"\n }\n }\n \"last_used\": null,\n \"comment\": \"mleu@C02W454JHTD8\"\n }\n ],\n \"page\": 1,\n \"size\": 1\n}\n```", "parameters": [], "tags": [ "deploy" ] }, "post": { "responses": { "200": { "description": "The deploy key that was created", "schema": { "$ref": "#/definitions/deploy_key" } }, "400": { "description": "Invalid deploy key inputs" }, "403": { "description": "If the specified user or repository is not accessible to the current user" }, "404": { "description": "If the specified user or repository does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository", "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Create a new deploy key in a repository.\n\nExample:\n```\n$ curl -XPOST \\\n-H \"Authorization \" \\\n-H \"Content-type: application/json\" \\\nhttps://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys -d \\\n'{\n \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 mleu@C02W454JHTD8\",\n \"label\": \"mydeploykey\"\n}'\n\nOutput:\n{\n \"id\": 123,\n \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\",\n \"label\": \"mydeploykey\",\n \"type\": \"deploy_key\",\n \"created_on\": \"2018-08-15T23:50:59.993890+00:00\",\n \"repository\": {\n \"full_name\": \"mleu/test\",\n \"name\": \"test\",\n \"type\": \"repository\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"links\":{\n \"self\":{\n \"href\": \"https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/123\"\n }\n }\n \"last_used\": null,\n \"comment\": \"mleu@C02W454JHTD8\"\n}\n```", "parameters": [], "tags": [ "deploy" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/deploy-keys/{key_id}": { "delete": { "responses": { "204": { "description": "The key has been deleted" }, "403": { "description": "If the current user does not have permission to delete a key for the specified user" }, "404": { "description": "If the specified user, repository, or deploy key does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository", "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "This deletes a deploy key from a repository.\n\nExample:\n```\n$ curl -XDELETE \\\n-H \"Authorization \" \\\nhttps://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234\n```", "parameters": [], "tags": [ "deploy" ] }, "get": { "responses": { "200": { "description": "Deploy key matching the key ID", "schema": { "$ref": "#/definitions/deploy_key" } }, "403": { "description": "If the specified user or repository is not accessible to the current user" }, "404": { "description": "If the specified user or repository does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository", "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the deploy key belonging to a specific key.\n\nExample:\n```\n$ curl -H \"Authorization \" \\\nhttps://api.bitbucket.org/2.0/repositories/mleu/test/deploy-key/1234\n\nOutput:\n{\n \"comment\": \"mleu@C02W454JHTD8\",\n \"last_used\": null,\n \"links\": {\n \"self\": {\n \"href\": https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-key/1234\"\n }\n },\n \"repository\": {\n \"full_name\": \"mleu/test\",\n \"name\": \"test\",\n \"type\": \"repository\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"label\": \"mykey\",\n \"created_on\": \"2018-08-15T23:50:59.993890+00:00\",\n \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\",\n \"id\": 1234,\n \"type\": \"deploy_key\"\n}\n```", "parameters": [], "tags": [ "deploy" ] }, "put": { "responses": { "200": { "description": "The newly updated deploy key.", "schema": { "$ref": "#/definitions/deploy_key" } }, "400": { "description": "If the submitted key or related value is invalid", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the current user does not have permission to add a key for the specified user" }, "404": { "description": "If the specified user, repository, or deploy key does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository", "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Create a new deploy key in a repository.\n\nThe same key needs to be passed in but the comment and label can change.\n\nExample:\n```\n$ curl -XPUT \\\n-H \"Authorization \" \\\n-H \"Content-type: application/json\" \\\nhttps://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234 -d \\\n'{\n \"label\": \"newlabel\",\n \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 newcomment\",\n}'\n\nOutput:\n{\n \"comment\": \"newcomment\",\n \"last_used\": null,\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234\"\n }\n },\n \"repository\": {\n \"full_name\": \"mleu/test\",\n \"name\": \"test\",\n \"type\": \"repository\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"label\": \"newlabel\",\n \"created_on\": \"2018-08-15T23:50:59.993890+00:00\",\n \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\",\n \"id\": 1234,\n \"type\": \"deploy_key\"\n}\n```", "parameters": [], "tags": [ "deploy" ] }, "parameters": [ { "name": "key_id", "in": "path", "description": "The key ID matching the deploy key.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/deployments/": { "get": { "description": "Find deployments", "tags": [ "deployments" ], "responses": { "200": { "description": "The matching deployments.", "schema": { "$ref": "#/definitions/paginated_deployments" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "operationId": "getDeploymentsForRepository" } }, "/repositories/{workspace}/{repo_slug}/deployments/{deployment_uuid}": { "get": { "description": "Retrieve a deployment", "tags": [ "deployments" ], "responses": { "200": { "description": "The deployment.", "schema": { "$ref": "#/definitions/deployment" } }, "404": { "description": "No account, repository or deployment with the UUID provided exists.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The deployment UUID.", "required": true, "type": "string", "name": "deployment_uuid", "in": "path" } ], "operationId": "getDeploymentForRepository" } }, "/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables": { "post": { "description": "Create a deployment environment level variable.", "tags": [ "pipelines" ], "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of the newly created variable." } }, "description": "The variable was created.", "schema": { "$ref": "#/definitions/deployment_variable" } }, "404": { "description": "The account, repository, environment or variable with the given UUID was not found.", "schema": { "$ref": "#/definitions/error" } }, "409": { "description": "A variable with the provided key already exists.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The environment.", "required": true, "type": "string", "name": "environment_uuid", "in": "path" }, { "description": "The UUID of the variable to update.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" }, { "required": true, "in": "body", "description": "The variable to create", "name": "_body", "schema": { "$ref": "#/definitions/deployment_variable" } } ], "operationId": "createDeploymentVariable" }, "get": { "description": "Find deployment environment level variables.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The retrieved deployment variables.", "schema": { "$ref": "#/definitions/paginated_deployment_variable" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The environment.", "required": true, "type": "string", "name": "environment_uuid", "in": "path" } ], "operationId": "getDeploymentVariables" } }, "/repositories/{workspace}/{repo_slug}/deployments_config/environments/{environment_uuid}/variables/{variable_uuid}": { "put": { "description": "Update a deployment environment level variable.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The deployment variable was updated.", "schema": { "$ref": "#/definitions/deployment_variable" } }, "404": { "description": "The account, repository, environment or variable with the given UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The environment.", "required": true, "type": "string", "name": "environment_uuid", "in": "path" }, { "description": "The UUID of the variable to update.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" }, { "required": true, "in": "body", "description": "The updated deployment variable.", "name": "_body", "schema": { "$ref": "#/definitions/deployment_variable" } } ], "operationId": "updateDeploymentVariable" }, "delete": { "description": "Delete a deployment environment level variable.", "tags": [ "pipelines" ], "responses": { "204": { "description": "The variable was deleted." }, "404": { "description": "The account, repository, environment or variable with given UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The environment.", "required": true, "type": "string", "name": "environment_uuid", "in": "path" }, { "description": "The UUID of the variable to delete.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" } ], "operationId": "deleteDeploymentVariable" } }, "/repositories/{workspace}/{repo_slug}/diff/{spec}": { "get": { "responses": { "200": { "description": "The raw diff" }, "555": { "description": "If the diff was too large and timed out.\n\nSince this endpoint does not employ any form of pagination, but\ninstead returns the diff as a single document, it can run into\ntrouble on very large diffs. If Bitbucket times out in cases\nlike these, a 555 status code is returned.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Produces a raw, git-style diff for either a single commit (diffed\nagainst its first parent), or a revspec of 2 commits (e.g.\n`3a8b42..9ff173` where the first commit represents the source and the\nsecond commit the destination).\n\nIn case of the latter (diffing a revspec), a 3-way diff, or merge diff,\nis computed. This shows the changes introduced by the left branch\n(`3a8b42` in our example) as compared againt the right branch\n(`9ff173`).\n\nThis is equivalent to merging the left branch into the right branch and\nthen computing the diff of the merge commit against its first parent\n(the right branch). This follows the same behavior as pull requests\nthat also show this style of 3-way, or merge diff.\n\nWhile similar to patches, diffs:\n\n* Don't have a commit header (username, commit message, etc)\n* Support the optional `path=foo/bar.py` query param to filter\n the diff to just that one file diff\n\nThe raw diff is returned as-is, in whatever encoding the files in the\nrepository use. It is not decoded into unicode. As such, the\ncontent-type is `text/plain`.", "parameters": [ { "name": "context", "in": "query", "description": "Generate diffs with lines of context instead of the usual three.", "required": false, "type": "integer" }, { "name": "path", "in": "query", "description": "Limit the diff to a particular file (this parameter\ncan be repeated for multiple paths).", "required": false, "type": "string" }, { "name": "ignore_whitespace", "in": "query", "description": "Generate diffs that ignore whitespace.", "required": false, "type": "boolean" }, { "name": "binary", "in": "query", "description": "Generate diffs that include binary files, true if omitted.", "required": false, "type": "boolean" }, { "name": "renames", "in": "query", "description": "Whether to perform rename detection, true if omitted.", "required": false, "type": "boolean" }, { "name": "merge", "in": "query", "description": "If true, the source commit is merged into the\ndestination commit, and then a diff from the\ndestination to the merge result is returned. If false,\na simple 'two dot' diff between the source and\ndestination is returned. True if omitted.", "required": false, "type": "boolean" } ], "tags": [ "commits" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "spec", "in": "path", "description": "A commit SHA (e.g. `3a8b42`) or a commit range using double dot\nnotation (e.g. `3a8b42..9ff173`).\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/diffstat/{spec}": { "get": { "responses": { "200": { "description": "The diff stats", "schema": { "$ref": "#/definitions/paginated_diffstats" } }, "555": { "description": "If generating the diffstat timed out.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the diff stat for the specified commit.\n\nDiff stat responses contain a record for every path modified by the\ncommit and lists the number of lines added and removed for each file.\n\n\nExample:\n```\ncurl https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/diffstat/d222fa2..e174964\n{\n \"pagelen\": 500,\n \"values\": [\n {\n \"type\": \"diffstat\",\n \"status\": \"modified\",\n \"lines_removed\": 1,\n \"lines_added\": 2,\n \"old\": {\n \"path\": \"setup.py\",\n \"escaped_path\": \"setup.py\",\n \"type\": \"commit_file\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/src/e1749643d655d7c7014001a6c0f58abaf42ad850/setup.py\"\n }\n }\n },\n \"new\": {\n \"path\": \"setup.py\",\n \"escaped_path\": \"setup.py\",\n \"type\": \"commit_file\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/src/d222fa235229c55dad20b190b0b571adf737d5a6/setup.py\"\n }\n }\n }\n }\n ],\n \"page\": 1,\n \"size\": 1\n}\n```", "parameters": [], "tags": [] }, "parameters": [ { "name": "ignore_whitespace", "in": "query", "description": "Generate diffs that ignore whitespace", "required": false, "type": "boolean" }, { "name": "merge", "in": "query", "description": "If true, the source commit is merged into the\ndestination commit, and then a diffstat from the\ndestination to the merge result is returned. If false,\na simple 'two dot' diffstat between the source and\ndestination is returned. True if omitted.", "required": false, "type": "boolean" }, { "name": "path", "in": "query", "description": "Limit the diffstat to a particular file (this parameter\ncan be repeated for multiple paths).", "required": false, "type": "string" }, { "name": "renames", "in": "query", "description": "Whether to perform rename detection, true if omitted.", "required": false, "type": "boolean" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "spec", "in": "path", "description": "A commit SHA (e.g. `3a8b42`) or a commit range using double dot\nnotation (e.g. `3a8b42..9ff173`).\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/downloads": { "get": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a list of download links associated with the repository.", "parameters": [], "tags": [ "downloads" ] }, "post": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Upload new download artifacts.\n\nTo upload files, perform a `multipart/form-data` POST containing one\nor more `files` fields:\n\n $ echo Hello World > hello.txt\n $ curl -s -u evzijst -X POST https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads -F files=@hello.txt\n\nWhen a file is uploaded with the same name as an existing artifact,\nthen the existing file will be replaced.", "parameters": [], "tags": [ "downloads" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/downloads/{filename}": { "delete": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the specified download artifact from the repository.", "parameters": [], "tags": [ "downloads" ] }, "get": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Return a redirect to the contents of a download artifact.\n\nThis endpoint returns the actual file contents and not the artifact's\nmetadata.\n\n $ curl -s -L https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads/hello.txt\n Hello World", "parameters": [], "tags": [ "downloads" ] }, "parameters": [ { "name": "filename", "in": "path", "description": "Name of the file.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/environments/": { "post": { "description": "Create an environment.", "tags": [ "deployments" ], "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of the newly created environment." } }, "description": "The environment was created.", "schema": { "$ref": "#/definitions/deployment_environment" } }, "404": { "description": "The account or repository does not exist.", "schema": { "$ref": "#/definitions/error" } }, "409": { "description": "An environment host with the provided name already exists.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "in": "body", "description": "The environment to create.", "name": "_body", "schema": { "$ref": "#/definitions/deployment_environment" } } ], "operationId": "createEnvironment" }, "get": { "description": "Find environments", "tags": [ "deployments" ], "responses": { "200": { "description": "The matching environments.", "schema": { "$ref": "#/definitions/paginated_environments" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "operationId": "getEnvironmentsForRepository" } }, "/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}": { "get": { "description": "Retrieve an environment", "tags": [ "deployments" ], "responses": { "200": { "description": "The environment.", "schema": { "$ref": "#/definitions/deployment_environment" } }, "404": { "description": "No account, repository or environment with the UUID provided exists.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The environment UUID.", "required": true, "type": "string", "name": "environment_uuid", "in": "path" } ], "operationId": "getEnvironmentForRepository" }, "delete": { "description": "Delete an environment", "tags": [ "deployments" ], "responses": { "204": { "description": "The environment was deleted." }, "404": { "description": "No account or repository with the UUID provided exists.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The environment UUID.", "required": true, "type": "string", "name": "environment_uuid", "in": "path" } ], "operationId": "deleteEnvironmentForRepository" } }, "/repositories/{workspace}/{repo_slug}/environments/{environment_uuid}/changes/": { "post": { "description": "Update an environment", "tags": [ "deployments" ], "responses": { "202": { "description": "The environment update request was accepted." }, "404": { "description": "No account, repository or environment with the UUID provided exists.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The environment UUID.", "required": true, "type": "string", "name": "environment_uuid", "in": "path" } ], "operationId": "updateEnvironmentForRepository" } }, "/repositories/{workspace}/{repo_slug}/filehistory/{commit}/{path}": { "get": { "responses": { "200": { "description": "A paginated list of commits that modified the specified file", "schema": { "$ref": "#/definitions/paginated_files" } }, "404": { "description": "If the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of commits that modified the specified file.\n\nCommits are returned in reverse chronological order. This is roughly\nequivalent to the following commands:\n\n $ git log --follow --date-order \n\n $ hg log --follow \n\nBy default, Bitbucket will follow renames and the path name in the\nreturned entries reflects that. This can be turned off using the\n`?renames=false` query parameter.\n\nResults are returned in descending chronological order by default, and\nlike most endpoints you can\n[filter and sort](../../../../../../meta/filtering) the response to\nonly provide exactly the data you want.\n\nFor example, if you wanted to find commits made before 2011-05-18\nagainst a file named `README.rst`, but you only wanted the path and\ndate, your query would look like this:\n\n```\n$ curl 'https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/filehistory/master/README.rst'\\\n '?fields=values.next,values.path,values.commit.date&q=commit.date<=2011-05-18'\n{\n \"values\": [\n {\n \"commit\": {\n \"date\": \"2011-05-17T07:32:09+00:00\"\n },\n \"path\": \"README.rst\"\n },\n {\n \"commit\": {\n \"date\": \"2011-05-16T06:33:28+00:00\"\n },\n \"path\": \"README.txt\"\n },\n {\n \"commit\": {\n \"date\": \"2011-05-16T06:15:39+00:00\"\n },\n \"path\": \"README.txt\"\n }\n ]\n}\n```\n\nIn the response you can see that the file was renamed to `README.rst`\nby the commit made on 2011-05-16, and was previously named `README.txt`.", "parameters": [ { "name": "renames", "in": "query", "description": "\nWhen `true`, Bitbucket will follow the history of the file across\nrenames (this is the default behavior). This can be turned off by\nspecifying `false`.", "required": false, "type": "string" }, { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../../../../meta/filtering).", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nName of a response property sort the result by as per\n[filtering and sorting](../../../../../../meta/filtering#query-sort).\n", "required": false, "type": "string" } ], "tags": [ "source", "repositories" ] }, "parameters": [ { "name": "commit", "in": "path", "description": "The commit's SHA1.", "required": true, "type": "string" }, { "name": "path", "in": "path", "description": "Path to the file.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/forks": { "get": { "responses": { "200": { "description": "All forks.", "schema": { "$ref": "#/definitions/paginated_repositories" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all the forks of the specified\nrepository.", "parameters": [ { "name": "role", "in": "query", "description": "Filters the result based on the authenticated user's role on each repository.\n\n* **member**: returns repositories to which the user has explicit read access\n* **contributor**: returns repositories to which the user has explicit write access\n* **admin**: returns repositories to which the user has explicit administrator access\n* **owner**: returns all repositories owned by the current user\n", "required": false, "type": "string", "enum": [ "admin", "contributor", "member", "owner" ] }, { "name": "q", "in": "query", "description": "Query string to narrow down the response as per [filtering and sorting](../../../../meta/filtering).\n", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "Field by which the results should be sorted as per [filtering and sorting](../../../../meta/filtering).\n", "required": false, "type": "string" } ], "tags": [ "repositories" ] }, "post": { "responses": { "201": { "description": "The newly created fork.", "examples": { "application/json": { "scm": "git", "website": "www.example.com", "has_wiki": false, "description": "A repository for my bits and bobs", "language": "python", "fork_policy": "allow_forks", "links": { "clone": [ { "href": "https://bitbucket.org/example-username/bits_and_bobs.git", "name": "https" }, { "href": "git@bitbucket.org:example-username/bits_and_bobs.git", "name": "ssh" } ], "watchers": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/watchers" }, "branches": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/branches" }, "tags": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/tags" }, "commits": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commits" }, "downloads": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/downloads" }, "source": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/src" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" }, "forks": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/forks" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "pullrequests": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests" } }, "name": "bits_and_bobs", "created_on": "2018-06-20T23:17:33.616037+00:00", "mainbranch": { "type": "branch", "name": "master" }, "full_name": "example-username/bits_and_bobs", "has_issues": false, "owner": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" }, "updated_on": "2018-06-20T23:17:33.616037+00:00", "size": 33348, "type": "repository", "slug": "bits_and_bobs", "is_private": true, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "schema": { "$ref": "#/definitions/repository" }, "headers": { "Location": { "type": "string", "description": "The URL of the newly created fork" } } } }, "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new fork of the specified repository.\n\n## Forking a repository\n\nTo create a fork, specify the workspace explicitly as part of the\nrequest body:\n\n```\n$ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/atlassian/bbql/forks \\\n -H 'Content-Type: application/json' -d '{\n \"name\": \"bbql_fork\",\n \"workspace\": {\n \"slug\": \"atlassian\"\n }\n}'\n```\n\nTo fork a repository into the same workspace, also specify a new `name`.\n\nWhen you specify a value for `name`, it will also affect the `slug`.\nThe `slug` is reflected in the repository URL of the new fork. It is\nderived from `name` by substituting non-ASCII characters, removes\nwhitespace, and changes characters to lower case. For example,\n`My repo` would turn into `my_repo`.\n\nYou need contributor access to create new forks within a workspace.\n\n\n## Change the properties of a new fork\n\nBy default the fork inherits most of its properties from the parent.\nHowever, since the optional POST body document follows the normal\n`repository` JSON schema and you can override the new fork's\nproperties.\n\nProperties that can be overridden include:\n\n* description\n* fork_policy\n* language\n* mainbranch\n* is_private (note that a private repo's fork_policy might prohibit\n the creation of public forks, in which `is_private=False` would fail)\n* has_issues (to initialize or disable the new repo's issue tracker --\n note that the actual contents of the parent repository's issue\n tracker are not copied during forking)\n* has_wiki (to initialize or disable the new repo's wiki --\n note that the actual contents of the parent repository's wiki are not\n copied during forking)\n* project (when forking into a private project, the fork's `is_private`\n must be `true`)\n\nProperties that cannot be modified include:\n\n* scm\n* parent\n* full_name", "parameters": [ { "name": "_body", "in": "body", "description": "A repository object. This can be left blank.", "required": false, "schema": { "$ref": "#/definitions/repository" } } ], "tags": [ "repositories" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/hooks": { "get": { "responses": { "200": { "description": "The paginated list of installed webhooks.", "schema": { "$ref": "#/definitions/paginated_webhook_subscriptions" } }, "403": { "description": "If the authenticated user does not have permission to access the webhooks.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of webhooks installed on this repository.\n\nThe teams endpoint for projects has been deprecated, and you should\nensure you are using the workspaces endpoint.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [], "tags": [ "repositories", "webhooks" ] }, "post": { "responses": { "201": { "description": "If the webhook was registered successfully.", "schema": { "$ref": "#/definitions/webhook_subscription" }, "headers": { "Location": { "type": "string", "description": "The URL of new newly created webhook." } } }, "403": { "description": "If the authenticated user does not have permission to install webhooks on the specified repository.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new webhook on the specified repository.\n\nThe teams endpoint for projects has been deprecated, and you should\nensure you are using the workspaces endpoint.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).\n\nExample:\n\n```\n$ curl -X POST -u credentials -H 'Content-Type: application/json' https://api.bitbucket.org/2.0/repositories/username/slug/hooks -d '\n {\n \"description\": \"Webhook Description\",\n \"url\": \"https://example.com/\",\n \"active\": true,\n \"events\": [\n \"repo:push\",\n \"issue:created\",\n \"issue:updated\"\n ]\n }'\n```\n\nNote that this call requires the webhook scope, as well as any scope\nthat applies to the events that the webhook subscribes to. In the\nexample above that means: `webhook`, `repository` and `issue`.\n\nAlso note that the `url` must properly resolve and cannot be an\ninternal, non-routed address.", "parameters": [], "tags": [ "repositories", "webhooks" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/hooks/{uid}": { "delete": { "responses": { "204": { "description": "When the webhook was deleted successfully" }, "403": { "description": "If the authenticated user does not have permission to delete the webhook.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the webhook or repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the specified webhook subscription from the given\nrepository.", "parameters": [], "tags": [ "repositories", "webhooks" ] }, "get": { "responses": { "200": { "description": "The webhook subscription object.", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "404": { "description": "If the webhook or repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the webhook with the specified id installed on the specified\nrepository.", "parameters": [], "tags": [ "repositories", "webhooks" ] }, "put": { "responses": { "200": { "description": "The webhook subscription object.", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "403": { "description": "If the authenticated user does not have permission to update the webhook.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the webhook or repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates the specified webhook subscription.\n\nThe following properties can be mutated:\n\n* `description`\n* `url`\n* `active`\n* `events`", "parameters": [], "tags": [ "repositories", "webhooks" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "uid", "in": "path", "description": "Installed webhook's ID", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues": { "get": { "responses": { "200": { "description": "A paginated list of the issues matching any filter criteria that were provided.", "schema": { "$ref": "#/definitions/paginated_issues" } }, "404": { "description": "The specified repository does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the issues in the issue tracker.", "parameters": [], "tags": [ "issue_tracker" ] }, "post": { "responses": { "201": { "description": "The newly created issue.", "schema": { "$ref": "#/definitions/issue" }, "headers": { "Location": { "type": "string", "description": "The (absolute) URL of the newly created issue." } } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "When the authenticated user isn't authorized to create the issue.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new issue.\n\nThis call requires authentication. Private repositories or private\nissue trackers require the caller to authenticate with an account that\nhas appropriate authorization.\n\nThe authenticated user is used for the issue's `reporter` field.", "parameters": [ { "name": "_body", "in": "body", "description": "The new issue. The only required element is `title`. All other elements can be omitted from the body.", "required": true, "schema": { "$ref": "#/definitions/issue" } } ], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/export": { "post": { "responses": { "202": { "description": "The export job has been accepted" }, "401": { "description": "The request wasn't authenticated properly", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "When the authenticated user does not have admin permission on the repo", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The repo does not exist or does not have an issue tracker", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue", "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "A POST request to this endpoint initiates a new background celery task that archives the repo's issues.\n\nFor example, you can run:\n\ncurl -u -X POST http://api.bitbucket.org/2.0/repositories///\nissues/export\n\nWhen the job has been accepted, it will return a 202 (Accepted) along with a unique url to this job in the\n'Location' response header. This url is the endpoint for where the user can obtain their zip files.\"", "parameters": [ { "name": "_body", "in": "body", "description": "The options to apply to the export. Available options include `project_key` and `project_name` which, if specified, are used as the project key and name in the exported Jira json format. Option `send_email` specifies whether an email should be sent upon export result. Option `include_attachments` specifies whether attachments are included in the export.", "required": false, "schema": { "$ref": "#/definitions/export_options" } } ], "tags": [] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/export/{repo_name}-issues-{task_id}.zip": { "get": { "responses": { "202": { "description": "Export job accepted", "schema": { "$ref": "#/definitions/issue_job_status" } }, "401": { "description": "The request wasn't authenticated properly", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "When the authenticated user does not have admin permission on the repo", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "No export job has begun", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue", "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "This endpoint is used to poll for the progress of an issue export\njob and return the zip file after the job is complete.\nAs long as the job is running, this will return a 200 response\nwith in the response body a description of the current status.\n\nAfter the job has been scheduled, but before it starts executing, this\nendpoint's response is:\n\n{\n \"type\": \"issue_job_status\",\n \"status\": \"ACCEPTED\",\n \"phase\": \"Initializing\",\n \"total\": 0,\n \"count\": 0,\n \"pct\": 0\n}\n\n\nThen once it starts running, it becomes:\n\n{\n \"type\": \"issue_job_status\",\n \"status\": \"STARTED\",\n \"phase\": \"Attachments\",\n \"total\": 15,\n \"count\": 11,\n \"pct\": 73\n}\n\nOnce the job has successfully completed, it returns a stream of the zip file.", "parameters": [], "tags": [] }, "parameters": [ { "name": "repo_name", "in": "path", "description": "The name of the repo", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "task_id", "in": "path", "description": "The ID of the export task", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/import": { "get": { "responses": { "200": { "description": "Import job complete with either FAILURE or SUCCESS status", "schema": { "$ref": "#/definitions/issue_job_status" } }, "202": { "description": "Import job started", "schema": { "$ref": "#/definitions/issue_job_status" } }, "401": { "description": "The request wasn't authenticated properly", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "When the authenticated user does not have admin permission on the repo", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "No export job has begun", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue:write", "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "When using GET, this endpoint reports the status of the current import task. Request example:\n\n```\n$ curl -u -X GET https://api.bitbucket.org/2.0/repositories///issues/import\n```\n\nAfter the job has been scheduled, but before it starts executing, this endpoint's response is:\n\n```\n< HTTP/1.1 202 Accepted\n{\n \"type\": \"issue_job_status\",\n \"status\": \"PENDING\",\n \"phase\": \"Attachments\",\n \"total\": 15,\n \"count\": 0,\n \"percent\": 0\n}\n```\n\nOnce it starts running, it is a 202 response with status STARTED and progress filled.\n\nAfter it is finished, it becomes a 200 response with status SUCCESS or FAILURE.", "parameters": [], "tags": [] }, "post": { "responses": { "202": { "description": "Import job accepted", "schema": { "$ref": "#/definitions/issue_job_status" } }, "401": { "description": "The request wasn't authenticated properly", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "When the authenticated user does not have admin permission on the repo", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "No export job has begun", "schema": { "$ref": "#/definitions/error" } }, "409": { "description": "Import already running", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue:write", "repository:admin" ] }, { "basic": [] }, { "api_key": [] } ], "description": "A POST request to this endpoint will import the zip file given by the archive parameter into the repository. All\nexisting issues will be deleted and replaced by the contents of the imported zip file.\n\nImports are done through a multipart/form-data POST. There is one valid and required form field, with the name\n\"archive,\" which needs to be a file field:\n\n```\n$ curl -u -X POST -F archive=@/path/to/file.zip https://api.bitbucket.org/2.0/repositories///issues/import\n```\n\nWhen the import job is accepted, here is example output:\n\n```\n< HTTP/1.1 202 Accepted\n\n{\n \"type\": \"issue_job_status\",\n \"status\": \"ACCEPTED\",\n \"phase\": \"Attachments\",\n \"total\": 15,\n \"count\": 0,\n \"percent\": 0\n}\n```", "parameters": [], "tags": [] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/{issue_id}": { "delete": { "responses": { "200": { "description": "The issue object.", "schema": { "$ref": "#/definitions/issue" } }, "403": { "description": "When the authenticated user isn't authorized to delete the issue.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository or issue does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the specified issue. This requires write access to the\nrepository.", "parameters": [], "tags": [ "issue_tracker" ] }, "get": { "responses": { "200": { "description": "The issue object.", "schema": { "$ref": "#/definitions/issue" } }, "403": { "description": "When the authenticated user isn't authorized to access the issue.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository or issue does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } }, "410": { "description": "The specified issue is unavailable.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified issue.", "parameters": [], "tags": [ "issue_tracker" ] }, "put": { "responses": { "200": { "description": "The updated issue object.", "schema": { "$ref": "#/definitions/issue" } }, "403": { "description": "When the authenticated user isn't authorized to access the issue.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository or issue does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Modifies the issue.\n\n```\n$ curl https://api.bitbucket.org/2.0/repostories/evzijst/dogslow/issues/123 \\\n -u evzijst -s -X PUT -H 'Content-Type: application/json' \\\n -d '{\n \"title\": \"Updated title\",\n \"assignee\": {\n \"username\": \"evzijst\"\n },\n \"priority\": \"minor\",\n \"version\": {\n \"name\": \"1.0\"\n },\n \"component\": null\n}'\n```\n\nThis example changes the `title`, `assignee`, `priority` and the\n`version`. It also removes the value of the `component` from the issue\nby setting the field to `null`. Any field not present keeps its existing\nvalue.\n\nEach time an issue is edited in the UI or through the API, an immutable\nchange record is created under the `/issues/123/changes` endpoint. It\nalso has a comment associated with the change.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "issue_id", "in": "path", "description": "The issue id", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments": { "get": { "responses": { "200": { "description": "A paginated list of all attachments for this issue.", "schema": { "$ref": "#/definitions/paginated_issue_attachments" } }, "401": { "description": "If the issue tracker is private and the request was not authenticated." }, "404": { "description": "The specified repository or issue does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all attachments for this issue.\n\nThis returns the files' meta data. This does not return the files'\nactual contents.\n\nThe files are always ordered by their upload date.", "parameters": [], "tags": [ "issue_tracker" ] }, "post": { "responses": { "201": { "description": "An empty response document.", "headers": { "Location": { "type": "string", "description": "The URL to the issue's collection of attachments." } } }, "400": { "description": "If no files were uploaded, or if the wrong `Content-Type` was used." }, "401": { "description": "If the issue tracker is private and the request was not authenticated." }, "404": { "description": "The specified repository or issue does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Upload new issue attachments.\n\nTo upload files, perform a `multipart/form-data` POST containing one\nor more file fields.\n\nWhen a file is uploaded with the same name as an existing attachment,\nthen the existing file will be replaced.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "issue_id", "in": "path", "description": "The issue id", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}": { "delete": { "responses": { "204": { "description": "Indicates that the deletion was successful" }, "401": { "description": "If the issue tracker is private and the request was not authenticated." }, "404": { "description": "The specified repository or issue does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes an attachment.", "parameters": [], "tags": [ "issue_tracker" ] }, "get": { "responses": { "302": { "description": "A redirect to the file's contents", "headers": { "Location": { "type": "string" } } }, "401": { "description": "If the issue tracker is private and the request was not authenticated." }, "404": { "description": "The specified repository or issue does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the contents of the specified file attachment.\n\nNote that this endpoint does not return a JSON response, but instead\nreturns a redirect pointing to the actual file that in turn will return\nthe raw contents.\n\nThe redirect URL contains a one-time token that has a limited lifetime.\nAs a result, the link should not be persisted, stored, or shared.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "issue_id", "in": "path", "description": "The issue id", "required": true, "type": "string" }, { "name": "path", "in": "path", "description": "Path to the file.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes": { "get": { "responses": { "200": { "description": "Returns all the issue changes that were made on the specified issue.", "schema": { "$ref": "#/definitions/paginated_log_entries" } }, "404": { "description": "The specified repository or issue does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the list of all changes that have been made to the specified\nissue. Changes are returned in chronological order with the oldest\nchange first.\n\nEach time an issue is edited in the UI or through the API, an immutable\nchange record is created under the `/issues/123/changes` endpoint. It\nalso has a comment associated with the change.\n\nNote that this operation is changing significantly, due to privacy changes.\nSee the [announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#changes-to-the-issue-changes-api)\nfor details.\n\n```\n$ curl -s https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/issues/1/changes - | jq .\n\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"changes\": {\n \"priority\": {\n \"new\": \"trivial\",\n \"old\": \"major\"\n },\n \"assignee\": {\n \"new\": \"\",\n \"old\": \"evzijst\"\n },\n \"assignee_account_id\": {\n \"new\": \"\",\n \"old\": \"557058:c0b72ad0-1cb5-4018-9cdc-0cde8492c443\"\n },\n \"kind\": {\n \"new\": \"enhancement\",\n \"old\": \"bug\"\n }\n },\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/issues/1/changes/2\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/evzijst/dogslow/issues/1#comment-2\"\n }\n },\n \"issue\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/issues/1\"\n }\n },\n \"type\": \"issue\",\n \"id\": 1,\n \"repository\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/evzijst/dogslow\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/evzijst/dogslow\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/evzijst/dogslow/avatar/32/\"\n }\n },\n \"type\": \"repository\",\n \"name\": \"dogslow\",\n \"full_name\": \"evzijst/dogslow\",\n \"uuid\": \"{988b17c6-1a47-4e70-84ee-854d5f012bf6}\"\n },\n \"title\": \"Updated title\"\n },\n \"created_on\": \"2018-03-03T00:35:28.353630+00:00\",\n \"user\": {\n \"username\": \"evzijst\",\n \"nickname\": \"evzijst\",\n \"display_name\": \"evzijst\",\n \"type\": \"user\",\n \"uuid\": \"{aaa7972b-38af-4fb1-802d-6e3854c95778}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/evzijst\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/evzijst/\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/evzijst/avatar/32/\"\n }\n }\n },\n \"message\": {\n \"raw\": \"Removed assignee, changed kind and priority.\",\n \"markup\": \"markdown\",\n \"html\": \"

Removed assignee, changed kind and priority.

\",\n \"type\": \"rendered\"\n },\n \"type\": \"issue_change\",\n \"id\": 2\n }\n ],\n \"page\": 1\n}\n```\n\nChanges support [filtering and sorting](../../../meta/filtering) that\ncan be used to search for specific changes. For instance, to see\nwhen an issue transitioned to \"resolved\":\n\n```\n$ curl -s https://api.bitbucket.org/2.0/repositories/site/master/issues/1/changes \\\n -G --data-urlencode='q=changes.state.new = \"resolved\"'\n```\n\nThis resource is only available on repositories that have the issue\ntracker enabled.\n\nN.B.\n\nThe `changes.assignee` and `changes.assignee_account_id` fields are not\na `user` object. Instead, they contain the raw `username` and\n`account_id` of the user. This is to protect the integrity of the audit\nlog even after a user account gets deleted.\n\nThe `changes.assignee` field is deprecated will disappear in the\nfuture. Use `changes.assignee_account_id` instead.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response. See\n[filtering and sorting](../../../meta/filtering) for details.", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nName of a response property to sort results. See\n[filtering and sorting](../../../meta/filtering#query-sort)\nfor details.\n", "required": false, "type": "string" } ], "tags": [ "issue_tracker" ] }, "post": { "responses": { "201": { "description": "The newly created issue change.", "schema": { "$ref": "#/definitions/issue_change" }, "headers": { "Location": { "type": "string", "description": "The (absolute) URL of the newly created issue change." } } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "When the authenticated user isn't authorized to modify the issue.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository or issue does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Makes a change to the specified issue.\n\nFor example, to change an issue's state and assignee, create a new\nchange object that modifies these fields:\n\n```\ncurl https://api.bitbucket.org/2.0/site/master/issues/1234/changes \\\n -s -u evzijst -X POST -H \"Content-Type: application/json\" \\\n -d '{\n \"changes\": {\n \"assignee_account_id\": {\n \"new\": \"557058:c0b72ad0-1cb5-4018-9cdc-0cde8492c443\"\n },\n \"state\": {\n \"new\": 'resolved\"\n }\n }\n \"message\": {\n \"raw\": \"This is now resolved.\"\n }\n }'\n```\n\nThe above example also includes a custom comment to go alongside the\nchange. This comment will also be visible on the issue page in the UI.\n\nThe fields of the `changes` object are strings, not objects. This\nallows for immutable change log records, even after user accounts,\nmilestones, or other objects recorded in a change entry, get renamed or\ndeleted.\n\nThe `assignee_account_id` field stores the account id. When POSTing a\nnew change and changing the assignee, the client should therefore use\nthe user's account_id in the `changes.assignee_account_id.new` field.\n\nThis call requires authentication. Private repositories or private\nissue trackers require the caller to authenticate with an account that\nhas appropriate authorization.", "parameters": [ { "name": "_body", "in": "body", "description": "The new issue state change. The only required elements are `changes.[].new`. All other elements can be omitted from the body.", "required": true, "schema": { "$ref": "#/definitions/issue_change" } } ], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "issue_id", "in": "path", "description": "The issue id", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/{issue_id}/changes/{change_id}": { "get": { "responses": { "200": { "description": "The specified issue change object.", "schema": { "$ref": "#/definitions/issue_change" } }, "404": { "description": "The specified repository or issue change does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified issue change object.\n\nThis resource is only available on repositories that have the issue\ntracker enabled.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "change_id", "in": "path", "description": "The issue change id", "required": true, "type": "string" }, { "name": "issue_id", "in": "path", "description": "The issue id", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments": { "get": { "responses": { "200": { "description": "A paginated list of issue comments.", "schema": { "$ref": "#/definitions/paginated_issue_comments" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all comments that were made on the\nspecified issue.\n\nThe default sorting is oldest to newest and can be overridden with\nthe `sort` query parameter.\n\nThis endpoint also supports filtering and sorting of the results. See\n[filtering and sorting](../../../../../../meta/filtering) for more details.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../../../../meta/filtering).", "required": false, "type": "string" } ], "tags": [ "issue_tracker" ] }, "post": { "responses": { "201": { "description": "The newly created comment.", "headers": { "Location": { "type": "string", "description": "The location of the newly issue comment." } } }, "400": { "description": "If the input was invalid, or if the comment being created is detected as spam ", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new issue comment.\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/issues/42/comments/ \\\n -X POST -u evzijst \\\n -H 'Content-Type: application/json' \\\n -d '{\"content\": {\"raw\": \"Lorem ipsum.\"}}'\n```", "parameters": [ { "name": "_body", "in": "body", "description": "The new issue comment object.", "required": true, "schema": { "$ref": "#/definitions/issue_comment" } } ], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "issue_id", "in": "path", "description": "The issue id", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}": { "delete": { "responses": { "204": { "description": "Indicates successful deletion." } }, "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the specified comment.", "parameters": [ { "name": "_body", "in": "body", "description": "The updated comment.", "required": true, "schema": { "$ref": "#/definitions/issue_comment" } } ], "tags": [ "issue_tracker" ] }, "get": { "responses": { "200": { "description": "The issue comment.", "schema": { "$ref": "#/definitions/issue_comment" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified issue comment object.", "parameters": [], "tags": [ "issue_tracker" ] }, "put": { "responses": { "200": { "description": "The updated issue comment.", "schema": { "$ref": "#/definitions/issue_comment" } }, "400": { "description": "If the input was invalid, or if the update to the comment is detected as spam ", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates the content of the specified issue comment. Note that only\nthe `content.raw` field can be modified.\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/issues/42/comments/5728901 \\\n -X PUT -u evzijst \\\n -H 'Content-Type: application/json' \\\n -d '{\"content\": {\"raw\": \"Lorem ipsum.\"}'\n```", "parameters": [ { "name": "_body", "in": "body", "description": "The updated comment.", "required": true, "schema": { "$ref": "#/definitions/issue_comment" } } ], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "comment_id", "in": "path", "description": "The id of the comment.", "required": true, "type": "integer" }, { "name": "issue_id", "in": "path", "description": "The issue id", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/{issue_id}/vote": { "delete": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account:write", "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Retract your vote.", "parameters": [], "tags": [ "issue_tracker" ] }, "get": { "responses": { "204": { "description": "If the authenticated user has not voted for this issue.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the authenticated user has not voted for this issue, or when the repo does not exist, or does not have an issue tracker.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account", "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Check whether the authenticated user has voted for this issue.\nA 204 status code indicates that the user has voted, while a 404\nimplies they haven't.", "parameters": [], "tags": [ "issue_tracker" ] }, "put": { "responses": { "204": { "description": "Indicating the authenticated user has cast their vote successfully.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository or issue does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account:write", "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Vote for this issue.\n\nTo cast your vote, do an empty PUT. The 204 status code indicates that\nthe operation was successful.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "issue_id", "in": "path", "description": "The issue id", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/issues/{issue_id}/watch": { "delete": { "responses": { "204": { "description": "Indicates that the authenticated user successfully stopped watching this issue.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository or issue does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account:write", "issue:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Stop watching this issue.", "parameters": [], "tags": [ "issue_tracker" ] }, "get": { "responses": { "204": { "description": "If the authenticated user is watching this issue.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the authenticated user is not watching this issue, or when the repo does not exist, or does not have an issue tracker.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account", "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Indicated whether or not the authenticated user is watching this\nissue.", "parameters": [], "tags": [ "issue_tracker" ] }, "put": { "responses": { "204": { "description": "Indicates that the authenticated user successfully started watching this issue.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the authenticated user is not watching this issue, or when the repo does not exist, or does not have an issue tracker.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account:write", "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Start watching this issue.\n\nTo start watching this issue, do an empty PUT. The 204 status code\nindicates that the operation was successful.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "issue_id", "in": "path", "description": "The issue id", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/merge-base/{revspec}": { "get": { "responses": { "200": { "description": "The merge base of the provided spec.", "schema": { "$ref": "#/definitions/commit" } }, "401": { "description": "If the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the authenticated user does not have access to any of the repositories specified.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository or ref in the spec does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the best common ancestor between two commits, specified in a revspec\nof 2 commits (e.g. 3a8b42..9ff173).\n\nIf more than one best common ancestor exists, only one will be returned. It is\nunspecified which will be returned.", "parameters": [], "tags": [ "commits" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "revspec", "in": "path", "description": "A commit range using double dot notation (e.g. `3a8b42..9ff173`).\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/milestones": { "get": { "responses": { "200": { "description": "The milestones that have been defined in the issue tracker.", "schema": { "$ref": "#/definitions/paginated_milestones" } }, "404": { "description": "The specified repository does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the milestones that have been defined in the issue tracker.\n\nThis resource is only available on repositories that have the issue\ntracker enabled.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/milestones/{milestone_id}": { "get": { "responses": { "200": { "description": "The specified milestone object.", "schema": { "$ref": "#/definitions/milestone" } }, "404": { "description": "The specified repository or milestone does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified issue tracker milestone object.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "milestone_id", "in": "path", "description": "The milestone's id", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/patch/{spec}": { "get": { "responses": { "200": { "description": "The raw patches" }, "555": { "description": "If the diff was too large and timed out.\n\nSince this endpoint does not employ any form of pagination, but\ninstead returns the diff as a single document, it can run into\ntrouble on very large diffs. If Bitbucket times out in cases\nlike these, a 555 status code is returned.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Produces a raw patch for a single commit (diffed against its first\nparent), or a patch-series for a revspec of 2 commits (e.g.\n`3a8b42..9ff173` where the first commit represents the source and the\nsecond commit the destination).\n\nIn case of the latter (diffing a revspec), a patch series is returned\nfor the commits on the source branch (`3a8b42` and its ancestors in\nour example). For Mercurial, a single patch is returned that combines\nthe changes of all commits on the source branch.\n\nWhile similar to diffs, patches:\n\n* Have a commit header (username, commit message, etc)\n* Do not support the `path=foo/bar.py` query parameter\n\nThe raw patch is returned as-is, in whatever encoding the files in the\nrepository use. It is not decoded into unicode. As such, the\ncontent-type is `text/plain`.", "parameters": [], "tags": [ "commits" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "spec", "in": "path", "description": "A commit SHA (e.g. `3a8b42`) or a commit range using double dot\nnotation (e.g. `3a8b42..9ff173`).\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pipelines-config/caches/": { "get": { "description": "Retrieve the repository pipelines caches.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The list of caches for the given repository.", "schema": { "$ref": "#/definitions/paginated_pipeline_caches" } }, "404": { "description": "The account or repository was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "workspace", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "operationId": "getRepositoryPipelineCaches" } }, "/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}": { "delete": { "description": "Delete a repository cache.", "tags": [ "pipelines" ], "responses": { "204": { "description": "The cache was deleted." }, "404": { "description": "The workspace, repository or cache_uuid with given UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "workspace", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the cache to delete.", "required": true, "type": "string", "name": "cache_uuid", "in": "path" } ], "operationId": "deleteRepositoryPipelineCache" } }, "/repositories/{workspace}/{repo_slug}/pipelines-config/caches/{cache_uuid}/content-uri": { "get": { "description": "Retrieve the URI of the content of the specified cache.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The cache content uri.", "schema": { "$ref": "#/definitions/pipeline_cache_content_uri" } }, "404": { "description": "The workspace, repository or cache_uuid with given UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "workspace", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the cache.", "required": true, "type": "string", "name": "cache_uuid", "in": "path" } ], "operationId": "getRepositoryPipelineCacheContentURI" } }, "/repositories/{workspace}/{repo_slug}/pipelines/": { "post": { "description": "Endpoint to create and initiate a pipeline.\nThere are a couple of different options to initiate a pipeline, where the payload of the request will determine which type of pipeline will be instantiated.\n# Trigger a Pipeline for a branch\nOne way to trigger pipelines is by specifying the branch for which you want to trigger a pipeline.\nThe specified branch will be used to determine which pipeline definition from the `bitbucket-pipelines.yml` file will be applied to initiate the pipeline. The pipeline will then do a clone of the repository and checkout the latest revision of the specified branch.\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\\n -d '\n {\n \"target\": {\n \"ref_type\": \"branch\",\n \"type\": \"pipeline_ref_target\",\n \"ref_name\": \"master\"\n }\n }'\n```\n# Trigger a Pipeline for a commit on a branch or tag\nYou can initiate a pipeline for a specific commit and in the context of a specified reference (e.g. a branch, tag or bookmark).\nThe specified reference will be used to determine which pipeline definition from the bitbucket-pipelines.yml file will be applied to initiate the pipeline. The pipeline will clone the repository and then do a checkout the specified reference.\n\nThe following reference types are supported:\n\n* `branch`\n* `named_branch`\n* `bookmark`\n * `tag`\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\\n -d '\n {\n \"target\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"ce5b7431602f7cbba007062eeb55225c6e18e956\"\n },\n \"ref_type\": \"branch\",\n \"type\": \"pipeline_ref_target\",\n \"ref_name\": \"master\"\n }\n }'\n```\n# Trigger a specific pipeline definition for a commit\nYou can trigger a specific pipeline that is defined in your `bitbucket-pipelines.yml` file for a specific commit.\nIn addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition. The resulting pipeline will then clone the repository and checkout the specified revision.\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\\n -d '\n {\n \"target\": {\n \"commit\": {\n \"hash\":\"a3c4e02c9a3755eccdc3764e6ea13facdf30f923\",\n \"type\":\"commit\"\n },\n \"selector\": {\n \"type\":\"custom\",\n \"pattern\":\"Deploy to production\"\n },\n \"type\":\"pipeline_commit_target\"\n }\n }'\n```\n# Trigger a specific pipeline definition for a commit on a branch or tag\nYou can trigger a specific pipeline that is defined in your `bitbucket-pipelines.yml` file for a specific commit in the context of a specified reference.\nIn addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition, as well as the reference information. The resulting pipeline will then clone the repository a checkout the specified reference.\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\\n -d '\n {\n \"target\": {\n \"commit\": {\n \"hash\":\"a3c4e02c9a3755eccdc3764e6ea13facdf30f923\",\n \"type\":\"commit\"\n },\n \"selector\": {\n \"type\": \"custom\",\n \"pattern\": \"Deploy to production\"\n },\n \"type\": \"pipeline_ref_target\",\n \"ref_name\": \"master\",\n \"ref_type\": \"branch\"\n }\n }'\n```\n\n\n# Trigger a custom pipeline with variables\nIn addition to triggering a custom pipeline that is defined in your `bitbucket-pipelines.yml` file as shown in the examples above, you can specify variables that will be available for your build. In the request, provide a list of variables, specifying the following for each variable: key, value, and whether it should be secured or not (this field is optional and defaults to not secured).\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \\\n -d '\n {\n \"target\": {\n \"type\": \"pipeline_ref_target\",\n \"ref_type\": \"branch\",\n \"ref_name\": \"master\",\n \"selector\": {\n \"type\": \"custom\",\n \"pattern\": \"Deploy to production\"\n }\n },\n \"variables\": [\n {\n \"key\": \"var1key\",\n \"value\": \"var1value\",\n \"secured\": true\n },\n {\n \"key\": \"var2key\",\n \"value\": \"var2value\"\n }\n ]\n }'\n```\n\n# Trigger a pull request pipeline\n\nYou can also initiate a pipeline for a specific pull request.\n\n### Example\n\n```\n$ curl -X POST -is -u username:password \\\n -H 'Content-Type: application/json' \\\n https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \\\n -d '\n {\n\t\"target\": {\n \"type\": \"pipeline_pullrequest_target\",\n\t \"source\": \"pull-request-branch\",\n \"destination\": \"master\",\n \"destination_commit\": {\n \t \"hash\" : \"9f848b7\"\n },\n \"commit\": {\n \t\"hash\" : \"1a372fc\"\n },\n \"pullrequest\" : {\n \t\"id\" : \"3\"\n },\n\t \"selector\": {\n \"type\": \"pull-requests\",\n \"pattern\": \"**\"\n }\n }\n }'\n```\n", "tags": [ "pipelines" ], "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of the newly created pipeline." } }, "description": "The initiated pipeline.", "schema": { "$ref": "#/definitions/pipeline" } }, "400": { "description": "The account or repository is not enabled, the yml file does not exist in the repository for the given revision, or the request body contained invalid properties.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The account or repository was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "in": "body", "description": "The pipeline to initiate.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline" } } ], "operationId": "createPipelineForRepository" }, "get": { "description": "Find pipelines", "tags": [ "pipelines" ], "responses": { "200": { "description": "The matching pipelines.", "schema": { "$ref": "#/definitions/paginated_pipelines" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "operationId": "getPipelinesForRepository" } }, "/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}": { "get": { "description": "Retrieve a specified pipeline", "tags": [ "pipelines" ], "responses": { "200": { "description": "The pipeline.", "schema": { "$ref": "#/definitions/pipeline" } }, "404": { "description": "No account, repository or pipeline with the UUID provided exists.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The pipeline UUID.", "required": true, "type": "string", "name": "pipeline_uuid", "in": "path" } ], "operationId": "getPipelineForRepository" } }, "/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/": { "get": { "description": "Find steps for the given pipeline.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The steps.", "schema": { "$ref": "#/definitions/paginated_pipeline_steps" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the pipeline.", "required": true, "type": "string", "name": "pipeline_uuid", "in": "path" } ], "operationId": "getPipelineStepsForRepository" } }, "/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}": { "get": { "description": "Retrieve a given step of a pipeline.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The step.", "schema": { "$ref": "#/definitions/pipeline_step" } }, "404": { "description": "No account, repository, pipeline or step with the UUID provided exists for the pipeline with the UUID provided.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the pipeline.", "required": true, "type": "string", "name": "pipeline_uuid", "in": "path" }, { "description": "The UUID of the step.", "required": true, "type": "string", "name": "step_uuid", "in": "path" } ], "operationId": "getPipelineStepForRepository" } }, "/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/log": { "get": { "responses": { "200": { "description": "The raw log file for this pipeline step." }, "304": { "description": "The log has the same etag as the provided If-None-Match header.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "A pipeline with the given UUID does not exist, a step with the given UUID does not exist in the pipeline or a log file does not exist for the given step.", "schema": { "$ref": "#/definitions/error" } }, "416": { "description": "The requested range does not exist for requests that specified the [HTTP Range header](https://tools.ietf.org/html/rfc7233#section-3.1).", "schema": { "$ref": "#/definitions/error" } } }, "description": "Retrieve the log file for a given step of a pipeline.\n\nThis endpoint supports (and encourages!) the use of [HTTP Range requests](https://tools.ietf.org/html/rfc7233) to deal with potentially very large log files.", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the pipeline.", "required": true, "type": "string", "name": "pipeline_uuid", "in": "path" }, { "description": "The UUID of the step.", "required": true, "type": "string", "name": "step_uuid", "in": "path" } ], "tags": [ "pipelines" ], "produces": [ "application/octet-stream" ], "operationId": "getPipelineStepLogForRepository" } }, "/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/logs/{log_uuid}": { "get": {} }, "/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports": { "get": {} }, "/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases": { "get": {} }, "/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/test_reports/test_cases/{test_case_uuid}/test_case_reasons": { "get": {} }, "/repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/stopPipeline": { "post": { "description": "Signal the stop of a pipeline and all of its steps that not have completed yet.", "tags": [ "pipelines" ], "responses": { "204": { "description": "The pipeline has been signaled to stop." }, "400": { "description": "The specified pipeline has already completed.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "Either the account, repository or pipeline with the given UUID does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the pipeline.", "required": true, "type": "string", "name": "pipeline_uuid", "in": "path" } ], "operationId": "stopPipeline" } }, "/repositories/{workspace}/{repo_slug}/pipelines_config": { "put": { "description": "Update the pipelines configuration for a repository.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The repository pipelines configuration was updated.", "schema": { "$ref": "#/definitions/pipelines_config" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The updated repository pipelines configuration.", "required": true, "in": "body", "name": "_body", "schema": { "$ref": "#/definitions/pipelines_config" } } ], "operationId": "updateRepositoryPipelineConfig" }, "get": { "description": "Retrieve the repository pipelines configuration.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The repository pipelines configuration.", "schema": { "$ref": "#/definitions/pipelines_config" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "workspace", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "operationId": "getRepositoryPipelineConfig" } }, "/repositories/{workspace}/{repo_slug}/pipelines_config/build_number": { "put": { "description": "Update the next build number that should be assigned to a pipeline. The next build number that will be configured has to be strictly higher than the current latest build number for this repository.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The build number has been configured.", "schema": { "$ref": "#/definitions/pipeline_build_number" } }, "400": { "description": "The update failed because the next number was invalid (it should be higher than the current number).", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The account or repository was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "in": "body", "description": "The build number to update.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_build_number" } } ], "operationId": "updateRepositoryBuildNumber" } }, "/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/": { "post": { "description": "Create a schedule for the given repository.", "tags": [ "pipelines" ], "responses": { "201": { "description": "The created schedule.", "schema": { "$ref": "#/definitions/pipeline_schedule" } }, "400": { "description": "There were errors validating the request.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "The maximum limit of schedules for this repository was reached.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The account or repository was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "in": "body", "description": "The schedule to create.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_schedule" } } ], "operationId": "createRepositoryPipelineSchedule" }, "get": { "description": "Retrieve the configured schedules for the given repository.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The list of schedules.", "schema": { "$ref": "#/definitions/paginated_pipeline_schedules" } }, "404": { "description": "The account or repository was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "operationId": "getRepositoryPipelineSchedules" } }, "/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}": { "put": { "description": "Update a schedule.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The schedule is updated.", "schema": { "$ref": "#/definitions/pipeline_schedule" } }, "404": { "description": "The account, repository or schedule was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The uuid of the schedule.", "required": true, "type": "string", "name": "schedule_uuid", "in": "path" }, { "required": true, "in": "body", "description": "The schedule to update.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_schedule" } } ], "operationId": "updateRepositoryPipelineSchedule" }, "get": { "description": "Retrieve a schedule by its UUID.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The requested schedule.", "schema": { "$ref": "#/definitions/pipeline_schedule" } }, "404": { "description": "The account, repository or schedule was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The uuid of the schedule.", "required": true, "type": "string", "name": "schedule_uuid", "in": "path" } ], "operationId": "getRepositoryPipelineSchedule" }, "delete": { "description": "Delete a schedule.", "tags": [ "pipelines" ], "responses": { "204": { "description": "The schedule was deleted." }, "404": { "description": "The account, repository or schedule was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The uuid of the schedule.", "required": true, "type": "string", "name": "schedule_uuid", "in": "path" } ], "operationId": "deleteRepositoryPipelineSchedule" } }, "/repositories/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executions/": { "get": { "description": "Retrieve the executions of a given schedule.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The list of executions of a schedule.", "schema": { "$ref": "#/definitions/paginated_pipeline_schedule_executions" } }, "404": { "description": "The account or repository was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "operationId": "getRepositoryPipelineScheduleExecutions" } }, "/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair": { "put": { "description": "Create or update the repository SSH key pair. The private key will be set as a default SSH identity in your build container.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The SSH key pair was created or updated.", "schema": { "$ref": "#/definitions/pipeline_ssh_key_pair" } }, "404": { "description": "The account, repository or SSH key pair was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "in": "body", "description": "The created or updated SSH key pair.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_ssh_key_pair" } } ], "operationId": "updateRepositoryPipelineKeyPair" }, "get": { "description": "Retrieve the repository SSH key pair excluding the SSH private key. The private key is a write only field and will never be exposed in the logs or the REST API.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The SSH key pair.", "schema": { "$ref": "#/definitions/pipeline_ssh_key_pair" } }, "404": { "description": "The account, repository or SSH key pair was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "operationId": "getRepositoryPipelineSshKeyPair" }, "delete": { "description": "Delete the repository SSH key pair.", "tags": [ "pipelines" ], "responses": { "204": { "description": "The SSH key pair was deleted." }, "404": { "description": "The account, repository or SSH key pair was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "operationId": "deleteRepositoryPipelineKeyPair" } }, "/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/": { "post": { "description": "Create a repository level known host.", "tags": [ "pipelines" ], "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of the newly created pipeline known host." } }, "description": "The known host was created.", "schema": { "$ref": "#/definitions/pipeline_known_host" } }, "404": { "description": "The account or repository does not exist.", "schema": { "$ref": "#/definitions/error" } }, "409": { "description": "A known host with the provided hostname already exists.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "in": "body", "description": "The known host to create.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_known_host" } } ], "operationId": "createRepositoryPipelineKnownHost" }, "get": { "description": "Find repository level known hosts.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The retrieved known hosts.", "schema": { "$ref": "#/definitions/paginated_pipeline_known_hosts" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "operationId": "getRepositoryPipelineKnownHosts" } }, "/repositories/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}": { "put": { "description": "Update a repository level known host.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The known host was updated.", "schema": { "$ref": "#/definitions/pipeline_known_host" } }, "404": { "description": "The account, repository or known host with the given UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the known host to update.", "required": true, "type": "string", "name": "known_host_uuid", "in": "path" }, { "required": true, "in": "body", "description": "The updated known host.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_known_host" } } ], "operationId": "updateRepositoryPipelineKnownHost" }, "get": { "description": "Retrieve a repository level known host.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The known host.", "schema": { "$ref": "#/definitions/pipeline_known_host" } }, "404": { "description": "The account, repository or known host with the specified UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the known host to retrieve.", "required": true, "type": "string", "name": "known_host_uuid", "in": "path" } ], "operationId": "getRepositoryPipelineKnownHost" }, "delete": { "description": "Delete a repository level known host.", "tags": [ "pipelines" ], "responses": { "204": { "description": "The known host was deleted." }, "404": { "description": "The account, repository or known host with given UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the known host to delete.", "required": true, "type": "string", "name": "known_host_uuid", "in": "path" } ], "operationId": "deleteRepositoryPipelineKnownHost" } }, "/repositories/{workspace}/{repo_slug}/pipelines_config/variables/": { "post": { "description": "Create a repository level variable.", "tags": [ "pipelines" ], "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of the newly created pipeline variable." } }, "description": "The variable was created.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The account or repository does not exist.", "schema": { "$ref": "#/definitions/error" } }, "409": { "description": "A variable with the provided key already exists.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "required": true, "in": "body", "description": "The variable to create.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_variable" } } ], "operationId": "createRepositoryPipelineVariable" }, "get": { "description": "Find repository level variables.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The retrieved variables.", "schema": { "$ref": "#/definitions/paginated_pipeline_variables" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" } ], "operationId": "getRepositoryPipelineVariables" } }, "/repositories/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}": { "put": { "description": "Update a repository level variable.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The variable was updated.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The account, repository or variable with the given UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the variable to update.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" }, { "required": true, "in": "body", "description": "The updated variable", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_variable" } } ], "operationId": "updateRepositoryPipelineVariable" }, "get": { "description": "Retrieve a repository level variable.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The variable.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The account, repository or variable with the specified UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the variable to retrieve.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" } ], "operationId": "getRepositoryPipelineVariable" }, "delete": { "description": "Delete a repository level variable.", "tags": [ "pipelines" ], "responses": { "204": { "description": "The variable was deleted." }, "404": { "description": "The account, repository or variable with given UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The repository.", "required": true, "type": "string", "name": "repo_slug", "in": "path" }, { "description": "The UUID of the variable to delete.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" } ], "operationId": "deleteRepositoryPipelineVariable" } }, "/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}": { "put": { "responses": { "204": { "description": "An empty response." } }, "operationId": "updateRepositoryHostedPropertyValue", "description": "Update an [application property](/cloud/bitbucket/application-properties/) value stored against a repository.", "parameters": [ { "required": true, "type": "string", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "in": "path", "name": "workspace" }, { "required": true, "type": "string", "description": "The repository.", "in": "path", "name": "repo_slug" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] }, "delete": { "responses": { "204": { "description": "An empty response." } }, "operationId": "deleteRepositoryHostedPropertyValue", "description": "Delete an [application property](/cloud/bitbucket/application-properties/) value stored against a repository.", "parameters": [ { "required": true, "type": "string", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "in": "path", "name": "workspace" }, { "required": true, "type": "string", "description": "The repository.", "in": "path", "name": "repo_slug" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] }, "get": { "responses": { "200": { "description": "The value of the property." } }, "operationId": "getRepositoryHostedPropertyValue", "description": "Retrieve an [application property](/cloud/bitbucket/application-properties/) value stored against a repository.", "parameters": [ { "required": true, "type": "string", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "in": "path", "name": "workspace" }, { "required": true, "type": "string", "description": "The repository.", "in": "path", "name": "repo_slug" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] } }, "/repositories/{workspace}/{repo_slug}/pullrequests": { "get": { "responses": { "200": { "description": "All pull requests on the specified repository.", "schema": { "$ref": "#/definitions/paginated_pullrequests" } }, "401": { "description": "If the repository is private and the request was not authenticated." }, "404": { "description": "If the specified repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all pull requests on the specified repository.\n\nBy default only open pull requests are returned. This can be controlled\nusing the `state` query parameter. To retrieve pull requests that are\nin one of multiple states, repeat the `state` parameter for each\nindividual state.\n\nThis endpoint also supports filtering and sorting of the results. See\n[filtering and sorting](../../../../meta/filtering) for more details.", "parameters": [ { "name": "state", "in": "query", "description": "Only return pull requests that are in this state. This parameter can be repeated.", "type": "string", "enum": [ "MERGED", "SUPERSEDED", "OPEN", "DECLINED" ] } ], "tags": [ "pullrequests" ] }, "post": { "responses": { "201": { "description": "The newly created pull request.", "schema": { "$ref": "#/definitions/pullrequest" }, "headers": { "Location": { "type": "string", "description": "The URL of new newly created pull request." } } }, "400": { "description": "If the input document was invalid, or if the caller lacks the privilege to create repositories under the targeted account.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "If the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new pull request where the destination repository is\nthis repository and the author is the authenticated user.\n\nThe minimum required fields to create a pull request are `title` and\n`source`, specified by a branch name.\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/my-username/my-repository/pullrequests \\\n -u my-username:my-password \\\n --request POST \\\n --header 'Content-Type: application/json' \\\n --data '{\n \"title\": \"My Title\",\n \"source\": {\n \"branch\": {\n \"name\": \"staging\"\n }\n }\n }'\n```\n\nIf the pull request's `destination` is not specified, it will default\nto the `repository.mainbranch`. To open a pull request to a\ndifferent branch, say from a feature branch to a staging branch,\nspecify a `destination` (same format as the `source`):\n\n```\n{\n \"title\": \"My Title\",\n \"source\": {\n \"branch\": {\n \"name\": \"my-feature-branch\"\n }\n },\n \"destination\": {\n \"branch\": {\n \"name\": \"staging\"\n }\n }\n}\n```\n\nReviewers can be specified by adding an array of user objects as the\n`reviewers` property.\n\n```\n{\n \"title\": \"My Title\",\n \"source\": {\n \"branch\": {\n \"name\": \"my-feature-branch\"\n }\n },\n \"reviewers\": [\n {\n \"uuid\": \"{504c3b62-8120-4f0c-a7bc-87800b9d6f70}\"\n }\n ]\n}\n```\n\nOther fields:\n\n* `description` - a string\n* `close_source_branch` - boolean that specifies if the source branch should be closed upon merging", "parameters": [ { "name": "_body", "in": "body", "description": "The new pull request.\n\nThe request URL you POST to becomes the destination repository URL. For this reason, you must specify an explicit source repository in the request object if you want to pull from a different repository (fork).\n\nSince not all elements are required or even mutable, you only need to include the elements you want to initialize, such as the source branch and the title.", "required": false, "schema": { "$ref": "#/definitions/pullrequest" } } ], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/activity": { "get": { "responses": { "200": { "description": "The pull request activity log" }, "401": { "description": "If the repository is private and the request was not authenticated." }, "404": { "description": "If the specified repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of the pull request's activity log.\n\nThis handler serves both a v20 and internal endpoint. The v20 endpoint\nreturns reviewer comments, updates, approvals and request changes. The internal\nendpoint includes those plus tasks and attachments.\n\nComments created on a file or a line of code have an inline property.\n\nComment example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"comment\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695/comments/118571088\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695/_/diff#comment-118571088\"\n }\n },\n \"deleted\": false,\n \"pullrequest\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n },\n \"content\": {\n \"raw\": \"inline with to a dn from lines\",\n \"markup\": \"markdown\",\n \"html\": \"

inline with to a dn from lines

\",\n \"type\": \"rendered\"\n },\n \"created_on\": \"2019-09-27T00:33:46.039178+00:00\",\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"created_on\": \"2019-09-27T00:33:46.039178+00:00\",\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"updated_on\": \"2019-09-27T00:33:46.055384+00:00\",\n \"inline\": {\n \"context_lines\": \"\",\n \"to\": null,\n \"path\": \"\",\n \"outdated\": false,\n \"from\": 211\n },\n \"type\": \"pullrequest_comment\",\n \"id\": 118571088\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```\n\nUpdates include a state property of OPEN, MERGED, or DECLINED.\n\nUpdate example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"update\": {\n \"description\": \"\",\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\",\n \"destination\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"6a2c16e4a152\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/commit/6a2c16e4a152\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6a2c16e4a152\"\n }\n }\n },\n \"branch\": {\n \"name\": \"master\"\n },\n \"repository\": {\n \"name\": \"Atlaskit-MK-2\",\n \"type\": \"repository\",\n \"full_name\": \"atlassian/atlaskit-mk-2\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\"\n }\n },\n \"uuid\": \"{}\"\n }\n },\n \"reason\": \"\",\n \"source\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"728c8bad1813\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/commit/728c8bad1813\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/728c8bad1813\"\n }\n }\n },\n \"branch\": {\n \"name\": \"username/NONE-add-onClick-prop-for-accessibility\"\n },\n \"repository\": {\n \"name\": \"Atlaskit-MK-2\",\n \"type\": \"repository\",\n \"full_name\": \"atlassian/atlaskit-mk-2\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\"\n }\n },\n \"uuid\": \"{}\"\n }\n },\n \"state\": \"OPEN\",\n \"author\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"date\": \"2019-05-10T06:48:25.305565+00:00\"\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```\n\nApproval example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"approval\": {\n \"date\": \"2019-09-27T00:37:19.849534+00:00\",\n \"pullrequest\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n },\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n }\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}": { "get": { "responses": { "200": { "description": "The pull request object", "examples": { "application/json": { "type": "pullrequest", "description": "Everything is awesome!", "links": { "decline": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/decline" }, "commits": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/commits" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1" }, "comments": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/comments" }, "merge": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/merge" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/pull-requests/1" }, "activity": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/activity" }, "diff": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/diff" }, "approve": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/approve" }, "statuses": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/statuses" } }, "author": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" }, "close_source_branch": true, "reviewers": [], "id": 1, "destination": { "commit": { "type": "commit", "hash": "230269fdfabd", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabd" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/commits/230269fdfabd" } } }, "branch": { "name": "master" }, "repository": { "full_name": "example-username/bits_and_bobs", "type": "repository", "name": "bits_and_bobs", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" } }, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "comment_count": 0, "summary": { "raw": "Everything is awesome!", "markup": "markdown", "html": "

Everything is awesome!

", "type": "rendered" }, "source": { "commit": { "type": "commit", "hash": "c184aab5708b", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/c184aab5708b" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/commits/c184aab5708b" } } }, "branch": { "name": "branch_magnificent_internet" }, "repository": { "full_name": "example-username/bits_and_bobs", "type": "repository", "name": "bits_and_bobs", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" } }, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "participants": [], "state": "OPEN", "task_count": 0, "created_on": "2018-06-20T23:17:33.616037+00:00", "updated_on": "2018-06-20T23:17:33.616037+00:00", "reason": "", "title": "Change a cooperative standard to a smiling disease", "merge_commit": null, "closed_by": null } }, "schema": { "$ref": "#/definitions/pullrequest" } }, "401": { "description": "If the repository is private and the request was not authenticated." }, "404": { "description": "If the repository or pull request does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified pull request.", "parameters": [], "tags": [ "pullrequests" ] }, "put": { "responses": { "200": { "description": "The updated pull request", "examples": { "application/json": { "type": "pullrequest", "description": "Everything is awesome!", "links": { "decline": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/decline" }, "commits": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/commits" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1" }, "comments": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/comments" }, "merge": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/merge" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/pull-requests/1" }, "activity": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/activity" }, "diff": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/diff" }, "approve": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/approve" }, "statuses": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/statuses" } }, "author": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" }, "close_source_branch": true, "reviewers": [], "id": 1, "destination": { "commit": { "type": "commit", "hash": "230269fdfabd", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabd" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/commits/230269fdfabd" } } }, "branch": { "name": "master" }, "repository": { "full_name": "example-username/bits_and_bobs", "type": "repository", "name": "bits_and_bobs", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" } }, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "comment_count": 0, "summary": { "raw": "Everything is awesome!", "markup": "markdown", "html": "

Everything is awesome!

", "type": "rendered" }, "source": { "commit": { "type": "commit", "hash": "c184aab5708b", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/c184aab5708b" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/commits/c184aab5708b" } } }, "branch": { "name": "branch_magnificent_internet" }, "repository": { "full_name": "example-username/bits_and_bobs", "type": "repository", "name": "bits_and_bobs", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" } }, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "participants": [], "state": "OPEN", "task_count": 0, "created_on": "2018-06-20T23:17:33.616037+00:00", "updated_on": "2018-06-20T23:17:33.616037+00:00", "reason": "", "title": "Change a cooperative standard to a smiling disease", "merge_commit": null, "closed_by": null } }, "schema": { "$ref": "#/definitions/pullrequest" } }, "400": { "description": "If the input document was invalid.", "schema": { "$ref": "#/definitions/error" } }, "401": { "description": "If the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository or pull request id does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Mutates the specified pull request.\n\nThis can be used to change the pull request's branches or description.\n\nOnly open pull requests can be mutated.", "parameters": [ { "name": "_body", "in": "body", "description": "The pull request that is to be updated.", "required": false, "schema": { "$ref": "#/definitions/pullrequest" } } ], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/activity": { "get": { "responses": { "200": { "description": "The pull request activity log" }, "401": { "description": "If the repository is private and the request was not authenticated." }, "404": { "description": "If the specified repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of the pull request's activity log.\n\nThis handler serves both a v20 and internal endpoint. The v20 endpoint\nreturns reviewer comments, updates, approvals and request changes. The internal\nendpoint includes those plus tasks and attachments.\n\nComments created on a file or a line of code have an inline property.\n\nComment example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"comment\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695/comments/118571088\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695/_/diff#comment-118571088\"\n }\n },\n \"deleted\": false,\n \"pullrequest\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n },\n \"content\": {\n \"raw\": \"inline with to a dn from lines\",\n \"markup\": \"markdown\",\n \"html\": \"

inline with to a dn from lines

\",\n \"type\": \"rendered\"\n },\n \"created_on\": \"2019-09-27T00:33:46.039178+00:00\",\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"created_on\": \"2019-09-27T00:33:46.039178+00:00\",\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"updated_on\": \"2019-09-27T00:33:46.055384+00:00\",\n \"inline\": {\n \"context_lines\": \"\",\n \"to\": null,\n \"path\": \"\",\n \"outdated\": false,\n \"from\": 211\n },\n \"type\": \"pullrequest_comment\",\n \"id\": 118571088\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```\n\nUpdates include a state property of OPEN, MERGED, or DECLINED.\n\nUpdate example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"update\": {\n \"description\": \"\",\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\",\n \"destination\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"6a2c16e4a152\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/commit/6a2c16e4a152\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6a2c16e4a152\"\n }\n }\n },\n \"branch\": {\n \"name\": \"master\"\n },\n \"repository\": {\n \"name\": \"Atlaskit-MK-2\",\n \"type\": \"repository\",\n \"full_name\": \"atlassian/atlaskit-mk-2\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\"\n }\n },\n \"uuid\": \"{}\"\n }\n },\n \"reason\": \"\",\n \"source\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"728c8bad1813\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/commit/728c8bad1813\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/commits/728c8bad1813\"\n }\n }\n },\n \"branch\": {\n \"name\": \"username/NONE-add-onClick-prop-for-accessibility\"\n },\n \"repository\": {\n \"name\": \"Atlaskit-MK-2\",\n \"type\": \"repository\",\n \"full_name\": \"atlassian/atlaskit-mk-2\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B%7D?ts=js\"\n }\n },\n \"uuid\": \"{}\"\n }\n },\n \"state\": \"OPEN\",\n \"author\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n },\n \"date\": \"2019-05-10T06:48:25.305565+00:00\"\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```\n\nApproval example:\n```\n{\n \"pagelen\": 20,\n \"values\": [\n {\n \"approval\": {\n \"date\": \"2019-09-27T00:37:19.849534+00:00\",\n \"pullrequest\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n },\n \"user\": {\n \"display_name\": \"Name Lastname\",\n \"uuid\": \"{}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/users/%7B%7D\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/%7B%7D/\"\n },\n \"avatar\": {\n \"href\": \"https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128\"\n }\n },\n \"type\": \"user\",\n \"nickname\": \"Name\",\n \"account_id\": \"\"\n }\n },\n \"pull_request\": {\n \"type\": \"pullrequest\",\n \"id\": 5695,\n \"links\": {\n \"self\": {\n \"href\": \"https://bitbucket.org/!api/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695\"\n }\n },\n \"title\": \"username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it\"\n }\n }\n ]\n}\n```", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve": { "delete": { "responses": { "204": { "description": "An empty response indicating the authenticated user's approval has been withdrawn." }, "401": { "description": "The request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified pull request or the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Redact the authenticated user's approval of the specified pull\nrequest.", "parameters": [], "tags": [ "pullrequests" ] }, "post": { "responses": { "200": { "description": "The `participant` object recording that the authenticated user approved the pull request.", "schema": { "$ref": "#/definitions/participant" } }, "401": { "description": "The request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified pull request or the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Approve the specified pull request as the authenticated user.", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments": { "get": { "responses": { "200": { "description": "A paginated list of comments made on the given pull request, in chronological order.", "schema": { "$ref": "#/definitions/paginated_pullrequest_comments" } }, "403": { "description": "If the authenticated user does not have access to the pull request.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the pull request does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of the pull request's comments.\n\nThis includes both global, inline comments and replies.\n\nThe default sorting is oldest to newest and can be overridden with\nthe `sort` query parameter.\n\nThis endpoint also supports filtering and sorting of the results. See\n[filtering and sorting](../../../../../../meta/filtering) for more\ndetails.", "parameters": [], "tags": [ "pullrequests" ] }, "post": { "responses": { "201": { "description": "The newly created comment.", "schema": { "$ref": "#/definitions/pullrequest_comment" }, "headers": { "Location": { "type": "string", "description": "The URL of the new comment" } } }, "403": { "description": "If the authenticated user does not have access to the pull request.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the pull request does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new pull request comment.\n\nReturns the newly created pull request comment.", "parameters": [ { "name": "_body", "in": "body", "description": "The comment object.", "required": true, "schema": { "$ref": "#/definitions/pullrequest_comment" } } ], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}": { "delete": { "responses": { "204": { "description": "Successful deletion." }, "403": { "description": "If the authenticated user does not have access to delete the comment.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the comment does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes a specific pull request comment.", "parameters": [], "tags": [ "pullrequests" ] }, "get": { "responses": { "200": { "description": "The comment.", "schema": { "$ref": "#/definitions/pullrequest_comment" } }, "403": { "description": "If the authenticated user does not have access to the pull request.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the comment does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a specific pull request comment.", "parameters": [], "tags": [ "pullrequests" ] }, "put": { "responses": { "200": { "description": "The updated comment.", "schema": { "$ref": "#/definitions/pullrequest_comment" } }, "403": { "description": "If the authenticated user does not have access to the comment.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the comment does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates a specific pull request comment.", "parameters": [ { "name": "_body", "in": "body", "description": "The contents of the updated comment.", "required": true, "schema": { "$ref": "#/definitions/pullrequest_comment" } } ], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "comment_id", "in": "path", "description": "The id of the comment.", "required": true, "type": "integer" }, { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commits": { "get": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of the pull request's commits.\n\nThese are the commits that are being merged into the destination\nbranch when the pull requests gets accepted.", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/decline": { "post": { "responses": { "200": { "description": "The pull request object.", "examples": { "application/json": { "type": "pullrequest", "description": "Everything is awesome!", "links": { "decline": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/decline" }, "commits": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/commits" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1" }, "comments": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/comments" }, "merge": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/merge" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/pull-requests/1" }, "activity": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/activity" }, "diff": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/diff" }, "approve": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/approve" }, "statuses": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/statuses" } }, "author": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" }, "close_source_branch": true, "reviewers": [], "id": 1, "destination": { "commit": { "type": "commit", "hash": "230269fdfabd", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabd" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/commits/230269fdfabd" } } }, "branch": { "name": "master" }, "repository": { "full_name": "example-username/bits_and_bobs", "type": "repository", "name": "bits_and_bobs", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" } }, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "comment_count": 0, "summary": { "raw": "Everything is awesome!", "markup": "markdown", "html": "

Everything is awesome!

", "type": "rendered" }, "source": { "commit": { "type": "commit", "hash": "c184aab5708b", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/c184aab5708b" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/commits/c184aab5708b" } } }, "branch": { "name": "branch_magnificent_internet" }, "repository": { "full_name": "example-username/bits_and_bobs", "type": "repository", "name": "bits_and_bobs", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" } }, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "participants": [], "state": "OPEN", "task_count": 0, "created_on": "2018-06-20T23:17:33.616037+00:00", "updated_on": "2018-06-20T23:17:33.616037+00:00", "reason": "", "title": "Change a cooperative standard to a smiling disease", "merge_commit": null, "closed_by": null } }, "schema": { "$ref": "#/definitions/pullrequest" } }, "555": { "description": "If the decline took too long and timed out.\nIn this case the caller should retry the request later.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Declines the pull request.", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diff": { "get": { "responses": { "302": { "description": "Redirects to the [repository diff](../../diff/%7Bspec%7D) with the\nrevspec that corresponds to the pull request.\n" } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Redirects to the [repository diff](../../diff/%7Bspec%7D)\nwith the revspec that corresponds to the pull request.", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffstat": { "get": { "responses": { "302": { "description": "Redirects to the [repository diffstat](../../diffstat/%7Bspec%7D) with\nthe revspec that corresponds to pull request.\n" } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Redirects to the [repository diffstat](../../diffstat/%7Bspec%7D)\nwith the revspec that corresponds to the pull request.", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge": { "post": { "responses": { "200": { "description": "The pull request object.", "examples": { "application/json": { "type": "pullrequest", "description": "Everything is awesome!", "links": { "decline": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/decline" }, "commits": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/commits" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1" }, "comments": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/comments" }, "merge": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/merge" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/pull-requests/1" }, "activity": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/activity" }, "diff": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/diff" }, "approve": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/approve" }, "statuses": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/pullrequests/1/statuses" } }, "author": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" }, "close_source_branch": true, "reviewers": [], "id": 1, "destination": { "commit": { "type": "commit", "hash": "230269fdfabd", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabd" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/commits/230269fdfabd" } } }, "branch": { "name": "master" }, "repository": { "full_name": "example-username/bits_and_bobs", "type": "repository", "name": "bits_and_bobs", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" } }, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "comment_count": 0, "summary": { "raw": "Everything is awesome!", "markup": "markdown", "html": "

Everything is awesome!

", "type": "rendered" }, "source": { "commit": { "type": "commit", "hash": "c184aab5708b", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/c184aab5708b" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/commits/c184aab5708b" } } }, "branch": { "name": "branch_magnificent_internet" }, "repository": { "full_name": "example-username/bits_and_bobs", "type": "repository", "name": "bits_and_bobs", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" } }, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" } }, "participants": [], "state": "OPEN", "task_count": 0, "created_on": "2018-06-20T23:17:33.616037+00:00", "updated_on": "2018-06-20T23:17:33.616037+00:00", "reason": "", "title": "Change a cooperative standard to a smiling disease", "merge_commit": null, "closed_by": null } }, "schema": { "$ref": "#/definitions/pullrequest" } }, "202": { "description": "In the Location header, the URL to poll for the pull request merge status" }, "555": { "description": "If the merge took too long and timed out.\nIn this case the caller should retry the request later", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Merges the pull request.", "parameters": [ { "name": "_body", "in": "body", "required": false, "schema": { "$ref": "#/definitions/pullrequest_merge_parameters" } } ], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge/task-status/{task_id}": { "get": { "responses": { "200": { "description": "Returns a task status if the merge is either pending or successful, and if it is successful, a pull request" }, "400": { "description": "If the provided task ID does not relate to this pull request, or if something went wrong during the merge operation" }, "403": { "description": "The user making the request does not have permission to the repo and is different from the user who queued the task" } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "When merging a pull request takes too long, the client receives a\ntask ID along with a 202 status code. The task ID can be used in a call\nto this endpoint to check the status of a merge task.\n\n```\ncurl -X GET https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/\n```\n\nIf the merge task is not yet finished, a PENDING status will be returned.\n\n```\nHTTP/2 200\n{\n \"task_status\": \"PENDING\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/\"\n }\n }\n}\n```\n\nIf the merge was successful, a SUCCESS status will be returned.\n\n```\nHTTP/2 200\n{\n \"task_status\": \"SUCCESS\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bitbucket/pullrequests/2286/merge/task-status/\"\n }\n },\n \"merge_result\": \n}\n```\n\nIf the merge task failed, an error will be returned.\n\n```\n{\n \"type\": \"error\",\n \"error\": {\n \"message\": \"\"\n }\n}\n```", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "task_id", "in": "path", "description": "ID of the merge task", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/patch": { "get": { "responses": { "302": { "description": "Redirects to the [repository patch](../../patch/%7Bspec%7D) with\nthe revspec that corresponds to pull request.\n" } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Redirects to the [repository patch](../../patch/%7Bspec%7D)\nwith the revspec that corresponds to pull request.", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/request-changes": { "delete": { "responses": { "204": { "description": "An empty response indicating the authenticated user's request for change has been withdrawn." }, "401": { "description": "The request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified pull request or the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "parameters": [], "tags": [ "pullrequests" ] }, "post": { "responses": { "200": { "description": "The `participant` object recording that the authenticated user requested changes on the pull request.", "schema": { "$ref": "#/definitions/participant" } }, "401": { "description": "The request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified pull request or the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "parameters": [], "tags": [ "pullrequests" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses": { "get": { "responses": { "200": { "description": "A paginated list of all commit statuses for this pull request.", "schema": { "$ref": "#/definitions/paginated_commitstatuses" } }, "401": { "description": "If the repository is private and the request was not authenticated." }, "404": { "description": "If the specified repository or pull request does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "pullrequest" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all statuses (e.g. build results) for the given pull\nrequest.", "parameters": [ { "name": "q", "in": "query", "description": "Query string to narrow down the response as per\n[filtering and sorting](../../../../../../meta/filtering).\n", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "Field by which the results should be sorted as per\n[filtering and sorting](../../../../../../meta/filtering).\nDefaults to `created_on`.\n", "required": false, "type": "string" } ], "tags": [ "repositories", "pullrequests", "commitstatuses" ] }, "parameters": [ { "name": "pull_request_id", "in": "path", "description": "The id of the pull request.", "required": true, "type": "integer" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}": { "put": { "responses": { "204": { "description": "An empty response." } }, "operationId": "updatePullRequestHostedPropertyValue", "description": "Update an [application property](/cloud/bitbucket/application-properties/) value stored against a pull request.", "parameters": [ { "required": true, "type": "string", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "in": "path", "name": "workspace" }, { "required": true, "type": "string", "description": "The repository.", "in": "path", "name": "repo_slug" }, { "required": true, "type": "string", "description": "The pull request ID.", "in": "path", "name": "pullrequest_id" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] }, "delete": { "responses": { "204": { "description": "An empty response." } }, "operationId": "deletePullRequestHostedPropertyValue", "description": "Delete an [application property](/cloud/bitbucket/application-properties/) value stored against a pull request.", "parameters": [ { "required": true, "type": "string", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "in": "path", "name": "workspace" }, { "required": true, "type": "string", "description": "The repository.", "in": "path", "name": "repo_slug" }, { "required": true, "type": "string", "description": "The pull request ID.", "in": "path", "name": "pullrequest_id" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] }, "get": { "responses": { "200": { "description": "The value of the property." } }, "operationId": "getPullRequestHostedPropertyValue", "description": "Retrieve an [application property](/cloud/bitbucket/application-properties/) value stored against a pull request.", "parameters": [ { "required": true, "type": "string", "description": "The repository container; either the workspace slug or the UUID in curly braces.", "in": "path", "name": "workspace" }, { "required": true, "type": "string", "description": "The repository.", "in": "path", "name": "repo_slug" }, { "required": true, "type": "string", "description": "The pull request ID.", "in": "path", "name": "pullrequest_id" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] } }, "/repositories/{workspace}/{repo_slug}/refs": { "get": { "responses": { "200": { "description": "A paginated list of refs matching any filter criteria that were provided.", "schema": { "$ref": "#/definitions/paginated_refs" } }, "403": { "description": "If the repository is private and the authenticated user does not have\naccess to it.\n", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the branches and tags in the repository.\n\nBy default, results will be in the order the underlying source control system returns them and identical to\nthe ordering one sees when running \"$ git show-ref\". Note that this follows simple\nlexical ordering of the ref names.\n\nThis can be undesirable as it does apply any natural sorting semantics, meaning for instance that refs are\nsorted [\"branch1\", \"branch10\", \"branch2\", \"v10\", \"v11\", \"v9\"] instead of [\"branch1\", \"branch2\",\n\"branch10\", \"v9\", \"v10\", \"v11\"].\n\nSorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name,\nBitbucket will apply natural sorting and interpret numerical values as numbers instead of strings.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../../meta/filtering).", "type": "string" }, { "name": "sort", "in": "query", "description": "\nField by which the results should be sorted as per\n[filtering and sorting](../../../../meta/filtering). The `name`\nfield is handled specially for refs in that, if specified as the sort field, it\nuses a natural sort order instead of the default lexicographical sort order. For example,\nit will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2'].", "type": "string" } ], "tags": [ "refs" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/refs/branches": { "get": { "responses": { "200": { "description": "A paginated list of branches matching any filter criteria that were provided.", "schema": { "$ref": "#/definitions/paginated_branches" } }, "403": { "description": "If the repository is private and the authenticated user does not have\naccess to it.\n", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a list of all open branches within the specified repository.\nResults will be in the order the source control manager returns them.\n\n```\n$ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches | jq .\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"heads\": [\n {\n \"hash\": \"f1a0933ce59e809f190602655e22ae6ec107c397\",\n \"type\": \"commit\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/f1a0933ce59e809f190602655e22ae6ec107c397\"\n }\n }\n }\n ],\n \"type\": \"named_branch\",\n \"name\": \"default\",\n \"links\": {\n \"commits\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commits/default\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches/default\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/branch/default\"\n }\n },\n \"target\": {\n \"hash\": \"f1a0933ce59e809f190602655e22ae6ec107c397\",\n \"repository\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/avatar/32/\"\n }\n },\n \"type\": \"repository\",\n \"name\": \"mercurial\",\n \"full_name\": \"seanfarley/mercurial\",\n \"uuid\": \"{73dcbd61-e506-4fc1-9ecd-31be2b6d6031}\"\n },\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397\"\n },\n \"comments\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/comments\"\n },\n \"patch\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/patch/f1a0933ce59e809f190602655e22ae6ec107c397\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/f1a0933ce59e809f190602655e22ae6ec107c397\"\n },\n \"diff\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/diff/f1a0933ce59e809f190602655e22ae6ec107c397\"\n },\n \"approve\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/approve\"\n },\n \"statuses\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/statuses\"\n }\n },\n \"author\": {\n \"raw\": \"Martin von Zweigbergk \",\n \"type\": \"author\",\n \"user\": {\n \"username\": \"martinvonz\",\n \"nickname\": \"martinvonz\",\n \"display_name\": \"Martin von Zweigbergk\",\n \"type\": \"user\",\n \"uuid\": \"{fdb0e657-3ade-4fad-a136-95f1ffe4a5ac}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/martinvonz\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/martinvonz/\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/martinvonz/avatar/32/\"\n }\n }\n }\n },\n \"parents\": [\n {\n \"hash\": \"5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\",\n \"type\": \"commit\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\"\n }\n }\n }\n ],\n \"date\": \"2018-02-01T18:44:49+00:00\",\n \"message\": \"config: replace a for-else by any()\",\n \"type\": \"commit\"\n }\n },\n {\n \"heads\": [\n {\n \"hash\": \"1d60ad093792706e1dc7a52b20942593f2c19655\",\n \"type\": \"commit\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/1d60ad093792706e1dc7a52b20942593f2c19655\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/1d60ad093792706e1dc7a52b20942593f2c19655\"\n }\n }\n }\n ],\n \"type\": \"named_branch\",\n \"name\": \"stable\",\n \"links\": {\n \"commits\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commits/stable\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches/stable\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/branch/stable\"\n }\n },\n \"target\": {\n \"hash\": \"1d60ad093792706e1dc7a52b20942593f2c19655\",\n \"repository\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/avatar/32/\"\n }\n },\n \"type\": \"repository\",\n \"name\": \"mercurial\",\n \"full_name\": \"seanfarley/mercurial\",\n \"uuid\": \"{73dcbd61-e506-4fc1-9ecd-31be2b6d6031}\"\n },\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/1d60ad093792706e1dc7a52b20942593f2c19655\"\n },\n \"comments\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/1d60ad093792706e1dc7a52b20942593f2c19655/comments\"\n },\n \"patch\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/patch/1d60ad093792706e1dc7a52b20942593f2c19655\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/1d60ad093792706e1dc7a52b20942593f2c19655\"\n },\n \"diff\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/diff/1d60ad093792706e1dc7a52b20942593f2c19655\"\n },\n \"approve\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/1d60ad093792706e1dc7a52b20942593f2c19655/approve\"\n },\n \"statuses\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/1d60ad093792706e1dc7a52b20942593f2c19655/statuses\"\n }\n },\n \"author\": {\n \"raw\": \"Augie Fackler \",\n \"type\": \"author\",\n \"user\": {\n \"username\": \"durin42\",\n \"nickname\": \"durin42\",\n \"display_name\": \"Augie Fackler\",\n \"type\": \"user\",\n \"uuid\": \"{e07dc61f-bb05-4218-b43a-d991f26be65a}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/durin42\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/durin42/\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/durin42/avatar/32/\"\n }\n }\n }\n },\n \"parents\": [\n {\n \"hash\": \"56a0da11bde519d79168e890df4bcf0da62f0a7b\",\n \"type\": \"commit\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/56a0da11bde519d79168e890df4bcf0da62f0a7b\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/56a0da11bde519d79168e890df4bcf0da62f0a7b\"\n }\n }\n }\n ],\n \"date\": \"2018-02-01T19:13:41+00:00\",\n \"message\": \"Added signature for changeset d334afc585e2\",\n \"type\": \"commit\"\n }\n }\n ],\n \"page\": 1,\n \"size\": 2\n}\n```\n\nBranches support [filtering and sorting](../../../../../meta/filtering)\nthat can be used to search for specific branches. For instance, to find\nall branches that have \"stab\" in their name:\n\n```\ncurl -s https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches -G --data-urlencode 'q=name ~ \"stab\"'\n```\n\nBy default, results will be in the order the underlying source control system returns them and identical to\nthe ordering one sees when running \"$ hg branches\" or \"$ git branch --list\". Note that this follows simple\nlexical ordering of the ref names.\n\nThis can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are\nsorted [\"v10\", \"v11\", \"v9\"] instead of [\"v9\", \"v10\", \"v11\"].\n\nSorting can be changed using the ?q= query parameter. When using ?q=name to explicitly sort on ref name,\nBitbucket will apply natural sorting and interpret numerical values as numbers instead of strings.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../../../meta/filtering).", "type": "string" }, { "name": "sort", "in": "query", "description": "\nField by which the results should be sorted as per\n[filtering and sorting](../../../../../meta/filtering). The `name`\nfield is handled specially for branches in that, if specified as the sort field, it\nuses a natural sort order instead of the default lexicographical sort order. For example,\nit will return ['branch1', 'branch2', 'branch10'] instead of ['branch1', 'branch10', 'branch2'].", "type": "string" } ], "tags": [ "refs" ] }, "post": { "responses": { "201": { "description": "The newly created branch object.", "examples": { "application/json": { "type": "branch", "name": "master", "links": { "commits": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commits/master" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/branches/master" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/branch/master" } }, "target": { "hash": "230269fdfabdb5562a991f351b5dd6425de232d2", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabdb5562a991f351b5dd6425de232d2" }, "comments": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabdb5562a991f351b5dd6425de232d2/comments" }, "patch": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/patch/230269fdfabdb5562a991f351b5dd6425de232d2" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/commits/230269fdfabdb5562a991f351b5dd6425de232d2" }, "diff": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/diff/230269fdfabdb5562a991f351b5dd6425de232d2" }, "approve": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabdb5562a991f351b5dd6425de232d2/approve" }, "statuses": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabdb5562a991f351b5dd6425de232d2/statuses" } }, "repository": { "full_name": "example-username/bits_and_bobs", "type": "repository", "name": "bits_and_bobs", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" } }, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" }, "author": { "raw": "Example Username ", "type": "author", "user": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" } }, "parents": [], "date": "2018-06-20T23:17:33+00:00", "message": "Kickass commit message!", "type": "commit" } } }, "schema": { "$ref": "#/definitions/branch" } }, "403": { "description": "If the repository is private and the authenticated user does not have\naccess to it.\n", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository or branch does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new branch in the specified repository.\n\nThe payload of the POST should consist of a JSON document that\ncontains the name of the tag and the target hash.\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/branches \\\n-s -u seanfarley -X POST -H \"Content-Type: application/json\" \\\n-d '{\n \"name\" : \"smf/create-feature\",\n \"target\" : {\n \"hash\" : \"default\",\n }\n}'\n```\n\nThis call requires authentication. Private repositories require the\ncaller to authenticate with an account that has appropriate\nauthorization.\n\nFor Git, the branch name should not include any prefixes (e.g.\nrefs/heads). This endpoint does support using short hash prefixes for\nthe commit hash, but it may return a 400 response if the provided\nprefix is ambiguous. Using a full commit hash is the preferred\napproach.\n\nFor Mercurial, the authenticated user making this call is the author of\nthe new branch commit and the date is current datetime of the call.", "parameters": [], "tags": [ "refs" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/refs/branches/{name}": { "delete": { "responses": { "204": { "description": "Indicates that the specified branch was successfully deleted." }, "403": { "description": "If the repository is private and the authenticated user does not have\naccess to it.\n", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository or branch does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Delete a branch in the specified repository.\n\nThe main branch is not allowed to be deleted and will return a 400\nresponse.\n\nFor Git, the branch name should not include any prefixes (e.g.\nrefs/heads). For Mercurial, this closes all open heads on the branch,\nsets the author of the commit to the authenticated caller, and changes\nthe date to the datetime of the call.", "parameters": [], "tags": [ "refs" ] }, "get": { "responses": { "200": { "description": "The branch object.", "examples": { "application/json": { "type": "branch", "name": "master", "links": { "commits": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commits/master" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/refs/branches/master" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/branch/master" } }, "target": { "hash": "230269fdfabdb5562a991f351b5dd6425de232d2", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabdb5562a991f351b5dd6425de232d2" }, "comments": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabdb5562a991f351b5dd6425de232d2/comments" }, "patch": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/patch/230269fdfabdb5562a991f351b5dd6425de232d2" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs/commits/230269fdfabdb5562a991f351b5dd6425de232d2" }, "diff": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/diff/230269fdfabdb5562a991f351b5dd6425de232d2" }, "approve": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabdb5562a991f351b5dd6425de232d2/approve" }, "statuses": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs/commit/230269fdfabdb5562a991f351b5dd6425de232d2/statuses" } }, "repository": { "full_name": "example-username/bits_and_bobs", "type": "repository", "name": "bits_and_bobs", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/example-username/bits_and_bobs" }, "html": { "href": "https://bitbucket.org/example-username/bits_and_bobs" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B7708d810-964c-403f-aa6d-4e949280d614%7D?ts=python" } }, "uuid": "{7708d810-964c-403f-aa6d-4e949280d614}" }, "author": { "raw": "Example Username ", "type": "author", "user": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" } }, "parents": [], "date": "2018-06-20T23:17:33+00:00", "message": "Kickass commit message!", "type": "commit" } } }, "schema": { "$ref": "#/definitions/branch" } }, "403": { "description": "If the repository is private and the authenticated user does not have\naccess to it.\n", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository or branch does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a branch object within the specified repository.\n\n```\n$ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches/default | jq .\n{\n \"heads\": [\n {\n \"hash\": \"f1a0933ce59e809f190602655e22ae6ec107c397\",\n \"type\": \"commit\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/f1a0933ce59e809f190602655e22ae6ec107c397\"\n }\n }\n }\n ],\n \"type\": \"named_branch\",\n \"name\": \"default\",\n \"links\": {\n \"commits\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commits/default\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches/default\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/branch/default\"\n }\n },\n \"target\": {\n \"hash\": \"f1a0933ce59e809f190602655e22ae6ec107c397\",\n \"repository\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/avatar/32/\"\n }\n },\n \"type\": \"repository\",\n \"name\": \"mercurial\",\n \"full_name\": \"seanfarley/mercurial\",\n \"uuid\": \"{73dcbd61-e506-4fc1-9ecd-31be2b6d6031}\"\n },\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397\"\n },\n \"comments\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/comments\"\n },\n \"patch\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/patch/f1a0933ce59e809f190602655e22ae6ec107c397\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/f1a0933ce59e809f190602655e22ae6ec107c397\"\n },\n \"diff\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/diff/f1a0933ce59e809f190602655e22ae6ec107c397\"\n },\n \"approve\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/approve\"\n },\n \"statuses\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/statuses\"\n }\n },\n \"author\": {\n \"raw\": \"Martin von Zweigbergk \",\n \"type\": \"author\",\n \"user\": {\n \"username\": \"martinvonz\",\n \"nickname\": \"martinvonz\",\n \"display_name\": \"Martin von Zweigbergk\",\n \"type\": \"user\",\n \"uuid\": \"{fdb0e657-3ade-4fad-a136-95f1ffe4a5ac}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/martinvonz\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/martinvonz/\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/martinvonz/avatar/32/\"\n }\n }\n }\n },\n \"parents\": [\n {\n \"hash\": \"5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\",\n \"type\": \"commit\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\"\n }\n }\n }\n ],\n \"date\": \"2018-02-01T18:44:49+00:00\",\n \"message\": \"config: replace a for-else by any()\",\n \"type\": \"commit\"\n }\n}\n```\n\nThis call requires authentication. Private repositories require the\ncaller to authenticate with an account that has appropriate\nauthorization.\n\nFor Git, the branch name should not include any prefixes (e.g.\nrefs/heads).\n\nFor Mercurial, the response will include an additional field that lists\nthe open heads.", "parameters": [], "tags": [ "refs" ] }, "parameters": [ { "name": "name", "in": "path", "description": "The name of the branch.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/refs/tags": { "get": { "responses": { "200": { "description": "A paginated list of tags matching any filter criteria that were provided.", "schema": { "$ref": "#/definitions/paginated_tags" } }, "403": { "description": "If the repository is private and the authenticated user does not have\naccess to it.\n", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the tags in the repository.\n\nBy default, results will be in the order the underlying source control system returns them and identical to\nthe ordering one sees when running \"$ hg tags\" or \"$ git tag --list\". Note that this follows simple\nlexical ordering of the ref names.\n\nThis can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are\nsorted [\"v10\", \"v11\", \"v9\"] instead of [\"v9\", \"v10\", \"v11\"].\n\nSorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name,\nBitbucket will apply natural sorting and interpret numerical values as numbers instead of strings.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../../../meta/filtering).", "type": "string" }, { "name": "sort", "in": "query", "description": "\nField by which the results should be sorted as per\n[filtering and sorting](../../../../../meta/filtering). The `name`\nfield is handled specially for tags in that, if specified as the sort field, it\nuses a natural sort order instead of the default lexicographical sort order. For example,\nit will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2'].", "type": "string" } ], "tags": [ "refs" ] }, "post": { "responses": { "201": { "description": "The newly created tag.", "schema": { "$ref": "#/definitions/tag" } }, "400": { "description": "If the target hash is missing, ambiguous, or invalid, or if the name is not provided.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new tag in the specified repository.\n\nThe payload of the POST should consist of a JSON document that\ncontains the name of the tag and the target hash.\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/jdoe/myrepo/refs/tags \\\n-s -u jdoe -X POST -H \"Content-Type: application/json\" \\\n-d '{\n \"name\" : \"new-tag-name\",\n \"target\" : {\n \"hash\" : \"a1b2c3d4e5f6\",\n }\n}'\n```\n\nThis endpoint does support using short hash prefixes for the commit\nhash, but it may return a 400 response if the provided prefix is\nambiguous. Using a full commit hash is the preferred approach.", "parameters": [ { "name": "_body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/tag" } } ], "tags": [ "refs" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/refs/tags/{name}": { "delete": { "responses": { "204": { "description": "Indicates the specified tag was successfully deleted." }, "403": { "description": "If the repository is private and the authenticated user does not have\naccess to it.\n", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository or tag does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Delete a tag in the specified repository.\n\nFor Git, the tag name should not include any prefixes (e.g. refs/tags).\nFor Mercurial, this adds a commit to the main branch that removes the\nspecified tag.", "parameters": [], "tags": [ "refs" ] }, "get": { "responses": { "200": { "description": "The tag object.", "schema": { "$ref": "#/definitions/tag" } }, "403": { "description": "If the repository is private and the authenticated user does not have\naccess to it.\n", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "The specified repository or tag does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified tag.\n\n```\n$ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8 -G | jq .\n{\n \"name\": \"3.8\",\n \"links\": {\n \"commits\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commits/3.8\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/hg/commits/tag/3.8\"\n }\n },\n \"tagger\": {\n \"raw\": \"Matt Mackall \",\n \"type\": \"author\",\n \"user\": {\n \"username\": \"mpmselenic\",\n \"nickname\": \"mpmselenic\",\n \"display_name\": \"Matt Mackall\",\n \"type\": \"user\",\n \"uuid\": \"{a4934530-db4c-419c-a478-9ab4964c2ee7}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/mpmselenic\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/mpmselenic/\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/mpmselenic/avatar/32/\"\n }\n }\n }\n },\n \"date\": \"2016-05-01T18:52:25+00:00\",\n \"message\": \"Added tag 3.8 for changeset f85de28eae32\",\n \"type\": \"tag\",\n \"target\": {\n \"hash\": \"f85de28eae32e7d3064b1a1321309071bbaaa069\",\n \"repository\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/hg\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/seanfarley/hg/avatar/32/\"\n }\n },\n \"type\": \"repository\",\n \"name\": \"hg\",\n \"full_name\": \"seanfarley/hg\",\n \"uuid\": \"{c75687fb-e99d-4579-9087-190dbd406d30}\"\n },\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069\"\n },\n \"comments\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/comments\"\n },\n \"patch\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/patch/f85de28eae32e7d3064b1a1321309071bbaaa069\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/hg/commits/f85de28eae32e7d3064b1a1321309071bbaaa069\"\n },\n \"diff\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/diff/f85de28eae32e7d3064b1a1321309071bbaaa069\"\n },\n \"approve\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/approve\"\n },\n \"statuses\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/statuses\"\n }\n },\n \"author\": {\n \"raw\": \"Sean Farley \",\n \"type\": \"author\",\n \"user\": {\n \"username\": \"seanfarley\",\n \"nickname\": \"seanfarley\",\n \"display_name\": \"Sean Farley\",\n \"type\": \"user\",\n \"uuid\": \"{a295f8a8-5876-4d43-89b5-3ad8c6c3c51d}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/seanfarley\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/seanfarley/avatar/32/\"\n }\n }\n }\n },\n \"parents\": [\n {\n \"hash\": \"9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2\",\n \"type\": \"commit\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/seanfarley/hg/commits/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2\"\n }\n }\n }\n ],\n \"date\": \"2016-05-01T04:21:17+00:00\",\n \"message\": \"debian: alphabetize build deps\",\n \"type\": \"commit\"\n }\n}\n```", "parameters": [], "tags": [ "refs" ] }, "parameters": [ { "name": "name", "in": "path", "description": "The name of the tag.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/src": { "get": { "responses": { "200": { "description": "If the path matches a file, then the raw contents of the file are\nreturned (unless the `format=meta` query parameter was provided,\nin which case a json document containing the file's meta data is\nreturned). If the path matches a directory, then a paginated\nlist of file and directory entries is returned (if the\n`format=meta` query parameter was provided, then the json document\ncontaining the directory's meta data is returned).\n", "schema": { "$ref": "#/definitions/paginated_treeentries" } }, "404": { "description": "If the path or commit in the URL does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "This endpoint redirects the client to the directory listing of the\nroot directory on the main branch.\n\nThis is equivalent to directly hitting\n[/2.0/repositories/{username}/{repo_slug}/src/{commit}/{path}](src/%7Bcommit%7D/%7Bpath%7D)\nwithout having to know the name or SHA1 of the repo's main branch.\n\nTo create new commits, [POST to this endpoint](#post)", "parameters": [ { "name": "format", "in": "query", "description": "Instead of returning the file's contents, return the (json) meta data for it.", "required": false, "type": "string", "enum": [ "meta" ] } ], "tags": [ "source", "repositories" ] }, "post": { "responses": { "201": { "description": "\n" }, "403": { "description": "If the authenticated user does not have write or admin access", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the repository does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "This endpoint is used to create new commits in the repository by\nuploading files.\n\nTo add a new file to a repository:\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \\\n -F /repo/path/to/image.png=@image.png\n```\n\nThis will create a new commit on top of the main branch, inheriting the\ncontents of the main branch, but adding (or overwriting) the\n`image.png` file to the repository in the `/repo/path/to` directory.\n\nTo create a commit that deletes files, use the `files` parameter:\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \\\n -F files=/file/to/delete/1.txt \\\n -F files=/file/to/delete/2.txt\n```\n\nYou can add/modify/delete multiple files in a request. Rename/move a\nfile by deleting the old path and adding the content at the new path.\n\nThis endpoint accepts `multipart/form-data` (as in the examples above),\nas well as `application/x-www-form-urlencoded`.\n\n## multipart/form-data\n\nA `multipart/form-data` post contains a series of \"form fields\" that\nidentify both the individual files that are being uploaded, as well as\nadditional, optional meta data.\n\nFiles are uploaded in file form fields (those that have a\n`Content-Disposition` parameter) whose field names point to the remote\npath in the repository where the file should be stored. Path field\nnames are always interpreted to be absolute from the root of the\nrepository, regardless whether the client uses a leading slash (as the\nabove `curl` example did).\n\nFile contents are treated as bytes and are not decoded as text.\n\nThe commit message, as well as other non-file meta data for the\nrequest, is sent along as normal form field elements. Meta data fields\nshare the same namespace as the file objects. For `multipart/form-data`\nbodies that should not lead to any ambiguity, as the\n`Content-Disposition` header will contain the `filename` parameter to\ndistinguish between a file named \"message\" and the commit message field.\n\n## application/x-www-form-urlencoded\n\nIt is also possible to upload new files using a simple\n`application/x-www-form-urlencoded` POST. This can be convenient when\nuploading pure text files:\n\n```\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src \\\n --data-urlencode \"/path/to/me.txt=Lorem ipsum.\" \\\n --data-urlencode \"message=Initial commit\" \\\n --data-urlencode \"author=Erik van Zijst \"\n```\n\nThere could be a field name clash if a client were to upload a file\nnamed \"message\", as this filename clashes with the meta data property\nfor the commit message. To avoid this and to upload files whose names\nclash with the meta data properties, use a leading slash for the files,\ne.g. `curl --data-urlencode \"/message=file contents\"`.\n\nWhen an explicit slash is omitted for a file whose path matches that of\na meta data parameter, then it is interpreted as meta data, not as a\nfile.\n\n## Executables and links\n\nWhile this API aims to facilitate the most common use cases, it is\npossible to perform some more advanced operations like creating a new\nsymlink in the repository, or creating an executable file.\n\nFiles can be supplied with a `x-attributes` value in the\n`Content-Disposition` header. For example, to upload an executable\nfile, as well as create a symlink from `README.txt` to `README`:\n\n```\n--===============1438169132528273974==\nContent-Type: text/plain; charset=\"us-ascii\"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nContent-ID: \"bin/shutdown.sh\"\nContent-Disposition: attachment; filename=\"shutdown.sh\"; x-attributes:\"executable\"\n\n#!/bin/sh\nhalt\n\n--===============1438169132528273974==\nContent-Type: text/plain; charset=\"us-ascii\"\nMIME-Version: 1.0\nContent-Transfer-Encoding: 7bit\nContent-ID: \"/README.txt\"\nContent-Disposition: attachment; filename=\"README.txt\"; x-attributes:\"link\"\n\nREADME\n--===============1438169132528273974==--\n```\n\nLinks are files that contain the target path and have\n`x-attributes:\"link\"` set.\n\nWhen overwriting links with files, or vice versa, the newly uploaded\nfile determines both the new contents, as well as the attributes. That\nmeans uploading a file without specifying `x-attributes=\"link\"` will\ncreate a regular file, even if the parent commit hosted a symlink at\nthe same path.\n\nThe same applies to executables. When modifying an existing executable\nfile, the form-data file element must include\n`x-attributes=\"executable\"` in order to preserve the executable status\nof the file.\n\nNote that this API does not support the creation or manipulation of\nsubrepos / submodules.", "parameters": [ { "name": "message", "in": "query", "description": "The commit message. When omitted, Bitbucket uses a canned string.", "required": false, "type": "string" }, { "name": "author", "in": "query", "description": "\nThe raw string to be used as the new commit's author.\nThis string follows the format\n`Erik van Zijst `.\n\nWhen omitted, Bitbucket uses the authenticated user's\nfull/display name and primary email address. Commits cannot\nbe created anonymously.", "required": false, "type": "string" }, { "name": "parents", "in": "query", "description": "\nA comma-separated list of SHA1s of the commits that should\nbe the parents of the newly created commit.\n\nWhen omitted, the new commit will inherit from and become\na child of the main branch's tip/HEAD commit.\n\nWhen more than one SHA1 is provided, the first SHA1\nidentifies the commit from which the content will be\ninherited.\n\nWhen more than 2 parents are provided on a Mercurial repo,\na 400 is returned as Mercurial does not support \"octopus\nmerges\".", "required": false, "type": "string" }, { "name": "files", "in": "query", "description": "\nOptional field that declares the files that the request is\nmanipulating. When adding a new file to a repo, or when\noverwriting an existing file, the client can just upload\nthe full contents of the file in a normal form field and\nthe use of this `files` meta data field is redundant.\nHowever, when the `files` field contains a file path that\ndoes not have a corresponding, identically-named form\nfield, then Bitbucket interprets that as the client wanting\nto replace the named file with the null set and the file is\ndeleted instead.\n\nPaths in the repo that are referenced in neither files nor\nan individual file field, remain unchanged and carry over\nfrom the parent to the new commit.\n\nThis API does not support renaming as an explicit feature.\nTo rename a file, simply delete it and recreate it under\nthe new name in the same commit.\n", "required": false, "type": "string" }, { "name": "branch", "in": "query", "description": "\nThe name of the branch that the new commit should be\ncreated on. When omitted, the commit will be created on top\nof the main branch and will become the main branch's new\nhead.\n\nWhen a branch name is provided that already exists in the\nrepo, then the commit will be created on top of that\nbranch. In this case, *if* a parent SHA1 was also provided,\nthen it is asserted that the parent is the branch's\ntip/HEAD at the time the request is made. When this is not\nthe case, a 409 is returned.\n\nThis API cannot be used to create new anonymous heads in\nMercurial repositories.\n\nWhen a new branch name is specified (that does not already\nexist in the repo), and no parent SHA1s are provided, then\nthe new commit will inherit from the current main branch's\ntip/HEAD commit, but not advance the main branch. The new\ncommit will be the new branch. When the request *also*\nspecifies a parent SHA1, then the new commit and branch\nare created directly on top of the parent commit,\nregardless of the state of the main branch.\n\nWhen a branch name is not specified, but a parent SHA1 is\nprovided, then Bitbucket asserts that it represents the\nmain branch's current HEAD/tip, or a 409 is returned.\n\nWhen a branch name is not specified and the repo is empty,\nthe new commit will become the repo's root commit and will\nbe on the main branch.\n\nWhen a branch name is specified and the repo is empty, the\nnew commit will become the repo's root commit and also\ndefine the repo's main branch going forward.\n\nThis API cannot be used to create additional root commits\nin non-empty repos.\n\nThe branch field cannot be repeated.\n\nAs a side effect, this API can be used to create a new\nbranch without modifying any files, by specifying a new\nbranch name in this field, together with `parents`, but\nomitting the `files` fields, while not sending any files.\nThis will create a new commit and branch with the same\ncontents as the first parent. The diff of this commit\nagainst its first parent will be empty.\n", "required": false, "type": "string" } ], "tags": [ "source", "repositories" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/src/{commit}/{path}": { "get": { "responses": { "200": { "description": "If the path matches a file, then the raw contents of the file are\nreturned. If the `format=meta` query parameter is provided,\na json document containing the file's meta data is\nreturned. If the `format=rendered` query parameter is provided,\nthe contents of the file in HTML-formated rendered markup is returned.\nIf the path matches a directory, then a paginated\nlist of file and directory entries is returned (if the\n`format=meta` query parameter was provided, then the json document\ncontaining the directory's meta data is returned.)\n", "schema": { "$ref": "#/definitions/paginated_treeentries" } }, "404": { "description": "If the path or commit in the URL does not exist.", "schema": { "$ref": "#/definitions/error" } }, "555": { "description": "If the call times out, possibly because the specifiedrecursion depth is too large.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "This endpoints is used to retrieve the contents of a single file,\nor the contents of a directory at a specified revision.\n\n## Raw file contents\n\nWhen `path` points to a file, this endpoint returns the raw contents.\nThe response's Content-Type is derived from the filename\nextension (not from the contents). The file contents are not processed\nand no character encoding/recoding is performed and as a result no\ncharacter encoding is included as part of the Content-Type.\n\nThe `Content-Disposition` header will be \"attachment\" to prevent\nbrowsers from running executable files.\n\nIf the file is managed by LFS, then a 301 redirect pointing to\nAtlassian's media services platform is returned.\n\nThe response includes an ETag that is based on the contents of the file\nand its attributes. This means that an empty `__init__.py` always\nreturns the same ETag, regardless on the directory it lives in, or the\ncommit it is on.\n\n## File meta data\n\nWhen the request for a file path includes the query parameter\n`?format=meta`, instead of returning the file's raw contents, Bitbucket\ninstead returns the JSON object describing the file's properties:\n\n```javascript\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef/tests/__init__.py?format=meta\n{\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py\"\n },\n \"meta\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py?format=meta\"\n }\n },\n \"path\": \"tests/__init__.py\",\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n }\n }\n },\n \"attributes\": [],\n \"type\": \"commit_file\",\n \"size\": 0\n}\n```\n\nFile objects contain an `attributes` element that contains a list of\npossible modifiers. Currently defined values are:\n\n* `link` -- indicates that the entry is a symbolic link. The contents\n of the file represent the path the link points to.\n* `executable` -- indicates that the file has the executable bit set.\n* `subrepository` -- indicates that the entry points to a submodule or\n subrepo. The contents of the file is the SHA1 of the repository\n pointed to.\n* `binary` -- indicates whether Bitbucket thinks the file is binary.\n\nThis endpoint can provide an alternative to how a HEAD request can be\nused to check for the existence of a file, or a file's size without\nincurring the overhead of receiving its full contents.\n\n\n## Directory listings\n\nWhen `path` points to a directory instead of a file, the response is a\npaginated list of directory and file objects in the same order as the\nunderlying SCM system would return them.\n\nFor example:\n\n```javascript\n$ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef/tests\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"path\": \"tests/test_project\",\n \"type\": \"commit_directory\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/\"\n },\n \"meta\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/?format=meta\"\n }\n },\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n }\n }\n }\n },\n {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py\"\n },\n \"meta\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py?format=meta\"\n }\n },\n \"path\": \"tests/__init__.py\",\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\"\n }\n }\n },\n \"attributes\": [],\n \"type\": \"commit_file\",\n \"size\": 0\n }\n ],\n \"page\": 1,\n \"size\": 2\n}\n```\n\nWhen listing the contents of the repo's root directory, the use of a\ntrailing slash at the end of the URL is required.\n\nThe response by default is not recursive, meaning that only the direct contents of\na path are returned. The response does not recurse down into\nsubdirectories. In order to \"walk\" the entire directory tree, the\nclient can either parse each response and follow the `self` links of each\n`commit_directory` object, or can specify a `max_depth` to recurse to.\n\nThe max_depth parameter will do a breadth-first search to return the contents of the subdirectories\nup to the depth specified. Breadth-first search was chosen as it leads to the least amount of\nfile system operations for git. If the `max_depth` parameter is specified to be too\nlarge, the call will time out and return a 555.\n\nEach returned object is either a `commit_file`, or a `commit_directory`,\nboth of which contain a `path` element. This path is the absolute path\nfrom the root of the repository. Each object also contains a `commit`\nobject which embeds the commit the file is on. Note that this is merely\nthe commit that was used in the URL. It is *not* the commit that last\nmodified the file.\n\nDirectory objects have 2 representations. Their `self` link returns the\npaginated contents of the directory. The `meta` link on the other hand\nreturns the actual `directory` object itself, e.g.:\n\n```javascript\n{\n \"path\": \"tests/test_project\",\n \"type\": \"commit_directory\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/\"\n },\n \"meta\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/?format=meta\"\n }\n },\n \"commit\": { ... }\n}\n```\n\n## Querying, filtering and sorting\n\nLike most API endpoints, this API supports the Bitbucket\nquerying/filtering syntax and so you could filter a directory listing\nto only include entries that match certain criteria. For instance, to\nlist all binary files over 1kb use the expression:\n\n`size > 1024 and attributes = \"binary\"`\n\nwhich after urlencoding yields the query string:\n\n`?q=size%3E1024+and+attributes%3D%22binary%22`\n\nTo change the ordering of the response, use the `?sort` parameter:\n\n`.../src/eefd5ef/?sort=-size`\n\nSee [filtering and sorting](../../../../../../meta/filtering) for more\ndetails.", "parameters": [ { "name": "format", "in": "query", "description": "If 'meta' is provided, returns the (json) meta data for the contents of the file. If 'rendered' is provided, returns the contents of a non-binary file in HTML-formatted rendered markup. Since Git and Mercurial do not generally track what text encoding scheme is used, this endpoint attempts to detect the most appropriate character encoding. While usually correct, determining the character encoding can be ambiguous which in exceptional cases can lead to misinterpretation of the characters. As such, the raw element in the response object should not be treated as equivalent to the file's actual contents.", "required": false, "type": "string", "enum": [ "meta", "rendered" ] }, { "name": "q", "in": "query", "description": "Optional filter expression as per [filtering and sorting](../../../../../../meta/filtering).", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "Optional sorting parameter as per [filtering and sorting](../../../../../../meta/filtering#query-sort).", "required": false, "type": "string" }, { "name": "max_depth", "in": "query", "description": "If provided, returns the contents of the repository and its subdirectories recursively until the specified max_depth of nested directories. When omitted, this defaults to 1.", "required": false, "type": "integer" } ], "tags": [ "source", "repositories" ] }, "parameters": [ { "name": "commit", "in": "path", "description": "The commit's SHA1.", "required": true, "type": "string" }, { "name": "path", "in": "path", "description": "Path to the file.", "required": true, "type": "string" }, { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/versions": { "get": { "responses": { "200": { "description": "The versions that have been defined in the issue tracker.", "schema": { "$ref": "#/definitions/paginated_versions" } }, "404": { "description": "The specified repository does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the versions that have been defined in the issue tracker.\n\nThis resource is only available on repositories that have the issue\ntracker enabled.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/versions/{version_id}": { "get": { "responses": { "200": { "description": "The specified version object.", "schema": { "$ref": "#/definitions/version" } }, "404": { "description": "The specified repository or version does not exist or does not have the issue tracker enabled.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "issue" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specified issue tracker version object.", "parameters": [], "tags": [ "issue_tracker" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "version_id", "in": "path", "description": "The version's id", "required": true, "type": "integer" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/repositories/{workspace}/{repo_slug}/watchers": { "get": { "responses": { "200": { "description": "A paginated list of all the watchers on the specified repository." } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all the watchers on the specified\nrepository.", "parameters": [], "tags": [ "repositories" ] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets": { "get": { "responses": { "200": { "description": "A paginated list of snippets.", "schema": { "$ref": "#/definitions/paginated_snippets" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all snippets. Like pull requests, repositories and workspaces, the\nfull set of snippets is defined by what the current user has access to.\n\nThis includes all snippets owned by any of the workspaces the user is a member of,\nor snippets by other users that the current user is either watching or has collaborated\non (for instance by commenting on it).\n\nTo limit the set of returned snippets, apply the\n`?role=[owner|contributor|member]` query parameter where the roles are\ndefined as follows:\n\n* `owner`: all snippets owned by the current user\n* `contributor`: all snippets owned by, or watched by the current user\n* `member`: created in a workspaces or watched by the current user\n\nWhen no role is specified, all public snippets are returned, as well as all\nprivately owned snippets watched or commented on.\n\nThe returned response is a normal paginated JSON list. This endpoint\nonly supports `application/json` responses and no\n`multipart/form-data` or `multipart/related`. As a result, it is not\npossible to include the file contents.", "parameters": [ { "name": "role", "in": "query", "description": "Filter down the result based on the authenticated user's role (`owner`, `contributor`, or `member`).", "required": false, "type": "string", "enum": [ "owner", "contributor", "member" ] } ], "tags": [ "snippets" ] }, "post": { "responses": { "201": { "description": "The newly created snippet object.", "schema": { "$ref": "#/definitions/snippet" }, "headers": { "Location": { "type": "string", "description": "The URL of the newly created snippet." } } }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new snippet under the authenticated user's account.\n\nSnippets can contain multiple files. Both text and binary files are\nsupported.\n\nThe simplest way to create a new snippet from a local file:\n\n $ curl -u username:password -X POST https://api.bitbucket.org/2.0/snippets -F file=@image.png\n\nCreating snippets through curl has a few limitations and so let's look\nat a more complicated scenario.\n\nSnippets are created with a multipart POST. Both `multipart/form-data`\nand `multipart/related` are supported. Both allow the creation of\nsnippets with both meta data (title, etc), as well as multiple text\nand binary files.\n\nThe main difference is that `multipart/related` can use rich encoding\nfor the meta data (currently JSON).\n\n\nmultipart/related (RFC-2387)\n----------------------------\n\nThis is the most advanced and efficient way to create a paste.\n\n POST /2.0/snippets/evzijst HTTP/1.1\n Content-Length: 1188\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"title\": \"My snippet\",\n \"is_private\": true,\n \"scm\": \"hg\",\n \"files\": {\n \"foo.txt\": {},\n \"image.png\": {}\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"foo.txt\"\n Content-Disposition: attachment; filename=\"foo.txt\"\n\n foo\n\n --===============1438169132528273974==\n Content-Type: image/png\n MIME-Version: 1.0\n Content-Transfer-Encoding: base64\n Content-ID: \"image.png\"\n Content-Disposition: attachment; filename=\"image.png\"\n\n iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAABD0lEQVR4Ae3VMUoDQRTG8ccUaW2m\n TKONFxArJYJamCvkCnZTaa+VnQdJSBFl2SMsLFrEWNjZBZs0JgiL/+KrhhVmJRbCLPx4O+/DT2TB\n cbblJxf+UWFVVRNsEGAtgvJxnLm2H+A5RQ93uIl+3632PZyl/skjfOn9Gvdwmlcw5aPUwimG+NT5\n EnNN036IaZePUuIcK533NVfal7/5yjWeot2z9ta1cAczHEf7I+3J0ws9Cgx0fsOFpmlfwKcWPuBQ\n 73Oc4FHzBaZ8llq4q1mr5B2mOUCt815qYR8eB1hG2VJ7j35q4RofaH7IG+Xrf/PfJhfmwtfFYoIN\n AqxFUD6OMxcvkO+UfKfkOyXfKdsv/AYCHMLVkHAFWgAAAABJRU5ErkJggg==\n --===============1438169132528273974==--\n\nThe request contains multiple parts and is structured as follows.\n\nThe first part is the JSON document that describes the snippet's\nproperties or meta data. It either has to be the first part, or the\nrequest's `Content-Type` header must contain the `start` parameter to\npoint to it.\n\nThe remaining parts are the files of which there can be zero or more.\nEach file part should contain the `Content-ID` MIME header through\nwhich the JSON meta data's `files` element addresses it. The value\nshould be the name of the file.\n\n`Content-Disposition` is an optional MIME header. The header's\noptional `filename` parameter can be used to specify the file name\nthat Bitbucket should use when writing the file to disk. When present,\n`filename` takes precedence over the value of `Content-ID`.\n\nWhen the JSON body omits the `files` element, the remaining parts are\nnot ignored. Instead, each file is added to the new snippet as if its\nname was explicitly linked (the use of the `files` elements is\nmandatory for some operations like deleting or renaming files).\n\n\nmultipart/form-data\n-------------------\n\nThe use of JSON for the snippet's meta data is optional. Meta data can\nalso be supplied as regular form fields in a more conventional\n`multipart/form-data` request:\n\n $ curl -X POST -u credentials https://api.bitbucket.org/2.0/snippets -F title=\"My snippet\" -F file=@foo.txt -F file=@image.png\n\n POST /2.0/snippets HTTP/1.1\n Content-Length: 951\n Content-Type: multipart/form-data; boundary=----------------------------63a4b224c59f\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"file\"; filename=\"foo.txt\"\n Content-Type: text/plain\n\n foo\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"file\"; filename=\"image.png\"\n Content-Type: application/octet-stream\n\n ?PNG\n\n IHDR?1??I.....\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"title\"\n\n My snippet\n ------------------------------63a4b224c59f--\n\nHere the meta data properties are included as flat, top-level form\nfields. The file attachments use the `file` field name. To attach\nmultiple files, simply repeat the field.\n\nThe advantage of `multipart/form-data` over `multipart/related` is\nthat it can be easier to build clients.\n\nEssentially all properties are optional, `title` and `files` included.\n\n\nSharing and Visibility\n----------------------\n\nSnippets can be either public (visible to anyone on Bitbucket, as well\nas anonymous users), or private (visible only to members of the workspace).\nThis is controlled through the snippet's `is_private` element:\n\n* **is_private=false** -- everyone, including anonymous users can view\n the snippet\n* **is_private=true** -- only workspace members can view the snippet\n\nTo create the snippet under a workspace, just append the workspace ID\nto the URL. See [`/2.0/snippets/{workspace}`](./snippets/%7Bworkspace%7D#post).", "parameters": [ { "name": "_body", "in": "body", "description": "The new snippet object.", "required": true, "schema": { "$ref": "#/definitions/snippet" } } ], "tags": [ "snippets" ] }, "parameters": [] }, "/snippets/{workspace}": { "get": { "responses": { "200": { "description": "A paginated list of snippets.", "schema": { "$ref": "#/definitions/paginated_snippets" } }, "404": { "description": "If the user does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Identical to [`/snippets`](../snippets), except that the result is further filtered\nby the snippet owner and only those that are owned by `{workspace}` are\nreturned.", "parameters": [ { "name": "role", "in": "query", "description": "Filter down the result based on the authenticated user's role (`owner`, `contributor`, or `member`).", "required": false, "type": "string", "enum": [ "owner", "contributor", "member" ] } ], "tags": [ "snippets" ] }, "post": { "responses": { "201": { "description": "The newly created snippet object.", "schema": { "$ref": "#/definitions/snippet" }, "headers": { "Location": { "type": "string", "description": "The URL of the newly created snippet." } } }, "401": { "description": "If the request was not authenticated", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the authenticated user does not have permission to create snippets in the specified workspace.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Identical to [`/snippets`](../snippets#post), except that the new snippet will be\ncreated under the workspace specified in the path parameter\n`{workspace}`.", "parameters": [ { "name": "_body", "in": "body", "description": "The new snippet object.", "required": true, "schema": { "$ref": "#/definitions/snippet" } } ], "tags": [ "snippets" ] }, "parameters": [ { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}": { "delete": { "responses": { "204": { "description": "If the snippet was deleted successfully." }, "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have permission to delete the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes a snippet and returns an empty response.", "parameters": [], "tags": [ "snippets" ] }, "get": { "responses": { "200": { "description": "The snippet object.", "schema": { "$ref": "#/definitions/snippet" } }, "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have access to the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } }, "410": { "description": "If the snippet marked as spam.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Retrieves a single snippet.\n\nSnippets support multiple content types:\n\n* application/json\n* multipart/related\n* multipart/form-data\n\n\napplication/json\n----------------\n\nThe default content type of the response is `application/json`.\nSince JSON is always `utf-8`, it cannot reliably contain file contents\nfor files that are not text. Therefore, JSON snippet documents only\ncontain the filename and links to the file contents.\n\nThis means that in order to retrieve all parts of a snippet, N+1\nrequests need to be made (where N is the number of files in the\nsnippet).\n\n\nmultipart/related\n-----------------\n\nTo retrieve an entire snippet in a single response, use the\n`Accept: multipart/related` HTTP request header.\n\n $ curl -H \"Accept: multipart/related\" https://api.bitbucket.org/2.0/snippets/evzijst/1\n\nResponse:\n\n HTTP/1.1 200 OK\n Content-Length: 2214\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/snippets/evzijst/kypj\"\n },\n \"comments\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/comments\"\n },\n \"watchers\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/watchers\"\n },\n \"commits\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/commits\"\n }\n },\n \"id\": kypj,\n \"title\": \"My snippet\",\n \"created_on\": \"2014-12-29T22:22:04.790331+00:00\",\n \"updated_on\": \"2014-12-29T22:22:04.790331+00:00\",\n \"is_private\": false,\n \"files\": {\n \"foo.txt\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/files/367ab19/foo.txt\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/snippets/evzijst/kypj#file-foo.txt\"\n }\n }\n },\n \"image.png\": {\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/evzijst/kypj/files/367ab19/image.png\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/snippets/evzijst/kypj#file-image.png\"\n }\n }\n }\n ],\n \"owner\": {\n \"username\": \"evzijst\",\n \"nickname\": \"evzijst\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/evzijst\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/evzijst\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Jul/31/erik-avatar-725122544-0_avatar.png\"\n }\n }\n },\n \"creator\": {\n \"username\": \"evzijst\",\n \"nickname\": \"evzijst\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/evzijst\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/evzijst\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket-staging-assetroot.s3.amazonaws.com/c/photos/2013/Jul/31/erik-avatar-725122544-0_avatar.png\"\n }\n }\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"foo.txt\"\n Content-Disposition: attachment; filename=\"foo.txt\"\n\n foo\n\n --===============1438169132528273974==\n Content-Type: image/png\n MIME-Version: 1.0\n Content-Transfer-Encoding: base64\n Content-ID: \"image.png\"\n Content-Disposition: attachment; filename=\"image.png\"\n\n iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAABD0lEQVR4Ae3VMUoDQRTG8ccUaW2m\n TKONFxArJYJamCvkCnZTaa+VnQdJSBFl2SMsLFrEWNjZBZs0JgiL/+KrhhVmJRbCLPx4O+/DT2TB\n cbblJxf+UWFVVRNsEGAtgvJxnLm2H+A5RQ93uIl+3632PZyl/skjfOn9Gvdwmlcw5aPUwimG+NT5\n EnNN036IaZePUuIcK533NVfal7/5yjWeot2z9ta1cAczHEf7I+3J0ws9Cgx0fsOFpmlfwKcWPuBQ\n 73Oc4FHzBaZ8llq4q1mr5B2mOUCt815qYR8eB1hG2VJ7j35q4RofaH7IG+Xrf/PfJhfmwtfFYoIN\n AqxFUD6OMxcvkO+UfKfkOyXfKdsv/AYCHMLVkHAFWgAAAABJRU5ErkJggg==\n --===============1438169132528273974==--\n\nmultipart/form-data\n-------------------\n\nAs with creating new snippets, `multipart/form-data` can be used as an\nalternative to `multipart/related`. However, the inherently flat\nstructure of form-data means that only basic, root-level properties\ncan be returned, while nested elements like `links` are omitted:\n\n $ curl -H \"Accept: multipart/form-data\" https://api.bitbucket.org/2.0/snippets/evzijst/kypj\n\nResponse:\n\n HTTP/1.1 200 OK\n Content-Length: 951\n Content-Type: multipart/form-data; boundary=----------------------------63a4b224c59f\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"title\"\n Content-Type: text/plain; charset=\"utf-8\"\n\n My snippet\n ------------------------------63a4b224c59f--\n Content-Disposition: attachment; name=\"file\"; filename=\"foo.txt\"\n Content-Type: text/plain\n\n foo\n\n ------------------------------63a4b224c59f\n Content-Disposition: attachment; name=\"file\"; filename=\"image.png\"\n Content-Transfer-Encoding: base64\n Content-Type: application/octet-stream\n\n iVBORw0KGgoAAAANSUhEUgAAABQAAAAoCAYAAAD+MdrbAAABD0lEQVR4Ae3VMUoDQRTG8ccUaW2m\n TKONFxArJYJamCvkCnZTaa+VnQdJSBFl2SMsLFrEWNjZBZs0JgiL/+KrhhVmJRbCLPx4O+/DT2TB\n cbblJxf+UWFVVRNsEGAtgvJxnLm2H+A5RQ93uIl+3632PZyl/skjfOn9Gvdwmlcw5aPUwimG+NT5\n EnNN036IaZePUuIcK533NVfal7/5yjWeot2z9ta1cAczHEf7I+3J0ws9Cgx0fsOFpmlfwKcWPuBQ\n 73Oc4FHzBaZ8llq4q1mr5B2mOUCt815qYR8eB1hG2VJ7j35q4RofaH7IG+Xrf/PfJhfmwtfFYoIN\n AqxFUD6OMxcvkO+UfKfkOyXfKdsv/AYCHMLVkHAFWgAAAABJRU5ErkJggg==\n ------------------------------5957323a6b76--", "parameters": [], "tags": [ "snippets" ], "produces": [ "application/json", "multipart/related", "multipart/form-data" ] }, "put": { "responses": { "200": { "description": "The updated snippet object.", "schema": { "$ref": "#/definitions/snippet" } }, "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have permission to update the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Used to update a snippet. Use this to add and delete files and to\nchange a snippet's title.\n\nTo update a snippet, one can either PUT a full snapshot, or only the\nparts that need to be changed.\n\nThe contract for PUT on this API is that properties missing from the\nrequest remain untouched so that snippets can be efficiently\nmanipulated with differential payloads.\n\nTo delete a property (e.g. the title, or a file), include its name in\nthe request, but omit its value (use `null`).\n\nAs in Git, explicit renaming of files is not supported. Instead, to\nrename a file, delete it and add it again under another name. This can\nbe done atomically in a single request. Rename detection is left to\nthe SCM.\n\nPUT supports three different content types for both request and\nresponse bodies:\n\n* `application/json`\n* `multipart/related`\n* `multipart/form-data`\n\nThe content type used for the request body can be different than that\nused for the response. Content types are specified using standard HTTP\nheaders.\n\nUse the `Content-Type` and `Accept` headers to select the desired\nrequest and response format.\n\n\napplication/json\n----------------\n\nAs with creation and retrieval, the content type determines what\nproperties can be manipulated. `application/json` does not support\nfile contents and is therefore limited to a snippet's meta data.\n\nTo update the title, without changing any of its files:\n\n $ curl -X POST -H \"Content-Type: application/json\" https://api.bitbucket.org/2.0/snippets/evzijst/kypj -d '{\"title\": \"Updated title\"}'\n\n\nTo delete the title:\n\n $ curl -X POST -H \"Content-Type: application/json\" https://api.bitbucket.org/2.0/snippets/evzijst/kypj -d '{\"title\": null}'\n\nNot all parts of a snippet can be manipulated. The owner and creator\nfor instance are immutable.\n\n\nmultipart/related\n-----------------\n\n`multipart/related` can be used to manipulate all of a snippet's\nproperties. The body is identical to a POST. properties omitted from\nthe request are left unchanged. Since the `start` part contains JSON,\nthe mechanism for manipulating the snippet's meta data is identical\nto `application/json` requests.\n\nTo update one of a snippet's file contents, while also changing its\ntitle:\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 288\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"title\": \"My updated snippet\",\n \"files\": {\n \"foo.txt\": {}\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"foo.txt\"\n Content-Disposition: attachment; filename=\"foo.txt\"\n\n Updated file contents.\n\n --===============1438169132528273974==--\n\nHere only the parts that are changed are included in the body. The\nother files remain untouched.\n\nNote the use of the `files` list in the JSON part. This list contains\nthe files that are being manipulated. This list should have\ncorresponding multiparts in the request that contain the new contents\nof these files.\n\nIf a filename in the `files` list does not have a corresponding part,\nit will be deleted from the snippet, as shown below:\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 188\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"files\": {\n \"image.png\": {}\n }\n }\n\n --===============1438169132528273974==--\n\nTo simulate a rename, delete a file and add the same file under\nanother name:\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 212\n Content-Type: multipart/related; start=\"snippet\"; boundary=\"===============1438169132528273974==\"\n MIME-Version: 1.0\n\n --===============1438169132528273974==\n Content-Type: application/json; charset=\"utf-8\"\n MIME-Version: 1.0\n Content-ID: snippet\n\n {\n \"files\": {\n \"foo.txt\": {},\n \"bar.txt\": {}\n }\n }\n\n --===============1438169132528273974==\n Content-Type: text/plain; charset=\"us-ascii\"\n MIME-Version: 1.0\n Content-Transfer-Encoding: 7bit\n Content-ID: \"bar.txt\"\n Content-Disposition: attachment; filename=\"bar.txt\"\n\n foo\n\n --===============1438169132528273974==--\n\n\nmultipart/form-data\n-----------------\n\nAgain, one can also use `multipart/form-data` to manipulate file\ncontents and meta data atomically.\n\n $ curl -X PUT http://localhost:12345/2.0/snippets/evzijst/kypj -F title=\"My updated snippet\" -F file=@foo.txt\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 351\n Content-Type: multipart/form-data; boundary=----------------------------63a4b224c59f\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"file\"; filename=\"foo.txt\"\n Content-Type: text/plain\n\n foo\n\n ------------------------------63a4b224c59f\n Content-Disposition: form-data; name=\"title\"\n\n My updated snippet\n ------------------------------63a4b224c59f\n\nTo delete a file, omit its contents while including its name in the\n`files` field:\n\n $ curl -X PUT https://api.bitbucket.org/2.0/snippets/evzijst/kypj -F files=image.png\n\n PUT /2.0/snippets/evzijst/kypj HTTP/1.1\n Content-Length: 149\n Content-Type: multipart/form-data; boundary=----------------------------ef8871065a86\n\n ------------------------------ef8871065a86\n Content-Disposition: form-data; name=\"files\"\n\n image.png\n ------------------------------ef8871065a86--\n\nThe explicit use of the `files` element in `multipart/related` and\n`multipart/form-data` is only required when deleting files.\nThe default mode of operation is for file parts to be processed,\nregardless of whether or not they are listed in `files`, as a\nconvenience to the client.", "parameters": [], "tags": [ "snippets" ], "consumes": [ "application/json", "multipart/related", "multipart/form-data" ], "produces": [ "application/json", "multipart/related", "multipart/form-data" ] }, "parameters": [ { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}/comments": { "get": { "responses": { "200": { "description": "A paginated list of snippet comments, ordered by creation date.", "schema": { "$ref": "#/definitions/paginated_snippet_comments" } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Used to retrieve a paginated list of all comments for a specific\nsnippet.\n\nThis resource works identical to commit and pull request comments.\n\nThe default sorting is oldest to newest and can be overridden with\nthe `sort` query parameter.", "parameters": [], "tags": [ "snippets" ] }, "post": { "responses": { "201": { "description": "The newly created comment.", "schema": { "$ref": "#/definitions/snippet" }, "headers": { "Location": { "type": "string", "description": "The URL of the new comment" } } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new comment.\n\nThe only required field in the body is `content.raw`.\n\nTo create a threaded reply to an existing comment, include `parent.id`.", "parameters": [ { "name": "_body", "in": "body", "description": "The contents of the new comment.", "required": true, "schema": { "$ref": "#/definitions/snippet" } } ], "tags": [ "snippets" ] }, "parameters": [ { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}/comments/{comment_id}": { "delete": { "responses": { "204": { "description": "Indicates the comment was deleted successfully." }, "403": { "description": "If the authenticated user is not the author of the comment.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the comment or the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes a snippet comment.\n\nComments can only be removed by their author.", "parameters": [], "tags": [ "snippets" ] }, "get": { "responses": { "200": { "description": "The specified comment.", "schema": { "$ref": "#/definitions/snippet_comment" } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the comment or snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the specific snippet comment.", "parameters": [], "tags": [ "snippets" ] }, "put": { "responses": { "200": { "description": "The updated comment object." }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the comment or snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates a comment.\n\nComments can only be updated by their author.", "parameters": [], "tags": [ "snippets" ] }, "parameters": [ { "name": "comment_id", "in": "path", "description": "The id of the comment.", "required": true, "type": "integer" }, { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}/commits": { "get": { "responses": { "200": { "description": "The paginated list of snippet commits.", "schema": { "$ref": "#/definitions/paginated_snippet_commit" } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the changes (commits) made on this snippet.", "parameters": [], "tags": [ "snippets" ] }, "parameters": [ { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}/commits/{revision}": { "get": { "responses": { "200": { "description": "The specified snippet commit.", "schema": { "$ref": "#/definitions/snippet_commit" } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the commit or the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the changes made on this snippet in this commit.", "parameters": [], "tags": [ "snippets" ] }, "parameters": [ { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "revision", "in": "path", "description": "The commit's SHA1.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}/files/{path}": { "get": { "responses": { "302": { "description": "A redirect to the most recent revision of the specified file.", "headers": { "Location": { "type": "string", "description": "The URL of the most recent file revision." } } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Convenience resource for getting to a snippet's raw files without the\nneed for first having to retrieve the snippet itself and having to pull\nout the versioned file links.", "parameters": [], "tags": [ "snippet" ] }, "parameters": [ { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "path", "in": "path", "description": "Path to the file.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}/watch": { "delete": { "responses": { "204": { "description": "Indicates the user stopped watching the snippet successfully.", "schema": { "$ref": "#/definitions/paginated_users" } }, "401": { "description": "If the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Used to stop watching a specific snippet. Returns 204 (No Content)\nto indicate success.", "parameters": [], "tags": [ "snippets" ] }, "get": { "responses": { "204": { "description": "If the authenticated user is watching the snippet.", "schema": { "$ref": "#/definitions/paginated_users" } }, "404": { "description": "If the snippet does not exist, or if the authenticated user is not watching the snippet.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Used to check if the current user is watching a specific snippet.\n\nReturns 204 (No Content) if the user is watching the snippet and 404 if\nnot.\n\nHitting this endpoint anonymously always returns a 404.", "parameters": [], "tags": [ "snippets" ] }, "put": { "responses": { "204": { "description": "Indicates the authenticated user is now watching the snippet.", "schema": { "$ref": "#/definitions/paginated_users" } }, "401": { "description": "If the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Used to start watching a specific snippet. Returns 204 (No Content).", "parameters": [], "tags": [ "snippets" ] }, "parameters": [ { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}/watchers": { "get": { "responses": { "200": { "description": "The paginated list of users watching this snippet", "schema": { "$ref": "#/definitions/paginated_users" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of all users watching a specific snippet.", "parameters": [], "tags": [ "snippets" ], "deprecated": true }, "parameters": [ { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}/{node_id}": { "delete": { "responses": { "204": { "description": "If the snippet was deleted successfully." }, "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have permission to delete the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } }, "405": { "description": "If `{node_id}` is not the latest revision.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the snippet.\n\nNote that this only works for versioned URLs that point to the latest\ncommit of the snippet. Pointing to an older commit results in a 405\nstatus code.\n\nTo delete a snippet, regardless of whether or not concurrent changes\nare being made to it, use `DELETE /snippets/{encoded_id}` instead.", "parameters": [], "tags": [ "snippets" ] }, "get": { "responses": { "200": { "description": "The snippet object.", "schema": { "$ref": "#/definitions/snippet" } }, "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have access to the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet, or the revision does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Identical to `GET /snippets/encoded_id`, except that this endpoint\ncan be used to retrieve the contents of the snippet as it was at an\nolder revision, while `/snippets/encoded_id` always returns the\nsnippet's current revision.\n\nNote that only the snippet's file contents are versioned, not its\nmeta data properties like the title.\n\nOther than that, the two endpoints are identical in behavior.", "parameters": [], "tags": [ "snippets" ], "produces": [ "application/json", "multipart/related", "multipart/form-data" ] }, "put": { "responses": { "200": { "description": "The updated snippet object.", "schema": { "$ref": "#/definitions/snippet" } }, "401": { "description": "If the snippet is private and the request was not authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If authenticated user does not have permission to update the private snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet or the revision does not exist.", "schema": { "$ref": "#/definitions/error" } }, "405": { "description": "If `{node_id}` is not the latest revision.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Identical to `UPDATE /snippets/encoded_id`, except that this endpoint\ntakes an explicit commit revision. Only the snippet's \"HEAD\"/\"tip\"\n(most recent) version can be updated and requests on all other,\nolder revisions fail by returning a 405 status.\n\nUsage of this endpoint over the unrestricted `/snippets/encoded_id`\ncould be desired if the caller wants to be sure no concurrent\nmodifications have taken place between the moment of the UPDATE\nrequest and the original GET.\n\nThis can be considered a so-called \"Compare And Swap\", or CAS\noperation.\n\nOther than that, the two endpoints are identical in behavior.", "parameters": [], "tags": [ "snippets" ], "consumes": [ "application/json", "multipart/related", "multipart/form-data" ], "produces": [ "application/json", "multipart/related", "multipart/form-data" ] }, "parameters": [ { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "node_id", "in": "path", "description": "A commit revision (SHA1).", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}/{node_id}/files/{path}": { "get": { "responses": { "200": { "description": "Returns the contents of the specified file.", "headers": { "Content-Type": { "type": "string", "description": "The mime type as derived from the filename" }, "Content-Disposition": { "type": "string", "description": "attachment" } } }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the file or snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Retrieves the raw contents of a specific file in the snippet. The\n`Content-Disposition` header will be \"attachment\" to avoid issues with\nmalevolent executable files.\n\nThe file's mime type is derived from its filename and returned in the\n`Content-Type` header.\n\nNote that for text files, no character encoding is included as part of\nthe content type.", "parameters": [], "tags": [ "snippets" ] }, "parameters": [ { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "node_id", "in": "path", "description": "A commit revision (SHA1).", "required": true, "type": "string" }, { "name": "path", "in": "path", "description": "Path to the file.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}/{revision}/diff": { "get": { "responses": { "200": { "description": "The raw diff contents." }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the diff of the specified commit against its first parent.\n\nNote that this resource is different in functionality from the `patch`\nresource.\n\nThe differences between a diff and a patch are:\n\n* patches have a commit header with the username, message, etc\n* diffs support the optional `path=foo/bar.py` query param to filter the\n diff to just that one file diff (not supported for patches)\n* for a merge, the diff will show the diff between the merge commit and\n its first parent (identical to how PRs work), while patch returns a\n response containing separate patches for each commit on the second\n parent's ancestry, up to the oldest common ancestor (identical to\n its reachability).\n\nNote that the character encoding of the contents of the diff is\nunspecified as Git and Mercurial do not track this, making it hard for\nBitbucket to reliably determine this.", "parameters": [ { "name": "path", "in": "query", "description": "When used, only one the diff of the specified file will be returned.", "type": "string" } ], "tags": [ "snippets" ] }, "parameters": [ { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "revision", "in": "path", "description": "A revspec expression. This can simply be a commit SHA1, a ref name, or a compare expression like `staging..production`.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/snippets/{workspace}/{encoded_id}/{revision}/patch": { "get": { "responses": { "200": { "description": "The raw patch contents." }, "403": { "description": "If the authenticated user does not have access to the snippet.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the snippet does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "snippet" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the patch of the specified commit against its first\nparent.\n\nNote that this resource is different in functionality from the `diff`\nresource.\n\nThe differences between a diff and a patch are:\n\n* patches have a commit header with the username, message, etc\n* diffs support the optional `path=foo/bar.py` query param to filter the\n diff to just that one file diff (not supported for patches)\n* for a merge, the diff will show the diff between the merge commit and\n its first parent (identical to how PRs work), while patch returns a\n response containing separate patches for each commit on the second\n parent's ancestry, up to the oldest common ancestor (identical to\n its reachability).\n\nNote that the character encoding of the contents of the patch is\nunspecified as Git and Mercurial do not track this, making it hard for\nBitbucket to reliably determine this.", "parameters": [], "tags": [ "snippets" ] }, "parameters": [ { "name": "encoded_id", "in": "path", "description": "The snippet id.", "required": true, "type": "string" }, { "name": "revision", "in": "path", "description": "A revspec expression. This can simply be a commit SHA1, a ref name, or a compare expression like `staging..production`.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/teams": { "get": { "responses": { "200": { "description": "A paginated list of teams.", "schema": { "$ref": "#/definitions/paginated_teams" } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "team" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all the teams that the authenticated user is associated\nwith.\n\nThis endpoint has been deprecated, and you should use the new workspaces endpoint.\nFor more information, see [this post](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [ { "name": "role", "in": "query", "description": "\nFilters the teams based on the authenticated user's role on each team.\n\n* **member**: returns a list of all the teams which the caller is a member of\n at least one team group or repository owned by the team\n* **contributor**: returns a list of teams which the caller has write access\n to at least one repository owned by the team\n* **admin**: returns a list teams which the caller has team administrator access\n", "required": false, "type": "string", "enum": [ "admin", "contributor", "member" ] } ], "tags": [ "teams" ], "deprecated": true }, "parameters": [] }, "/teams/{username}": { "get": { "responses": { "200": { "description": "The team object", "schema": { "$ref": "#/definitions/team" } }, "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.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Gets the public information associated with a team.\n\nIf the team's profile is private, `location`, `website` and\n`created_on` elements are omitted.", "parameters": [], "tags": [ "teams" ] }, "parameters": [ { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/teams/{username}/followers": { "get": { "responses": { "200": { "description": "A paginated list of user objects.", "schema": { "$ref": "#/definitions/paginated_users" } }, "404": { "description": "If no team exists for the specified name, or if the specified account is a personal account, not a team account.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the list of accounts that are following this team.", "parameters": [], "tags": [ "teams" ] }, "parameters": [ { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/teams/{username}/following": { "get": { "responses": { "200": { "description": "A paginated list of user objects.", "schema": { "$ref": "#/definitions/paginated_users" } }, "404": { "description": "If no team exists for the specified name, or if the specified account is a personal account, not a team account.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the list of accounts this team is following.\n\nThis endpoint has been deprecated, and you should use the new workspaces endpoint.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [], "tags": [ "teams" ], "deprecated": true }, "parameters": [ { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/teams/{username}/hooks": { "get": { "responses": { "200": { "description": "The paginated list of installed webhooks.", "schema": { "$ref": "#/definitions/paginated_webhook_subscriptions" } }, "403": { "description": "If the authenticated user is not an admin on the specified team.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the specified team does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of webhooks installed on this team.", "parameters": [], "tags": [ "teams", "webhooks" ] }, "post": { "responses": { "201": { "description": "The newly installed webhook.", "schema": { "$ref": "#/definitions/webhook_subscription" }, "headers": { "Location": { "type": "string", "description": "The URL of new newly created webhook." } } }, "403": { "description": "If the authenticated user is not an admin on the specified team.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the specified team does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new webhook on the specified team.\n\nTeam webhooks are fired for events from all repositories belonging to\nthat team account.\n\nNote that only admins can install webhooks on teams.", "parameters": [], "tags": [ "teams", "webhooks" ] }, "parameters": [ { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/teams/{username}/hooks/{uid}": { "delete": { "responses": { "204": { "description": "When the webhook was deleted successfully" }, "403": { "description": "If the authenticated user does not have permission to delete the webhook.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the webhook or team does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the specified webhook subscription from the given team\naccount.", "parameters": [], "tags": [ "teams", "webhooks" ] }, "get": { "responses": { "200": { "description": "The webhook subscription object.", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "404": { "description": "If the webhook or team does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the webhook with the specified id installed on the given\nteam account.", "parameters": [], "tags": [ "teams", "webhooks" ] }, "put": { "responses": { "200": { "description": "The webhook subscription object.", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "403": { "description": "If the authenticated user does not have permission to update the webhook.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the webhook or team does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates the specified webhook subscription.\n\nThe following properties can be mutated:\n\n* `description`\n* `url`\n* `active`\n* `events`", "parameters": [], "tags": [ "teams", "webhooks" ] }, "parameters": [ { "name": "uid", "in": "path", "description": "Installed webhook's ID", "required": true, "type": "string" }, { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/teams/{username}/members": { "get": { "responses": { "200": { "description": "All members", "examples": { "application/json": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "nickname": "example-username", "account_status": "active", "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" } }, "schema": { "$ref": "#/definitions/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.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all members of the specified team. Any member of any of the\nteam's groups is considered a member of the team. This includes users\nin groups that may not actually have access to any of the team's\nrepositories.\n\nThis operation has been deprecated due to privacy changes.\nSee the [announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/)\nfor details.\n\nUse this [workspaces](https://developer.atlassian.com/bitbucket/api/2/reference/resource/workspaces/%7Bworkspace%7D/members)\nendpoint as a replacement.", "parameters": [], "tags": [ "teams" ], "deprecated": true }, "parameters": [ { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/teams/{username}/permissions": { "get": { "responses": { "200": { "description": "Repositories owned by a team.", "schema": { "$ref": "#/definitions/paginated_team_permissions" } }, "403": { "description": "The requesting user isn't an admin of the team.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "team" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns an object for each team permission a user on the team has.\n\nThis endpoint has been deprecated, and you should use the new workspaces endpoint.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).\"\n\nPermissions returned are effective permissions — if a user is a member of\nmultiple groups with distinct roles, only the highest level is returned.\n\nPermissions can be:\n\n* `admin`\n* `collaborator`\n\nOnly users with admin permission for the team may access this resource.\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/teams/atlassian_tutorial/permissions\n\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"permission\": \"admin\",\n \"type\": \"team_permission\",\n \"user\": {\n \"type\": \"user\",\n \"nickname\": \"evzijst\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\"\n },\n \"team\": {\n \"display_name\": \"Atlassian Bitbucket\",\n \"uuid\": \"{4cc6108a-a241-4db0-96a5-64347ac04f87}\"\n }\n },\n {\n \"permission\": \"collaborator\",\n \"type\": \"team_permission\",\n \"user\": {\n \"type\": \"user\",\n \"nickname\": \"seanaty\",\n \"display_name\": \"Sean Conaty\",\n \"uuid\": \"{504c3b62-8120-4f0c-a7bc-87800b9d6f70}\"\n },\n \"team\": {\n \"display_name\": \"Atlassian Bitbucket\",\n \"uuid\": \"{4cc6108a-a241-4db0-96a5-64347ac04f87}\"\n }\n }\n ],\n \"page\": 1,\n \"size\": 2\n}\n```\n\nResults may be further [filtered or sorted](../../../meta/filtering) by\nteam, user, or permission by adding the following query string\nparameters:\n\n* `q=user.uuid=\"{d301aafa-d676-4ee0-88be-962be7417567}\"` or `q=permission=\"admin\"`\n* `sort=team.display_name`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../meta/filtering).", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nName of a response property sort the result by as per\n[filtering and sorting](../../../meta/filtering#query-sort).\n", "required": false, "type": "string" } ], "tags": [], "deprecated": true }, "parameters": [ { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/teams/{username}/permissions/repositories": { "get": { "responses": { "200": { "description": "List of team's repository permissions.", "schema": { "$ref": "#/definitions/paginated_repository_permissions" } }, "403": { "description": "The requesting user isn't an admin of the team.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "team" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns an object for each repository permission for all of a\nteam’s repositories.\n\nThis endpoint has been deprecated, and you should use the new workspaces endpoint.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).\"\n\nIf the username URL parameter refers to a user account instead of\na team account, an object containing the repository permissions\nof all the username's repositories will be returned.\n\nPermissions returned are effective permissions — the highest level of\npermission the user has. This does not include public repositories that\nusers are not granted any specific permission in, and does not\ndistinguish between direct and indirect privileges.\n\nOnly users with admin permission for the team may access this resource.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/teams/atlassian_tutorial/permissions/repositories\n\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"type\": \"repository_permission\",\n \"user\": {\n \"type\": \"user\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\"\n },\n \"repository\": {\n \"type\": \"repository\",\n \"name\": \"geordi\",\n \"full_name\": \"bitbucket/geordi\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"permission\": \"admin\"\n },\n {\n \"type\": \"repository_permission\",\n \"user\": {\n \"type\": \"user\",\n \"display_name\": \"Sean Conaty\",\n \"uuid\": \"{504c3b62-8120-4f0c-a7bc-87800b9d6f70}\"\n },\n \"repository\": {\n \"type\": \"repository\",\n \"name\": \"geordi\",\n \"full_name\": \"bitbucket/geordi\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"permission\": \"write\"\n }\n ],\n \"page\": 1,\n \"size\": 2\n}\n```\n\nResults may be further [filtered or sorted](../../../../meta/filtering)\nby repository, user, or permission by adding the following query string\nparameters:\n\n* `q=repository.name=\"geordi\"` or `q=permission>\"read\"`\n* `sort=user.display_name`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../../meta/filtering).", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nName of a response property sort the result by as per\n[filtering and sorting](../../../../meta/filtering#query-sort).\n", "required": false, "type": "string" } ], "tags": [], "deprecated": true }, "parameters": [ { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/teams/{username}/permissions/repositories/{repo_slug}": { "get": { "responses": { "200": { "description": "List of repository's repository permissions.", "schema": { "$ref": "#/definitions/paginated_repository_permissions" } }, "403": { "description": "The requesting user isn't an admin of the repository.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns an object for each repository permission of a given repository.\n\nThis endpoint has been deprecated, and you should use the new workspaces endpoint.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).\"\n\nIf the username URL parameter refers to a user account instead of\na team account, an object containing the repository permissions\nof the username's repository will be returned.\n\nPermissions returned are effective permissions — the highest level of\npermission the user has. This does not include public repositories that\nusers are not granted any specific permission in, and does not\ndistinguish between direct and indirect privileges.\n\nOnly users with admin permission for the repository may access this resource.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/teams/atlassian_tutorial/permissions/repositories/geordi\n\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"type\": \"repository_permission\",\n \"user\": {\n \"type\": \"user\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\"\n },\n \"repository\": {\n \"type\": \"repository\",\n \"name\": \"geordi\",\n \"full_name\": \"bitbucket/geordi\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"permission\": \"admin\"\n },\n {\n \"type\": \"repository_permission\",\n \"user\": {\n \"type\": \"user\",\n \"display_name\": \"Sean Conaty\",\n \"uuid\": \"{504c3b62-8120-4f0c-a7bc-87800b9d6f70}\"\n },\n \"repository\": {\n \"type\": \"repository\",\n \"name\": \"geordi\",\n \"full_name\": \"bitbucket/geordi\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"permission\": \"write\"\n }\n ],\n \"page\": 1,\n \"size\": 2\n}\n```\n\nResults may be further [filtered or sorted](../../../../meta/filtering)\nby user, or permission by adding the following query string parameters:\n\n* `q=permission>\"read\"`\n* `sort=user.display_name`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../../meta/filtering).", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nName of a response property sort the result by as per\n[filtering and sorting](../../../../meta/filtering#query-sort).\n", "required": false, "type": "string" } ], "tags": [], "deprecated": true }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/teams/{username}/pipelines_config/variables/": { "post": { "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of the newly created pipeline variable." } }, "description": "The created variable.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The account does not exist.", "schema": { "$ref": "#/definitions/error" } }, "409": { "description": "A variable with the provided key already exists.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Create an account level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "required": false, "in": "body", "description": "The variable to create.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_variable" } } ], "tags": [ "pipelines" ], "deprecated": true, "operationId": "createPipelineVariableForTeam" }, "get": { "responses": { "200": { "description": "The found account level variables.", "schema": { "$ref": "#/definitions/paginated_pipeline_variables" } } }, "description": "Find account level variables.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" } ], "tags": [ "pipelines" ], "deprecated": true, "operationId": "getPipelineVariablesForTeam" } }, "/teams/{username}/pipelines_config/variables/{variable_uuid}": { "put": { "responses": { "200": { "description": "The variable was updated.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The account or the variable was not found.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Update a team level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The UUID of the variable.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" }, { "required": true, "in": "body", "description": "The updated variable.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_variable" } } ], "tags": [ "pipelines" ], "deprecated": true, "operationId": "updatePipelineVariableForTeam" }, "get": { "responses": { "200": { "description": "The variable.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The account or variable with the given UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Retrieve a team level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The UUID of the variable to retrieve.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" } ], "tags": [ "pipelines" ], "deprecated": true, "operationId": "getPipelineVariableForTeam" }, "delete": { "responses": { "204": { "description": "The variable was deleted" }, "404": { "description": "The account or the variable with the provided UUID does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Delete a team level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [ { "description": "The account.", "required": true, "type": "string", "name": "username", "in": "path" }, { "description": "The UUID of the variable to delete.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" } ], "tags": [ "pipelines" ], "deprecated": true, "operationId": "deletePipelineVariableForTeam" } }, "/teams/{username}/projects/": { "get": { "responses": { "200": { "description": "A paginated list of projects that belong to the specified team.", "schema": { "$ref": "#/definitions/paginated_projects" } }, "403": { "description": "The requesting user isn't authorized to read the list of projects for the specified team.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "A team doesn't exist at this location.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "project" ] }, { "basic": [] }, { "api_key": [] } ], "description": "The teams endpoint for projects has been deprecated, and you should\nensure you are using the workspaces endpoint.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [], "tags": [ "projects" ] }, "post": { "responses": { "201": { "description": "A new project has been created.", "schema": { "$ref": "#/definitions/project" }, "headers": { "Location": { "type": "string", "description": "The location of the newly created project" } } }, "403": { "description": "The requesting user isn't authorized to create the project.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "A team doesn't exist at this location.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "project:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new project.\n\nThe teams endpoint for projects has been deprecated, and you should\nensure you are using the workspaces endpoint.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).\n\nNote that the avatar has to be embedded as either a data-url\nor a URL to an external image as shown in the examples below:\n\n```\n$ body=$(cat << EOF\n{\n \"name\": \"Mars Project\",\n \"key\": \"MARS\",\n \"description\": \"Software for colonizing mars.\",\n \"links\": {\n \"avatar\": {\n \"href\": \"data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/...\"\n }\n },\n \"is_private\": false\n}\nEOF\n)\n$ curl -H \"Content-Type: application/json\" \\\n -X POST \\\n -d \"$body\" \\\n https://api.bitbucket.org/2.0/teams/teams-in-space/projects/ | jq .\n{\n // Serialized project document\n}\n```\n\nor even:\n\n```\n$ body=$(cat << EOF\n{\n \"name\": \"Mars Project\",\n \"key\": \"MARS\",\n \"description\": \"Software for colonizing mars.\",\n \"links\": {\n \"avatar\": {\n \"href\": \"http://i.imgur.com/72tRx4w.gif\"\n }\n },\n \"is_private\": false\n}\nEOF\n)\n$ curl -H \"Content-Type: application/json\" \\\n -X POST \\\n -d \"$body\" \\\n https://api.bitbucket.org/2.0/teams/teams-in-space/projects/ | jq .\n{\n // Serialized project document\n}\n```", "parameters": [ { "name": "_body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/project" } } ], "tags": [ "projects" ] }, "parameters": [ { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/teams/{username}/projects/{project_key}": { "delete": { "responses": { "204": { "description": "Successful deletion." }, "403": { "description": "The requesting user isn't authorized to delete the project or the project isn't empty.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "A project isn't hosted at this location.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "project:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "The teams endpoint for projects has been deprecated, and you should\nensure you are using the workspaces endpoint.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [], "tags": [ "projects" ] }, "get": { "responses": { "200": { "description": "The project object.", "schema": { "$ref": "#/definitions/project" } }, "403": { "description": "The requesting user isn't authorized to access the project.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "A project isn't hosted at this location.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "project" ] }, { "basic": [] }, { "api_key": [] } ], "description": "The teams endpoint for projects has been deprecated, and you should\nensure you are using the workspaces endpoint.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [], "tags": [ "projects" ] }, "put": { "responses": { "200": { "description": "The existing project is has been updated.", "schema": { "$ref": "#/definitions/project" }, "headers": { "Location": { "type": "string", "description": "The location of the project. This header is only provided\nwhen the project key is updated." } } }, "201": { "description": "A new project has been created.", "schema": { "$ref": "#/definitions/project" }, "headers": { "Location": { "type": "string", "description": "The location of the newly created project" } } }, "403": { "description": "The requesting user isn't authorized to update or create the project.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "A team doesn't exist at the location. Note that the project's absence from this location doesn't raise a 404, since a PUT at a non-existent location can be used to create a new project.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "project:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Since this endpoint can be used to both update and to create a\nproject, the request body depends on the intent.\n\nThe teams endpoint for projects has been deprecated, and you should\nensure you are using the workspaces endpoint.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).\n\n### Creation\n\nSee the POST documentation for the project collection for an\nexample of the request body.\n\nNote: The `key` should not be specified in the body of request\n(since it is already present in the URL). The `name` is required,\neverything else is optional.\n\n### Update\n\nSee the POST documentation for the project collection for an\nexample of the request body.\n\nNote: The key is not required in the body (since it is already in\nthe URL). The key may be specified in the body, if the intent is\nto change the key itself. In such a scenario, the location of the\nproject is changed and is returned in the `Location` header of the\nresponse.", "parameters": [ { "name": "_body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/project" } } ], "tags": [ "projects" ] }, "parameters": [ { "name": "project_key", "in": "path", "description": "The project in question. This can either be the actual `key` assigned\nto the project or the `UUID` (surrounded by curly-braces (`{}`)).\n", "required": true, "type": "string" }, { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/teams/{username}/search/code": { "get": { "responses": { "200": { "description": "Successful search", "schema": { "$ref": "#/definitions/search_result_page" } }, "400": { "description": "If the search request was invalid due to one of the\nfollowing reasons:\n\n* the specified type of target account doesn''t match the actual\naccount type;\n\n* malformed pagination properties;\n\n* missing or malformed search query, in the latter case an error\nkey will be returned in `error.data.key` property.\n", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "Search is not enabled for the requested team, navigate to [https://bitbucket.org/search](https://bitbucket.org/search) to turn it on", "schema": { "$ref": "#/definitions/error" } }, "429": { "description": "Too many requests, try again later", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The account to search in; either the username or the UUID in curly braces", "in": "path", "name": "username" }, { "required": true, "type": "string", "description": "The search query", "in": "query", "name": "search_query" }, { "description": "Which page of the search results to retrieve", "format": "int32", "default": 1, "required": false, "in": "query", "type": "integer", "name": "page" }, { "description": "How many search results to retrieve per page", "format": "int32", "default": 10, "required": false, "in": "query", "type": "integer", "name": "pagelen" } ], "tags": [ "search" ], "produces": [ "application/json" ], "summary": "Search for code in the repositories of the specified team.\n\nSearching across all repositories:\n\n```\ncurl 'https://api.bitbucket.org/2.0/teams/team_name/search/code?search_query=foo'\n{\n \"size\": 1,\n \"page\": 1,\n \"pagelen\": 10,\n \"query_substituted\": false,\n \"values\": [\n {\n \"type\": \"code_search_result\",\n \"content_match_count\": 2,\n \"content_matches\": [\n {\n \"lines\": [\n {\n \"line\": 2,\n \"segments\": []\n },\n {\n \"line\": 3,\n \"segments\": [\n {\n \"text\": \"def \"\n },\n {\n \"text\": \"foo\",\n \"match\": true\n },\n {\n \"text\": \"():\"\n }\n ]\n },\n {\n \"line\": 4,\n \"segments\": [\n {\n \"text\": \" print(\\\"snek\\\")\"\n }\n ]\n },\n {\n \"line\": 5,\n \"segments\": []\n }\n ]\n }\n ],\n \"path_matches\": [\n {\n \"text\": \"src/\"\n },\n {\n \"text\": \"foo\",\n \"match\": true\n },\n {\n \"text\": \".py\"\n }\n ],\n \"file\": {\n \"path\": \"src/foo.py\",\n \"type\": \"commit_file\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo/src/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b/src/foo.py\"\n }\n }\n }\n }\n ]\n}\n```\n\nNote that searches can match in the file's text (`content_matches`),\nthe path (`path_matches`), or both as in the example above.\n\nYou can use the same syntax for the search query as in the UI, e.g.\nto only search within a specific repository:\n\n```\ncurl 'https://api.bitbucket.org/2.0/teams/team_name/search/code?search_query=foo+repo:demo'\n# results from the \"demo\" repository\n```\n\nSimilar to other APIs, you can request more fields using a\n`fields` query parameter. E.g. to get some more information about\nthe repository of matched files (the `%2B` is a URL-encoded `+`):\n\n```\ncurl 'https://api.bitbucket.org/2.0/teams/team_name/search/code'\\\n '?search_query=foo&fields=%2Bvalues.file.commit.repository'\n{\n \"size\": 1,\n \"page\": 1,\n \"pagelen\": 10,\n \"query_substituted\": false,\n \"values\": [\n {\n \"type\": \"code_search_result\",\n \"content_match_count\": 1,\n \"content_matches\": [...],\n \"path_matches\": [...],\n \"file\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo/commit/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/my-workspace/demo/commits/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b\"\n }\n },\n \"repository\": {\n \"name\": \"demo\",\n \"type\": \"repository\",\n \"full_name\": \"my-workspace/demo\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/my-workspace/demo\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B850e1749-781a-4115-9316-df39d0600e7a%7D?ts=default\"\n }\n },\n \"uuid\": \"{850e1749-781a-4115-9316-df39d0600e7a}\"\n }\n },\n \"type\": \"commit_file\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo/src/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b/src/foo.py\"\n }\n },\n \"path\": \"src/foo.py\"\n }\n }\n ]\n}\n```\n\nTry `fields=%2Bvalues.*.*.*.*` to get an idea what's possible.\n", "operationId": "searchAccount" } }, "/teams/{workspace}/repositories": { "get": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "All repositories in the given workspace. This includes any private\nrepositories the calling user has access to.\n\nThe teams and users endpoints have been deprecated. Use the [/repositories/{workspace}](https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D)\n endpoint in place of both of these endpoints.\nFor more information, see the [deprecation announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [], "tags": [ "users", "teams" ] }, "parameters": [ { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/user": { "get": { "responses": { "200": { "description": "The current user.", "examples": { "application/json": { "username": "example-username", "website": null, "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "repositories": { "href": "https://api.bitbucket.org/2.0/repositories/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "followers": { "href": "https://api.bitbucket.org/2.0/users/example-username/followers" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" }, "following": { "href": "https://api.bitbucket.org/2.0/users/example-username/following" }, "snippets": { "href": "https://api.bitbucket.org/2.0/snippets/example-username" } }, "type": "user", "created_on": "2018-06-20T23:17:33.616037+00:00", "is_staff": false, "location": null, "account_status": "active", "nickname": "example-username", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" } }, "schema": { "$ref": "#/definitions/user" } }, "401": { "description": "When the request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the currently logged in user.", "parameters": [], "tags": [ "users" ] }, "parameters": [] }, "/user/emails": { "get": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "email" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all the authenticated user's email addresses. Both\nconfirmed and unconfirmed.", "parameters": [], "tags": [ "users" ] }, "parameters": [] }, "/user/emails/{email}": { "get": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "email" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns details about a specific one of the authenticated user's\nemail addresses.\n\nDetails describe whether the address has been confirmed by the user and\nwhether it is the user's primary address or not.", "parameters": [], "tags": [ "users" ] }, "parameters": [ { "name": "email", "in": "path", "description": "Email address of the user.", "required": true, "type": "string" } ] }, "/user/permissions/repositories": { "get": { "responses": { "200": { "description": "Repository permissions for the repositories a caller has explicit access to.", "schema": { "$ref": "#/definitions/paginated_repository_permissions" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns an object for each repository the caller has explicit access\nto and their effective permission — the highest level of permission the\ncaller has. This does not return public repositories that the user was\nnot granted any specific permission in, and does not distinguish between\ndirect and indirect privileges.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/user/permissions/repositories\n\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"type\": \"repository_permission\",\n \"user\": {\n \"type\": \"user\",\n \"nickname\": \"evzijst\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\"\n },\n \"repository\": {\n \"type\": \"repository\",\n \"name\": \"geordi\",\n \"full_name\": \"bitbucket/geordi\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"permission\": \"admin\"\n }\n ],\n \"page\": 1,\n \"size\": 1\n}\n```\n\nResults may be further [filtered or sorted](../../../meta/filtering) by\nrepository or permission by adding the following query string\nparameters:\n\n* `q=repository.name=\"geordi\"` or `q=permission>\"read\"`\n* `sort=repository.name`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../meta/filtering).", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nName of a response property sort the result by as per\n[filtering and sorting](../../../meta/filtering#query-sort).\n", "required": false, "type": "string" } ], "tags": [ "repositories" ] }, "parameters": [] }, "/user/permissions/teams": { "get": { "responses": { "200": { "description": "Team permissions for the teams a caller is a member of.", "schema": { "$ref": "#/definitions/paginated_team_permissions" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns an object for each team the caller is a member of, and their\neffective role — the highest level of privilege the caller has. If a\nuser is a member of multiple groups with distinct roles, only the\nhighest level is returned.\n\nPermissions can be:\n\n* `admin`\n* `collaborator`\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/user/permissions/teams\n\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"permission\": \"admin\",\n \"type\": \"team_permission\",\n \"user\": {\n \"type\": \"user\",\n \"nickname\": \"evzijst\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\"\n },\n \"team\": {\n \"display_name\": \"Atlassian Bitbucket\",\n \"uuid\": \"{4cc6108a-a241-4db0-96a5-64347ac04f87}\"\n }\n }\n ],\n \"page\": 1,\n \"size\": 1\n}\n```\n\nResults may be further [filtered or sorted](../../../meta/filtering) by\nteam or permission by adding the following query string parameters:\n\n* `q=team.uuid=\"{4cc6108a-a241-4db0-96a5-64347ac04f87}\"` or `q=permission=\"admin\"`\n* `sort=team.display_name`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../meta/filtering).", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nName of a response property sort the result by as per\n[filtering and sorting](../../../meta/filtering#query-sort).\n", "required": false, "type": "string" } ], "tags": [] }, "parameters": [] }, "/user/permissions/workspaces": { "get": { "responses": { "200": { "description": "All of the workspace memberships for the authenticated user.", "schema": { "$ref": "#/definitions/paginated_workspace_memberships" } }, "401": { "description": "The request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns an object for each workspace the caller is a member of, and\ntheir effective role - the highest level of privilege the caller has.\nIf a user is a member of multiple groups with distinct roles, only the\nhighest level is returned.\n\nPermissions can be:\n\n* `owner`\n* `collaborator`\n* `member`\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/user/permissions/workspaces\n\n{\n \"pagelen\": 10,\n \"page\": 1,\n \"size\": 1,\n \"values\": [\n {\n \"type\": \"workspace_membership\",\n \"permission\": \"owner\",\n \"last_accessed\": \"2019-03-07T12:35:02.900024+00:00\",\n \"added_on\": \"2018-10-11T17:42:02.961424+00:00\",\n \"user\": {\n \"type\": \"user\",\n \"uuid\": \"{470c176d-3574-44ea-bb41-89e8638bcca4}\",\n \"nickname\": \"evzijst\",\n \"display_name\": \"Erik van Zijst\",\n },\n \"workspace\": {\n \"type\": \"workspace\",\n \"uuid\": \"{a15fb181-db1f-48f7-b41f-e1eff06929d6}\",\n \"slug\": \"bbworkspace1\",\n \"name\": \"Atlassian Bitbucket\",\n }\n }\n ]\n}\n```\n\nResults may be further [filtered or sorted](../../../meta/filtering) by\nworkspace or permission by adding the following query string parameters:\n\n* `q=workspace.slug=\"bbworkspace1\"` or `q=permission=\"owner\"`\n* `sort=workspace.slug`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response. See\n[filtering and sorting](../../../meta/filtering) for details.", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nName of a response property to sort results. See\n[filtering and sorting](../../../meta/filtering#query-sort)\nfor details.\n", "required": false, "type": "string" } ], "tags": [ "workspaces" ] }, "parameters": [] }, "/users/{selected_user}": { "get": { "responses": { "200": { "description": "The user object", "examples": { "application/json": { "username": "example-username", "display_name": "Example Username", "account_id": "123456:daffbc08-1a80-4bd0-98bf-7997de0a3d10", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/example-username" }, "html": { "href": "https://bitbucket.org/example-username/" }, "avatar": { "href": "https://bitbucket.org/account/example-username/avatar/" } }, "type": "user", "uuid": "{58021780-82b6-4517-b153-0ae73ce3e4b4}" } }, "schema": { "$ref": "#/definitions/user" } }, "404": { "description": "If no user exists for the specified UUID, or if the specified account is a team account, not a personal account.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Gets the public information associated with a user account.\n\nIf the user's profile is private, `location`, `website` and\n`created_on` elements are omitted.\n\nNote that the user object returned by this operation is changing significantly, due to privacy changes.\nSee the [announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#changes-to-bitbucket-user-objects) for details.", "parameters": [], "tags": [ "users" ] }, "parameters": [ { "name": "selected_user", "in": "path", "description": "This can either be the UUID of the account, surrounded by curly-braces, for\nexample: `{account UUID}`, OR an Atlassian Account ID.\n", "required": true, "type": "string" } ] }, "/users/{selected_user}/hooks": { "get": { "responses": { "200": { "description": "The paginated list of installed webhooks.", "schema": { "$ref": "#/definitions/paginated_webhook_subscriptions" } }, "403": { "description": "If the authenticated user is accessing an account other than their own.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the specified account does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of webhooks installed on this user account.\n\nNote that the username path parameter has been deprecated due to\n[privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).\nUse the account's UUID or account_id instead.\n\nAlso note that the users endpoint has been deprecated, and the workspaces\nendpoint should be used instead.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [], "tags": [ "users", "webhooks" ], "deprecated": true }, "post": { "responses": { "201": { "description": "The newly installed webhook.", "schema": { "$ref": "#/definitions/webhook_subscription" }, "headers": { "Location": { "type": "string", "description": "The URL of new newly created webhook." } } }, "403": { "description": "If the authenticated user is accessing an account other than their own.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the specified account does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new webhook on the specified user account.\n\nAccount-level webhooks are fired for events from all repositories\nbelonging to that account.\n\nNote that one can only register webhooks on one's own account, not that\nof others.\n\nAlso, note that the username path parameter has been deprecated due to\n[privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).\nUse the account's UUID or account_id instead.\n\nThe users endpoints have been deprecated, and the workspaces\nendpoint should be used instead.\nFor more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [], "tags": [ "users", "webhooks" ] }, "parameters": [ { "name": "selected_user", "in": "path", "description": "This can either be the UUID of the account, surrounded by curly-braces, for\nexample: `{account UUID}`, OR an Atlassian Account ID.\n", "required": true, "type": "string" } ] }, "/users/{selected_user}/hooks/{uid}": { "delete": { "responses": { "204": { "description": "When the webhook was deleted successfully" }, "403": { "description": "If the authenticated user does not have permission to delete the webhook.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the webhook or user does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the specified webhook subscription from the given user\naccount.\n\nNote that the username path parameter has been deprecated due to\n[privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).\nUse the account's UUID or account_id instead.", "parameters": [], "tags": [ "users", "webhooks" ] }, "get": { "responses": { "200": { "description": "The webhook subscription object.", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "404": { "description": "If the webhook or user does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the webhook with the specified id installed on the given\nuser account.\n\nNote that the username path parameter has been deprecated due to\n[privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).\nUse the account's UUID or account_id instead.", "parameters": [], "tags": [ "users", "webhooks" ] }, "put": { "responses": { "200": { "description": "The webhook subscription object.", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "403": { "description": "If the authenticated user does not have permission to update the webhook.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the webhook or user does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates the specified webhook subscription.\n\nThe following properties can be mutated:\n\n* `description`\n* `url`\n* `active`\n* `events`\n\nNote that the username path parameter has been deprecated due to\n[privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).\nUse the account's UUID or account_id instead.", "parameters": [], "tags": [ "users", "webhooks" ] }, "parameters": [ { "name": "selected_user", "in": "path", "description": "This can either be the UUID of the account, surrounded by curly-braces, for\nexample: `{account UUID}`, OR an Atlassian Account ID.\n", "required": true, "type": "string" }, { "name": "uid", "in": "path", "description": "Installed webhook's ID", "required": true, "type": "string" } ] }, "/users/{selected_user}/pipelines_config/variables/": { "post": { "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of the newly created pipeline variable." } }, "description": "The created variable.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The account does not exist.", "schema": { "$ref": "#/definitions/error" } }, "409": { "description": "A variable with the provided key already exists.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Create a user level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [ { "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "required": true, "type": "string", "name": "selected_user", "in": "path" }, { "required": false, "in": "body", "description": "The variable to create.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_variable" } } ], "tags": [ "pipelines" ], "deprecated": true, "operationId": "createPipelineVariableForUser" }, "get": { "responses": { "200": { "description": "The found user level variables.", "schema": { "$ref": "#/definitions/paginated_pipeline_variables" } } }, "description": "Find user level variables.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [ { "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "required": true, "type": "string", "name": "selected_user", "in": "path" } ], "tags": [ "pipelines" ], "deprecated": true, "operationId": "getPipelineVariablesForUser" } }, "/users/{selected_user}/pipelines_config/variables/{variable_uuid}": { "put": { "responses": { "200": { "description": "The variable was updated.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The account or the variable was not found.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Update a user level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [ { "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "required": true, "type": "string", "name": "selected_user", "in": "path" }, { "description": "The UUID of the variable.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" }, { "required": true, "in": "body", "description": "The updated variable.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_variable" } } ], "tags": [ "pipelines" ], "deprecated": true, "operationId": "updatePipelineVariableForUser" }, "get": { "responses": { "200": { "description": "The variable.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The account or variable with the given UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Retrieve a user level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [ { "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "required": true, "type": "string", "name": "selected_user", "in": "path" }, { "description": "The UUID of the variable to retrieve.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" } ], "tags": [ "pipelines" ], "deprecated": true, "operationId": "getPipelineVariableForUser" }, "delete": { "responses": { "204": { "description": "The variable was deleted" }, "404": { "description": "The account or the variable with the provided UUID does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "description": "Delete an account level variable.\nThis endpoint has been deprecated, and you should use the new workspaces endpoint. For more information, see [the announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [ { "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "required": true, "type": "string", "name": "selected_user", "in": "path" }, { "description": "The UUID of the variable to delete.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" } ], "tags": [ "pipelines" ], "deprecated": true, "operationId": "deletePipelineVariableForUser" } }, "/users/{selected_user}/properties/{app_key}/{property_name}": { "put": { "responses": { "204": { "description": "An empty response." } }, "operationId": "updateUserHostedPropertyValue", "description": "Update an [application property](/cloud/bitbucket/application-properties/) value stored against a user.", "parameters": [ { "required": true, "type": "string", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "in": "path", "name": "selected_user" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] }, "delete": { "responses": { "204": { "description": "An empty response." } }, "operationId": "deleteUserHostedPropertyValue", "description": "Delete an [application property](/cloud/bitbucket/application-properties/) value stored against a user.", "parameters": [ { "required": true, "type": "string", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "in": "path", "name": "selected_user" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] }, "get": { "responses": { "200": { "description": "The value of the property." } }, "operationId": "retrieveUserHostedPropertyValue", "description": "Retrieve an [application property](/cloud/bitbucket/application-properties/) value stored against a user.", "parameters": [ { "required": true, "type": "string", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "in": "path", "name": "selected_user" }, { "required": true, "type": "string", "description": "The key of the Connect app.", "in": "path", "name": "app_key" }, { "required": true, "type": "string", "description": "The name of the property.", "in": "path", "name": "property_name" } ], "tags": [ "properties" ] } }, "/users/{selected_user}/search/code": { "get": { "responses": { "200": { "description": "Successful search", "schema": { "$ref": "#/definitions/search_result_page" } }, "400": { "description": "If the search request was invalid due to one of the\nfollowing reasons:\n\n* the specified type of target account doesn''t match the actual\naccount type;\n\n* malformed pagination properties;\n\n* missing or malformed search query, in the latter case an error\nkey will be returned in `error.data.key` property.\n", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "Search is not enabled for the requested user, navigate to [https://bitbucket.org/search](https://bitbucket.org/search) to turn it on", "schema": { "$ref": "#/definitions/error" } }, "429": { "description": "Too many requests, try again later", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "Either the UUID of the account surrounded by curly-braces, for example `{account UUID}`, OR an Atlassian Account ID.", "in": "path", "name": "selected_user" }, { "required": true, "type": "string", "description": "The search query", "in": "query", "name": "search_query" }, { "description": "Which page of the search results to retrieve", "format": "int32", "default": 1, "required": false, "in": "query", "type": "integer", "name": "page" }, { "description": "How many search results to retrieve per page", "format": "int32", "default": 10, "required": false, "in": "query", "type": "integer", "name": "pagelen" } ], "tags": [ "search" ], "produces": [ "application/json" ], "summary": "Search for code in the repositories of the specified user.\n\nSearching across all repositories:\n\n```\ncurl 'https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/search/code?search_query=foo'\n{\n \"size\": 1,\n \"page\": 1,\n \"pagelen\": 10,\n \"query_substituted\": false,\n \"values\": [\n {\n \"type\": \"code_search_result\",\n \"content_match_count\": 2,\n \"content_matches\": [\n {\n \"lines\": [\n {\n \"line\": 2,\n \"segments\": []\n },\n {\n \"line\": 3,\n \"segments\": [\n {\n \"text\": \"def \"\n },\n {\n \"text\": \"foo\",\n \"match\": true\n },\n {\n \"text\": \"():\"\n }\n ]\n },\n {\n \"line\": 4,\n \"segments\": [\n {\n \"text\": \" print(\\\"snek\\\")\"\n }\n ]\n },\n {\n \"line\": 5,\n \"segments\": []\n }\n ]\n }\n ],\n \"path_matches\": [\n {\n \"text\": \"src/\"\n },\n {\n \"text\": \"foo\",\n \"match\": true\n },\n {\n \"text\": \".py\"\n }\n ],\n \"file\": {\n \"path\": \"src/foo.py\",\n \"type\": \"commit_file\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo/src/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b/src/foo.py\"\n }\n }\n }\n }\n ]\n}\n```\n\nNote that searches can match in the file's text (`content_matches`),\nthe path (`path_matches`), or both as in the example above.\n\nYou can use the same syntax for the search query as in the UI, e.g.\nto only search within a specific repository:\n\n```\ncurl 'https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/search/code?search_query=foo+repo:demo'\n# results from the \"demo\" repository\n```\n\nSimilar to other APIs, you can request more fields using a\n`fields` query parameter. E.g. to get some more information about\nthe repository of matched files (the `%2B` is a URL-encoded `+`):\n\n```\ncurl 'https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/search/code'\\\n '?search_query=foo&fields=%2Bvalues.file.commit.repository'\n{\n \"size\": 1,\n \"page\": 1,\n \"pagelen\": 10,\n \"query_substituted\": false,\n \"values\": [\n {\n \"type\": \"code_search_result\",\n \"content_match_count\": 1,\n \"content_matches\": [...],\n \"path_matches\": [...],\n \"file\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo/commit/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/my-workspace/demo/commits/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b\"\n }\n },\n \"repository\": {\n \"name\": \"demo\",\n \"type\": \"repository\",\n \"full_name\": \"my-workspace/demo\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/my-workspace/demo\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B850e1749-781a-4115-9316-df39d0600e7a%7D?ts=default\"\n }\n },\n \"uuid\": \"{850e1749-781a-4115-9316-df39d0600e7a}\"\n }\n },\n \"type\": \"commit_file\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo/src/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b/src/foo.py\"\n }\n },\n \"path\": \"src/foo.py\"\n }\n }\n ]\n}\n```\n\nTry `fields=%2Bvalues.*.*.*.*` to get an idea what's possible.\n", "operationId": "searchAccount" } }, "/users/{selected_user}/ssh-keys": { "get": { "responses": { "200": { "description": "A list of the SSH keys associated with the account.", "schema": { "$ref": "#/definitions/paginated_ssh_user_keys" } }, "403": { "description": "If the specified user's keys are not accessible to the current user" }, "404": { "description": "If the specified user does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of the user's SSH public keys.\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys\n{\n \"page\": 1,\n \"pagelen\": 10,\n \"size\": 1,\n \"values\": [\n {\n \"comment\": \"user@myhost\",\n \"created_on\": \"2018-03-14T13:17:05.196003+00:00\",\n \"key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY\",\n \"label\": \"\",\n \"last_used\": \"2018-03-20T13:18:05.196003+00:00\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a\"\n }\n },\n \"owner\": {\n \"display_name\": \"Mark Adams\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/markadams-atl/avatar/32/\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/markadams-atl/\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}\"\n }\n },\n \"type\": \"user\",\n \"username\": \"markadams-atl\",\n \"nickname\": \"markadams-atl\",\n \"uuid\": \"{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}\"\n },\n \"type\": \"ssh_key\",\n \"uuid\": \"{b15b6026-9c02-4626-b4ad-b905f99f763a}\"\n }\n ]\n}\n```", "parameters": [], "tags": [ "ssh" ] }, "post": { "responses": { "201": { "description": "The newly created SSH key.", "schema": { "$ref": "#/definitions/ssh_account_key" } }, "400": { "description": "If the submitted key or related value is invalid", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the current user does not have permission to add a key for the specified user" }, "404": { "description": "If the specified user does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Adds a new SSH public key to the specified user account and returns the resulting key.\n\nExample:\n```\n$ curl -X POST -H \"Content-Type: application/json\" -d '{\"key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY user@myhost\"}' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys\n\n{\n \"comment\": \"user@myhost\",\n \"created_on\": \"2018-03-14T13:17:05.196003+00:00\",\n \"key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY\",\n \"label\": \"\",\n \"last_used\": \"2018-03-20T13:18:05.196003+00:00\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a\"\n }\n },\n \"owner\": {\n \"display_name\": \"Mark Adams\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/markadams-atl/avatar/32/\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/markadams-atl/\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}\"\n }\n },\n \"type\": \"user\",\n \"username\": \"markadams-atl\",\n \"nickname\": \"markadams-atl\",\n \"uuid\": \"{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}\"\n },\n \"type\": \"ssh_key\",\n \"uuid\": \"{b15b6026-9c02-4626-b4ad-b905f99f763a}\"\n}\n```", "parameters": [ { "name": "_body", "in": "body", "description": "The new SSH key object. Note that the username property has been deprecated due to [privacy changes](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#removal-of-usernames-from-user-referencing-apis).", "required": false, "schema": { "$ref": "#/definitions/ssh_account_key" } } ], "tags": [ "ssh" ] }, "parameters": [ { "name": "selected_user", "in": "path", "description": "This can either be the UUID of the account, surrounded by curly-braces, for\nexample: `{account UUID}`, OR an Atlassian Account ID.\n", "required": true, "type": "string" } ] }, "/users/{selected_user}/ssh-keys/{key_id}": { "delete": { "responses": { "204": { "description": "The key has been deleted" }, "400": { "description": "If the submitted key or related value is invalid", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the current user does not have permission to add a key for the specified user" }, "404": { "description": "If the specified user does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes a specific SSH public key from a user's account\n\nExample:\n```\n$ curl -X DELETE https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/{b15b6026-9c02-4626-b4ad-b905f99f763a}\n```", "parameters": [], "tags": [ "ssh" ] }, "get": { "responses": { "200": { "description": "The specific SSH key matching the user and UUID", "schema": { "$ref": "#/definitions/ssh_account_key" } }, "403": { "description": "If the specified user or key is not accessible to the current user" }, "404": { "description": "If the specified user or key does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a specific SSH public key belonging to a user.\n\nExample:\n```\n$ curl https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/{fbe4bbab-f6f7-4dde-956b-5c58323c54b3}\n\n{\n \"comment\": \"user@myhost\",\n \"created_on\": \"2018-03-14T13:17:05.196003+00:00\",\n \"key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY\",\n \"label\": \"\",\n \"last_used\": \"2018-03-20T13:18:05.196003+00:00\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a\"\n }\n },\n \"owner\": {\n \"display_name\": \"Mark Adams\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/markadams-atl/avatar/32/\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/markadams-atl/\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}\"\n }\n },\n \"type\": \"user\",\n \"username\": \"markadams-atl\",\n \"nickname\": \"markadams-atl\",\n \"uuid\": \"{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}\"\n },\n \"type\": \"ssh_key\",\n \"uuid\": \"{b15b6026-9c02-4626-b4ad-b905f99f763a}\"\n}\n```", "parameters": [], "tags": [ "ssh" ] }, "put": { "responses": { "200": { "description": "The newly updated SSH key.", "schema": { "$ref": "#/definitions/ssh_account_key" } }, "400": { "description": "If the submitted key or related value is invalid", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "If the current user does not have permission to add a key for the specified user" }, "404": { "description": "If the specified user does not exist", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates a specific SSH public key on a user's account\n\nNote: Only the 'comment' field can be updated using this API. To modify the key or comment values, you must delete and add the key again.\n\nExample:\n```\n$ curl -X PUT -H \"Content-Type: application/json\" -d '{\"label\": \"Work key\"}' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/{b15b6026-9c02-4626-b4ad-b905f99f763a}\n\n{\n \"comment\": \"\",\n \"created_on\": \"2018-03-14T13:17:05.196003+00:00\",\n \"key\": \"ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY\",\n \"label\": \"Work key\",\n \"last_used\": \"2018-03-20T13:18:05.196003+00:00\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/b15b6026-9c02-4626-b4ad-b905f99f763a\"\n }\n },\n \"owner\": {\n \"display_name\": \"Mark Adams\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/markadams-atl/avatar/32/\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/markadams-atl/\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}\"\n }\n },\n \"type\": \"user\",\n \"username\": \"markadams-atl\",\n \"nickname\": \"markadams-atl\",\n \"uuid\": \"{d7dd0e2d-3994-4a50-a9ee-d260b6cefdab}\"\n },\n \"type\": \"ssh_key\",\n \"uuid\": \"{b15b6026-9c02-4626-b4ad-b905f99f763a}\"\n}\n```", "parameters": [ { "name": "_body", "in": "body", "description": "The updated SSH key object", "required": false, "schema": { "$ref": "#/definitions/ssh_account_key" } } ], "tags": [ "ssh" ] }, "parameters": [ { "name": "key_id", "in": "path", "description": "The SSH key's UUID value.", "required": true, "type": "string" }, { "name": "selected_user", "in": "path", "description": "This can either be the UUID of the account, surrounded by curly-braces, for\nexample: `{account UUID}`, OR an Atlassian Account ID.\n", "required": true, "type": "string" } ] }, "/users/{username}/members": { "get": { "responses": { "200": { "description": "All members", "schema": { "$ref": "#/definitions/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.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "", "parameters": [], "tags": [ "users" ] }, "parameters": [ { "name": "username", "in": "path", "description": "This can either be the username or the UUID of the account,\nsurrounded by curly-braces, for example: `{account UUID}`. An account\nis either a team or user.\n", "required": true, "type": "string" } ] }, "/users/{workspace}/repositories": { "get": { "responses": { "default": { "description": "Unexpected error.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "All repositories in the given workspace. This includes any private\nrepositories the calling user has access to.\n\nThe teams and users endpoints have been deprecated. Use the [/repositories/{workspace}](https://developer.atlassian.com/bitbucket/api/2/reference/resource/repositories/%7Bworkspace%7D)\n endpoint in place of both of these endpoints.\nFor more information, see the [deprecation announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-teams-deprecation/).", "parameters": [], "tags": [ "users", "teams" ] }, "parameters": [ { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/workspaces": { "get": { "responses": { "200": { "description": "The list of workspaces accessible by the authenticated user.", "schema": { "$ref": "#/definitions/paginated_workspaces" } }, "401": { "description": "The request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a list of workspaces accessible by the authenticated user.\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/workspaces\n\n{\n \"pagelen\": 10,\n \"page\": 1,\n \"size\": 1,\n \"values\": [\n {\n \"uuid\": \"{a15fb181-db1f-48f7-b41f-e1eff06929d6}\",\n \"links\": {\n \"owners\": {\n \"href\": \"https://api.bitbucket.org/2.0/workspaces/bbworkspace1/members?q=permission%3D%22owner%22\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/workspaces/bbworkspace1\"\n },\n \"repositories\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/bbworkspace1\"\n },\n \"snippets\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/bbworkspace1\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/bbworkspace1/\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket.org/workspaces/bbworkspace1/avatar/?ts=1543465801\"\n },\n \"members\": {\n \"href\": \"https://api.bitbucket.org/2.0/workspaces/bbworkspace1/members\"\n },\n \"projects\": {\n \"href\": \"https://api.bitbucket.org/2.0/workspaces/bbworkspace1/projects\"\n }\n },\n \"created_on\": \"2018-11-14T19:15:05.058566+00:00\",\n \"type\": \"workspace\",\n \"slug\": \"bbworkspace1\",\n \"is_private\": true,\n \"name\": \"Atlassian Bitbucket\"\n }\n ]\n}\n```\n\nResults may be further [filtered or sorted](../meta/filtering) by\nworkspace or permission by adding the following query string parameters:\n\n* `q=slug=\"bbworkspace1\"` or `q=is_private=true`\n* `sort=created_on`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`.", "parameters": [ { "name": "role", "in": "query", "description": "\n Filters the workspaces based on the authenticated user's role on each workspace.\n\n * **member**: returns a list of all the workspaces which the caller is a member of\n at least one workspace group or repository\n * **collaborator**: returns a list of workspaces which the caller has write access\n to at least one repository in the workspace\n * **owner**: returns a list of workspaces which the caller has administrator access\n ", "required": false, "type": "string", "enum": [ "owner", "collaborator", "member" ] }, { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response. See\n[filtering and sorting](../meta/filtering) for details.", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nName of a response property to sort results. See\n[filtering and sorting](../meta/filtering#query-sort)\nfor details.\n", "required": false, "type": "string" } ], "tags": [ "workspaces" ] }, "parameters": [] }, "/workspaces/{workspace}": { "get": { "responses": { "200": { "description": "The workspace.", "schema": { "$ref": "#/definitions/workspace" } }, "404": { "description": "If no workspace exists for the specified name or UUID.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the requested workspace.", "parameters": [], "tags": [ "workspaces" ] }, "parameters": [ { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/workspaces/{workspace}/hooks": { "get": { "responses": { "200": { "description": "The paginated list of installed webhooks.", "schema": { "$ref": "#/definitions/paginated_webhook_subscriptions" } }, "403": { "description": "If the authenticated user is not an owner on the specified workspace.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the specified workspace does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns a paginated list of webhooks installed on this workspace.", "parameters": [], "tags": [ "workspaces", "webhooks" ] }, "post": { "responses": { "201": { "description": "The newly installed webhook.", "schema": { "$ref": "#/definitions/webhook_subscription" }, "headers": { "Location": { "type": "string", "description": "The URL of new newly created webhook." } } }, "403": { "description": "If the authenticated user is not an owner on the specified workspace.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the specified workspace does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new webhook on the specified workspace.\n\nWorkspace webhooks are fired for events from all repositories contained\nby that workspace.\n\nNote that only owners can install webhooks on workspaces.", "parameters": [], "tags": [ "workspaces", "webhooks" ] }, "parameters": [ { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/workspaces/{workspace}/hooks/{uid}": { "delete": { "responses": { "204": { "description": "When the webhook was deleted successfully" }, "403": { "description": "If the authenticated user does not have permission to delete the webhook.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the webhook or workspace does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes the specified webhook subscription from the given workspace.", "parameters": [], "tags": [ "workspaces", "webhooks" ] }, "get": { "responses": { "200": { "description": "The webhook subscription object.", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "404": { "description": "If the webhook or workspace does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the webhook with the specified id installed on the given\nworkspace.", "parameters": [], "tags": [ "workspaces", "webhooks" ] }, "put": { "responses": { "200": { "description": "The webhook subscription object.", "schema": { "$ref": "#/definitions/webhook_subscription" } }, "403": { "description": "If the authenticated user does not have permission to update the webhook.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "If the webhook or workspace does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "webhook" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Updates the specified webhook subscription.\n\nThe following properties can be mutated:\n\n* `description`\n* `url`\n* `active`\n* `events`", "parameters": [], "tags": [ "workspaces", "webhooks" ] }, "parameters": [ { "name": "uid", "in": "path", "description": "Installed webhook's ID", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/workspaces/{workspace}/members": { "get": { "responses": { "200": { "description": "The list of users that are part of a workspace.", "schema": { "$ref": "#/definitions/paginated_workspace_memberships" } }, "401": { "description": "The request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns all members of the requested workspace.", "parameters": [], "tags": [ "workspaces" ] }, "parameters": [ { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/workspaces/{workspace}/members/{member}": { "get": { "responses": { "200": { "description": "The user that is part of a workspace.", "schema": { "$ref": "#/definitions/workspace_membership" } }, "401": { "description": "The request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "A workspace cannot be found, or a user cannot be found, or the user is not a a member of the workspace.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the workspace membership, which includes\na `User` object for the member and a `Workspace` object\nfor the requested workspace.", "parameters": [], "tags": [ "workspaces" ] }, "parameters": [ { "name": "member", "in": "path", "description": "Member's UUID or Atlassian ID.", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/workspaces/{workspace}/permissions": { "get": { "responses": { "200": { "description": "The list of users that are part of a workspace, along with their permission.", "schema": { "$ref": "#/definitions/paginated_workspace_memberships" } }, "401": { "description": "The request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the list of members in a workspace\nand their permission levels.\nPermission can be:\n* `owner`\n* `collaborator`\n* `member`\n\nExample:\n\n```\n$ curl -X https://api.bitbucket.org/2.0/workspaces/bbworkspace1/permissions\n\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"permission\": \"owner\",\n \"type\": \"workspace_membership\",\n \"user\": {\n \"type\": \"user\",\n \"uuid\": \"{470c176d-3574-44ea-bb41-89e8638bcca4}\",\n \"display_name\": \"Erik van Zijst\",\n },\n \"workspace\": {\n \"type\": \"workspace\",\n \"uuid\": \"{a15fb181-db1f-48f7-b41f-e1eff06929d6}\",\n \"slug\": \"bbworkspace1\",\n \"name\": \"Atlassian Bitbucket\",\n }\n },\n {\n \"permission\": \"member\",\n \"type\": \"workspace_membership\",\n \"user\": {\n \"type\": \"user\",\n \"nickname\": \"seanaty\",\n \"display_name\": \"Sean Conaty\",\n \"uuid\": \"{504c3b62-8120-4f0c-a7bc-87800b9d6f70}\"\n },\n \"workspace\": {\n \"type\": \"workspace\",\n \"uuid\": \"{a15fb181-db1f-48f7-b41f-e1eff06929d6}\",\n \"slug\": \"bbworkspace1\",\n \"name\": \"Atlassian Bitbucket\",\n }\n }\n ],\n \"page\": 1,\n \"size\": 2\n}\n```\n\nResults may be further [filtered](../../../meta/filtering) by\npermission by adding the following query string parameters:\n\n* `q=permission=\"owner\"`", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../meta/filtering).", "required": false, "type": "string" } ], "tags": [ "workspaces" ] }, "parameters": [ { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/workspaces/{workspace}/permissions/repositories": { "get": { "responses": { "200": { "description": "List of workspace's repository permissions.", "schema": { "$ref": "#/definitions/paginated_repository_permissions" } }, "403": { "description": "The requesting user isn't an admin of the workspace.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "account" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns an object for each repository permission for all of a\nworkspace's repositories.\n\nPermissions returned are effective permissions: the highest level of\npermission the user has. This does not distinguish between direct and\nindirect (group) privileges.\n\nOnly users with admin permission for the team may access this resource.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/workspaces/atlassian_tutorial/permissions/repositories\n\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"type\": \"repository_permission\",\n \"user\": {\n \"type\": \"user\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\"\n },\n \"repository\": {\n \"type\": \"repository\",\n \"name\": \"geordi\",\n \"full_name\": \"atlassian_tutorial/geordi\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"permission\": \"admin\"\n },\n {\n \"type\": \"repository_permission\",\n \"user\": {\n \"type\": \"user\",\n \"display_name\": \"Sean Conaty\",\n \"uuid\": \"{504c3b62-8120-4f0c-a7bc-87800b9d6f70}\"\n },\n \"repository\": {\n \"type\": \"repository\",\n \"name\": \"geordi\",\n \"full_name\": \"atlassian_tutorial/geordi\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"permission\": \"write\"\n },\n {\n \"type\": \"repository_permission\",\n \"user\": {\n \"type\": \"user\",\n \"display_name\": \"Jeff Zeng\",\n \"uuid\": \"{47f92a9a-c3a3-4d0b-bc4e-782a969c5c72}\"\n },\n \"repository\": {\n \"type\": \"repository\",\n \"name\": \"whee\",\n \"full_name\": \"atlassian_tutorial/whee\",\n \"uuid\": \"{30ba25e9-51ff-4555-8dd0-fc7ee2fa0895}\"\n },\n \"permission\": \"admin\"\n }\n ],\n \"page\": 1,\n \"size\": 3\n}\n```\n\nResults may be further [filtered or sorted](../../../../meta/filtering)\nby repository, user, or permission by adding the following query string\nparameters:\n\n* `q=repository.name=\"geordi\"` or `q=permission>\"read\"`\n* `sort=user.display_name`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../../meta/filtering).", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nName of a response property sort the result by as per\n[filtering and sorting](../../../../meta/filtering#query-sort).\n", "required": false, "type": "string" } ], "tags": [] }, "parameters": [ { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/workspaces/{workspace}/permissions/repositories/{repo_slug}": { "get": { "responses": { "200": { "description": "The respository permission for all users in this repository.", "schema": { "$ref": "#/definitions/paginated_repository_permissions" } }, "403": { "description": "The requesting user isn't an admin of the repository.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "repository" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns an object for the repository permission of each user in the\nrequested repository.\n\nPermissions returned are effective permissions: the highest level of\npermission the user has. This does not distinguish between direct and\nindirect (group) privileges.\n\nOnly users with admin permission for the repository may access this resource.\n\nPermissions can be:\n\n* `admin`\n* `write`\n* `read`\n\nExample:\n\n```\n$ curl https://api.bitbucket.org/2.0/workspaces/atlassian_tutorial/permissions/repositories/geordi\n\n{\n \"pagelen\": 10,\n \"values\": [\n {\n \"type\": \"repository_permission\",\n \"user\": {\n \"type\": \"user\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\"\n },\n \"repository\": {\n \"type\": \"repository\",\n \"name\": \"geordi\",\n \"full_name\": \"atlassian_tutorial/geordi\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"permission\": \"admin\"\n },\n {\n \"type\": \"repository_permission\",\n \"user\": {\n \"type\": \"user\",\n \"display_name\": \"Sean Conaty\",\n \"uuid\": \"{504c3b62-8120-4f0c-a7bc-87800b9d6f70}\"\n },\n \"repository\": {\n \"type\": \"repository\",\n \"name\": \"geordi\",\n \"full_name\": \"atlassian_tutorial/geordi\",\n \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\"\n },\n \"permission\": \"write\"\n }\n ],\n \"page\": 1,\n \"size\": 2\n}\n```\n\nResults may be further [filtered or sorted](../../../../meta/filtering)\nby user, or permission by adding the following query string parameters:\n\n* `q=permission>\"read\"`\n* `sort=user.display_name`\n\nNote that the query parameter values need to be URL escaped so that `=`\nwould become `%3D`.", "parameters": [ { "name": "q", "in": "query", "description": "\nQuery string to narrow down the response as per\n[filtering and sorting](../../../../meta/filtering).", "required": false, "type": "string" }, { "name": "sort", "in": "query", "description": "\nName of a response property sort the result by as per\n[filtering and sorting](../../../../meta/filtering#query-sort).\n", "required": false, "type": "string" } ], "tags": [] }, "parameters": [ { "name": "repo_slug", "in": "path", "description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/workspaces/{workspace}/pipelines-config/variables": { "post": { "description": "Create a workspace level variable.", "tags": [ "pipelines" ], "responses": { "201": { "headers": { "Location": { "type": "string", "description": "The URL of the newly created pipeline variable." } }, "description": "The created variable.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The workspace does not exist.", "schema": { "$ref": "#/definitions/error" } }, "409": { "description": "A variable with the provided key already exists.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "required": true, "type": "string", "name": "workspace", "in": "path" }, { "required": false, "in": "body", "description": "The variable to create.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_variable" } } ], "operationId": "createPipelineVariableForWorkspace" }, "get": { "description": "Find workspace level variables.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The found workspace level variables.", "schema": { "$ref": "#/definitions/paginated_pipeline_variables" } } }, "parameters": [ { "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "required": true, "type": "string", "name": "workspace", "in": "path" } ], "operationId": "getPipelineVariablesForWorkspace" } }, "/workspaces/{workspace}/pipelines-config/variables/{variable_uuid}": { "put": { "description": "Update a workspace level variable.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The variable was updated.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The workspace or the variable was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "required": true, "type": "string", "name": "workspace", "in": "path" }, { "description": "The UUID of the variable.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" }, { "required": true, "in": "body", "description": "The updated variable.", "name": "_body", "schema": { "$ref": "#/definitions/pipeline_variable" } } ], "operationId": "updatePipelineVariableForWorkspace" }, "get": { "description": "Retrieve a workspace level variable.", "tags": [ "pipelines" ], "responses": { "200": { "description": "The variable.", "schema": { "$ref": "#/definitions/pipeline_variable" } }, "404": { "description": "The workspace or variable with the given UUID was not found.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "required": true, "type": "string", "name": "workspace", "in": "path" }, { "description": "The UUID of the variable to retrieve.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" } ], "operationId": "getPipelineVariableForWorkspace" }, "delete": { "description": "Delete a workspace level variable.", "tags": [ "pipelines" ], "responses": { "204": { "description": "The variable was deleted" }, "404": { "description": "The workspace or the variable with the provided UUID does not exist.", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "description": "This can either be the workspace ID (slug) or the workspace UUID surrounded by curly-braces, for example `{workspace UUID}`.", "required": true, "type": "string", "name": "workspace", "in": "path" }, { "description": "The UUID of the variable to delete.", "required": true, "type": "string", "name": "variable_uuid", "in": "path" } ], "operationId": "deletePipelineVariableForWorkspace" } }, "/workspaces/{workspace}/projects": { "get": { "responses": { "200": { "description": "The list of projects in this workspace.", "schema": { "$ref": "#/definitions/paginated_projects" } }, "404": { "description": "A workspace doesn't exist at this location.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "project" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the list of projects in this workspace.", "parameters": [], "tags": [ "workspaces" ] }, "post": { "responses": { "201": { "description": "A new project has been created.", "schema": { "$ref": "#/definitions/project" }, "headers": { "Location": { "type": "string", "description": "The location of the newly created project" } } }, "403": { "description": "The requesting user isn't authorized to create the project.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "A workspace doesn't exist at this location.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "project:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Creates a new project.\n\nNote that the avatar has to be embedded as either a data-url\nor a URL to an external image as shown in the examples below:\n\n```\n$ body=$(cat << EOF\n{\n \"name\": \"Mars Project\",\n \"key\": \"MARS\",\n \"description\": \"Software for colonizing mars.\",\n \"links\": {\n \"avatar\": {\n \"href\": \"data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/...\"\n }\n },\n \"is_private\": false\n}\nEOF\n)\n$ curl -H \"Content-Type: application/json\" \\\n -X POST \\\n -d \"$body\" \\\n https://api.bitbucket.org/2.0/teams/teams-in-space/projects/ | jq .\n{\n // Serialized project document\n}\n```\n\nor even:\n\n```\n$ body=$(cat << EOF\n{\n \"name\": \"Mars Project\",\n \"key\": \"MARS\",\n \"description\": \"Software for colonizing mars.\",\n \"links\": {\n \"avatar\": {\n \"href\": \"http://i.imgur.com/72tRx4w.gif\"\n }\n },\n \"is_private\": false\n}\nEOF\n)\n$ curl -H \"Content-Type: application/json\" \\\n -X POST \\\n -d \"$body\" \\\n https://api.bitbucket.org/2.0/teams/teams-in-space/projects/ | jq .\n{\n // Serialized project document\n}\n```", "parameters": [ { "name": "_body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/project" } } ], "tags": [ "projects" ] }, "parameters": [ { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/workspaces/{workspace}/projects/{project_key}": { "delete": { "responses": { "204": { "description": "Successful deletion." }, "403": { "description": "The requesting user isn't authorized to delete the project or the project isn't empty.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "A project isn't hosted at this location.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "project:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Deletes this project. This is an irreversible operation.\n\nYou cannot delete a project that still contains repositories.\nTo delete the project, [delete](../../../repositories/%7Bworkspace%7D/%7Brepo_slug%7D#delete)\nor transfer the repositories first.\n\nExample:\n```\n$ curl -X DELETE https://api.bitbucket.org/2.0/bbworkspace1/PROJ\n```", "parameters": [], "tags": [ "projects" ] }, "get": { "responses": { "200": { "description": "The project that is part of a workspace.", "schema": { "$ref": "#/definitions/project" } }, "401": { "description": "The request wasn't authenticated.", "schema": { "$ref": "#/definitions/error" } }, "403": { "description": "The requesting user isn't authorized to access the project.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "A project isn't hosted at this location.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "project" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Returns the requested project.", "parameters": [], "tags": [ "projects", "workspaces" ] }, "put": { "responses": { "200": { "description": "The existing project is has been updated.", "schema": { "$ref": "#/definitions/project" }, "headers": { "Location": { "type": "string", "description": "The location of the project. This header is only provided\nwhen the project key is updated." } } }, "201": { "description": "A new project has been created.", "schema": { "$ref": "#/definitions/project" }, "headers": { "Location": { "type": "string", "description": "The location of the newly created project" } } }, "403": { "description": "The requesting user isn't authorized to update or create the project.", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "A workspace doesn't exist at the location. Note that the project's absence from this location doesn't raise a 404, since a PUT at a non-existent location can be used to create a new project.", "schema": { "$ref": "#/definitions/error" } } }, "security": [ { "oauth2": [ "project:write" ] }, { "basic": [] }, { "api_key": [] } ], "description": "Since this endpoint can be used to both update and to create a\nproject, the request body depends on the intent.\n\n### Creation\n\nSee the POST documentation for the project collection for an\nexample of the request body.\n\nNote: The `key` should not be specified in the body of request\n(since it is already present in the URL). The `name` is required,\neverything else is optional.\n\n### Update\n\nSee the POST documentation for the project collection for an\nexample of the request body.\n\nNote: The key is not required in the body (since it is already in\nthe URL). The key may be specified in the body, if the intent is\nto change the key itself. In such a scenario, the location of the\nproject is changed and is returned in the `Location` header of the\nresponse.", "parameters": [ { "name": "_body", "in": "body", "required": true, "schema": { "$ref": "#/definitions/project" } } ], "tags": [ "projects" ] }, "parameters": [ { "name": "project_key", "in": "path", "description": "The project in question. This is the actual `key` assigned\nto the project.\n", "required": true, "type": "string" }, { "name": "workspace", "in": "path", "description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n", "required": true, "type": "string" } ] }, "/workspaces/{workspace}/search/code": { "get": { "responses": { "200": { "description": "Successful search", "schema": { "$ref": "#/definitions/search_result_page" } }, "400": { "description": "If the search request was invalid due to one of the\nfollowing reasons:\n\n* the specified type of target account doesn''t match the actual\naccount type;\n\n* malformed pagination properties;\n\n* missing or malformed search query, in the latter case an error\nkey will be returned in `error.data.key` property.\n", "schema": { "$ref": "#/definitions/error" } }, "404": { "description": "Search is not enabled for the requested workspace, navigate to [https://bitbucket.org/search](https://bitbucket.org/search) to turn it on", "schema": { "$ref": "#/definitions/error" } }, "429": { "description": "Too many requests, try again later", "schema": { "$ref": "#/definitions/error" } } }, "parameters": [ { "required": true, "type": "string", "description": "The workspace to search in; either the slug or the UUID in curly braces", "in": "path", "name": "workspace" }, { "required": true, "type": "string", "description": "The search query", "in": "query", "name": "search_query" }, { "description": "Which page of the search results to retrieve", "format": "int32", "default": 1, "required": false, "in": "query", "type": "integer", "name": "page" }, { "description": "How many search results to retrieve per page", "format": "int32", "default": 10, "required": false, "in": "query", "type": "integer", "name": "pagelen" } ], "tags": [ "search" ], "produces": [ "application/json" ], "summary": "Search for code in the repositories of the specified workspace.\n\nSearching across all repositories:\n\n```\ncurl 'https://api.bitbucket.org/2.0/workspaces/workspace_slug_or_uuid/search/code?search_query=foo'\n{\n \"size\": 1,\n \"page\": 1,\n \"pagelen\": 10,\n \"query_substituted\": false,\n \"values\": [\n {\n \"type\": \"code_search_result\",\n \"content_match_count\": 2,\n \"content_matches\": [\n {\n \"lines\": [\n {\n \"line\": 2,\n \"segments\": []\n },\n {\n \"line\": 3,\n \"segments\": [\n {\n \"text\": \"def \"\n },\n {\n \"text\": \"foo\",\n \"match\": true\n },\n {\n \"text\": \"():\"\n }\n ]\n },\n {\n \"line\": 4,\n \"segments\": [\n {\n \"text\": \" print(\\\"snek\\\")\"\n }\n ]\n },\n {\n \"line\": 5,\n \"segments\": []\n }\n ]\n }\n ],\n \"path_matches\": [\n {\n \"text\": \"src/\"\n },\n {\n \"text\": \"foo\",\n \"match\": true\n },\n {\n \"text\": \".py\"\n }\n ],\n \"file\": {\n \"path\": \"src/foo.py\",\n \"type\": \"commit_file\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo/src/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b/src/foo.py\"\n }\n }\n }\n }\n ]\n}\n```\n\nNote that searches can match in the file's text (`content_matches`),\nthe path (`path_matches`), or both as in the example above.\n\nYou can use the same syntax for the search query as in the UI, e.g.\nto only search within a specific repository:\n\n```\ncurl 'https://api.bitbucket.org/2.0/workspaces/my-workspace/search/code?search_query=foo+repo:demo'\n# results from the \"demo\" repository\n```\n\nSimilar to other APIs, you can request more fields using a\n`fields` query parameter. E.g. to get some more information about\nthe repository of matched files (the `%2B` is a URL-encoded `+`):\n\n```\ncurl 'https://api.bitbucket.org/2.0/workspaces/my-workspace/search/code'\\\n '?search_query=foo&fields=%2Bvalues.file.commit.repository'\n{\n \"size\": 1,\n \"page\": 1,\n \"pagelen\": 10,\n \"query_substituted\": false,\n \"values\": [\n {\n \"type\": \"code_search_result\",\n \"content_match_count\": 1,\n \"content_matches\": [...],\n \"path_matches\": [...],\n \"file\": {\n \"commit\": {\n \"type\": \"commit\",\n \"hash\": \"ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo/commit/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/my-workspace/demo/commits/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b\"\n }\n },\n \"repository\": {\n \"name\": \"demo\",\n \"type\": \"repository\",\n \"full_name\": \"my-workspace/demo\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/my-workspace/demo\"\n },\n \"avatar\": {\n \"href\": \"https://bytebucket.org/ravatar/%7B850e1749-781a-4115-9316-df39d0600e7a%7D?ts=default\"\n }\n },\n \"uuid\": \"{850e1749-781a-4115-9316-df39d0600e7a}\"\n }\n },\n \"type\": \"commit_file\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/my-workspace/demo/src/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b/src/foo.py\"\n }\n },\n \"path\": \"src/foo.py\"\n }\n }\n ]\n}\n```\n\nTry `fields=%2Bvalues.*.*.*.*` to get an idea what's possible.\n", "operationId": "searchAccount" } } }, "x-atlassian-narrative": { "documents": [ { "body": "\nThe purpose of this section is to describe how to authenticate when making API calls using the Bitbucket REST API.\n\n-----\n\n* [Oauth 2](#oauth-2)\n * [Making requests](#making-requests)\n * [Repository cloning](#repository-cloning)\n * [Refresh tokens](#refresh-tokens)\n* [Scopes](#scopes)\n* [App passwords](#app-passwords)\n* [Basic auth](#basic-auth)\n\n---\n\n### OAuth 2.0\n\nOur OAuth 2 implementation is merged in with our existing OAuth 1 in\nsuch a way that existing OAuth 1 consumers automatically become\nvalid OAuth 2 clients. The only thing you need to do is edit your\nexisting consumer and configure a callback URL.\n\nOnce that is in place, you'll have the following 2 URLs:\n\n https://bitbucket.org/site/oauth2/authorize\n https://bitbucket.org/site/oauth2/access_token\n\nFor obtaining access/bearer tokens, we support all 4 of RFC-6749's grant\nflows, plus a custom Bitbucket flow for exchanging JWT tokens for access tokens:\n\n\n#### 1. Authorization Code Grant (4.1)\n\nThe full-blown 3-LO flow. Request authorization from the end user by\nsending their browser to:\n\n https://bitbucket.org/site/oauth2/authorize?client_id={client_id}&response_type=code\n\nThe callback includes the `?code={}` query parameter that you can swap\nfor an access token:\n\n $ curl -X POST -u \"client_id:secret\" \\\n https://bitbucket.org/site/oauth2/access_token \\\n -d grant_type=authorization_code -d code={code}\n\n\n#### 2. Implicit Grant (4.2)\n\nThis flow is useful for browser-based add-ons that operate without server-side backends.\n\nRequest the end user for authorization by directing the browser to:\n\n https://bitbucket.org/site/oauth2/authorize?client_id={client_id}&response_type=token\n\nThat will redirect to your preconfigured callback URL with a fragment\ncontaining the access token\n(`#access_token={token}&token_type=bearer`) where your page's js can\npull it out of the URL.\n\n\n#### 3. Resource Owner Password Credentials Grant (4.3)\n\nUseful if you have the end user's password but you want to use a more\nsecure end user access token instead. This method will not work when the user has two-step verification enabled.\n\n $ curl -X POST -u \"client_id:secret\" \\\n https://bitbucket.org/site/oauth2/access_token -d grant_type=password \\\n -d username={username} -d password={password}\n\n\n#### 4. Client Credentials Grant (4.4)\n\nSomewhat like our existing \"2-LO\" flow for OAuth 1. Obtain an access\ntoken that represents not an end user, but the owner of the\nclient/consumer:\n\n $ curl -X POST -u \"client_id:secret\" \\\n https://bitbucket.org/site/oauth2/access_token \\\n -d grant_type=client_credentials\n\n\n#### 5. Bitbucket Cloud JWT Grant (urn:bitbucket:oauth2:jwt)\n\nIf your Atlassian Connect add-on uses JWT authentication, you can swap a\nJWT for an OAuth access token. The resulting access token represents the\naccount for which the add-on is installed.\n\nMake sure you send the JWT token in the Authorization request header\nusing the \"JWT\" scheme (case sensitive). Note that this custom scheme\nmakes this different from HTTP Basic Auth (and so you cannot use \"curl\n-u\").\n\n $ curl -X POST -H \"Authorization: JWT {jwt_token}\" \\\n https://bitbucket.org/site/oauth2/access_token \\\n -d grant_type=urn:bitbucket:oauth2:jwt\n\n\n#### Making Requests\n\nOnce you have an access token, as per RFC-6750, you can use it in a request in any of\nthe following ways (in decreasing order of desirability):\n\n1. Send it in a request header: `Authorization: Bearer {access_token}`\n2. Include it in a (application/x-www-form-urlencoded) POST body as `access_token={access_token}`\n3. Put it in the query string of a non-POST: `?access_token={access_token}`\n\n\n#### Repository Cloning\n\nSince add-ons will not be able to upload their own SSH keys to clone\nwith, access tokens can be used as Basic HTTP Auth credentials to\nclone securely over HTTPS. This is much like GitHub, yet slightly\ndifferent:\n\n $ git clone https://x-token-auth:{access_token}@bitbucket.org/user/repo.git\n\nThe literal string `x-token-auth` as a substitute for username is\nrequired (note the difference with GitHub where the actual token is in\nthe username field).\n\n\n#### Refresh Tokens\n\nOur access tokens expire in one hour. When this happens you'll get 401\nresponses.\n\nMost access tokens grant responses (Implicit and JWT excluded). Therefore, you should include a\nrefresh token that can then be used to generate a new access token,\nwithout the need for end user participation:\n\n $ curl -X POST -u \"client_id:secret\" \\\n https://bitbucket.org/site/oauth2/access_token \\\n -d grant_type=refresh_token -d refresh_token={refresh_token}\n\n\n### Scopes\n\nBitbucket's API applies a number of privilege scopes to endpoints. In order to access an endpoint, a request will need to have the necessary scopes.\n\nScopes are declared in the descriptor as a list of strings, with each string being the name of a unique scope.\n\nA descriptor lacking the `scopes` element is implicitly assumed to require all scopes and as a result, Bitbucket will require end users authorizing/installing the add-on\nto explicitly accept all scopes.\n\nOur best practice suggests you add the scopes your add-on needs, but no more than it needs.\n\nInvalid scope strings will cause the descriptor to be rejected and the installation to fail.\n\nFollowing is the set of all currently available scopes.\n\n#### repository\n\nGives the add-on read access to all the repositories the authorizing user has access to.\nNote that this scope does not give access to a repository's pull requests.\n\n* access to the repo's source code\n* clone over https\n* access the the file browsing API\n* download zip archives of the repo's contents\n* the ability to view and use the issue tracker on any repo (created issues, comment, vote, etc)\n* the ability to view and use the wiki on any repo (create/edit pages)\n\n#### repository:write\n\nGives the add-on write (not admin) access to all the repositories the authorizing user has access to. No distinction is made between public or private repos. This scope implies `repository`, which does not need to be requested separately.\nThis scope alone does not give access to the pull requests API.\n\n* push access over https\n* fork repos\n\n#### repository:admin\n\nGives the add-on admin access to all the repositories the authorizing user has access to. No distinction is made between public or private repos. This scope does not imply `repository` or `repository:write`. It gives access to the admin features of a repo only, not direct access to its contents. Of course it can be (mis)used to grant read access to another user account who can then clone the repo, but repos that need to read of write source code would also request explicit read or write.\nThis scope comes with access to the following functionality:\n\n* view and manipulate committer mappings\n* list and edit deploy keys\n* ability to delete the repo\n* view and edit repo permissions\n* view and edit branch permissions\n* import and export the issue tracker\n* enable and disable the issue tracker\n* list and edit issue tracker version, milestones and components\n* enable and disable the wiki\n* list and edit default reviewers\n* list and edit repo links (Jira/Bamboo/Custom)\n* list and edit the repository web hooks\n* initiate a repo ownership transfer\n\n#### snippet\n\nGives the add-on read access to all the snippets the authorizing user has access to.\nNo distinction is made between public and private snippets (public snippets are accessible without any form of authentication).\n\n* view any snippet\n* create snippet comments\n\n#### snippet:write\n\nGives the add-on write access to all the snippets the authorizing user can edit.\nNo distinction is made between public and private snippets (public snippets are accessible without any form of authentication).\nThis implies the Snippet Read scope which does not need to be requested separately.\n\n* edit snippets\n* delete snippets\n\n#### issue\n\nAbility to interact with issue trackers the way non-repo members can.\nThis scope does not imply any other scopes and does not give implicit access to the repository the issue is attached to.\n\n* view, list and search issues\n* create new issues\n* comment on issues\n* watch issues\n* vote for issues\n\n#### issue:write\n\nThis implies `issue`, but adds the ability to transition and delete issues.\nThis scope does not imply any other scopes and does not give implicit access to the repository the issue is attached to.\n\n* transition issues\n* delete issues\n\n#### wiki\n\nGives access to wikis. No distinction is made between read and write as wikis are always editable by anyone.\nThis scope does not imply any other scopes and does not give implicit access to the repository the wiki is attached to.\n\n* view wikis\n* create pages\n* edit pages\n* push to wikis\n* clone wikis\n\n#### pullrequest\n\nGives the add-on read access to pull requests.\nThis scope implies `repository`, giving read access to the pull request's destination repository.\n\n* see and list pull requests\n* create and resolve tasks\n\n#### pullrequest:write\n\nImplies `pullrequest` but adds the ability to create, merge and decline pull requests.\nThis scope implies `repository:write`, giving write access to the pull request's destination repository. This is necessary to facilitate merging.\n\n* merge pull requests\n* decline pull requests\n* create pull requests\n* comment on pull requests\n* approve pull requests\n\n#### email\n\nAbility to see the user's primary email address. This should make it easier to use Bitbucket Cloud as a login provider to add-ons or external applications.\n\n#### account\n\nAbility to see all the user's account information. Note that this does not include any ability to mutate any of the data.\n\n* see all email addresses\n* language\n* location\n* website\n* full name\n* SSH keys\n* user groups\n\n#### account:write\n\nAbility to change properties on the user's account.\n\n* delete the authorizing user's account\n* manage the user's groups\n* manupilate a user's email addresses\n* change username, display name and avatar\n\n#### team\n\nThe ability to find out what teams the current user is part of. This is covered by the teams endpoint.\n\n* information about all the groups and teams I am a member or admin of\n\n\n#### team:write\n\nImplies `team`, but adds the ability to manage the teams that the authorizing user is an admin on.\n\n* manage team permissions\n\n#### webhook\n\nGives access to webhooks. This scope is required for any webhook\nrelated operation.\n\nThis scope gives read access to existing webhook subscriptions on all\nresources you can access, without needing further scopes. This means that\na client can list all existing webhook subscriptions on repository\n`foo/bar` (assuming the principal user has access to this repo). The\nadditional `repository` scope is not required for this.\n\nLikewise, existing webhook subscriptions for a repo's issue tracker can be\nretrieved without holding the `issue` scope. All that is required is the\n`webhook` scope.\n\nHowever, to create a webhook for `issue:created`, the client will need to\nhave both the `webhook` as well as `issue` scope.\n\n* list webhook subscriptions on any accessible repository, user, team, or snippet\n* create/update/delete webhook subscriptions\n\n\n### App passwords\n\nApp passwords allow two-step verification users to make API calls to their Bitbucket account through apps such as Sourcetree.\n\nSome important points about app passwords:\n\n* You cannot view an app password or adjust permissions after you create the app password. Because app passwords are encrypted on our database and cannot be viewed by anyone. They are essentially designed to be disposable. If you need to change the scopes or lost the password just create a new one.\n* You cannot use them to log into your Bitbucket account.\n* You cannot use app passwords to manage team actions.\n\n App passwords are tied to an individual account's credentials and should not be shared. If you're sharing your app password you're essentially giving direct, authenticated, access to everything that password has been scoped to do with the Bitbucket API's.\n\n* You can use them for API call authentication, even if you don't have two-step verification enabled.\n* You can set permission scopes (specific access rights) for each app password.\n\n#### Create an app password\n\nTo create an app password:\n\n1. Select **Avatar > Bitbucket settings**.\n2. [Click **App passwords** in the Access management section.](https://bitbucket.org/account/admin/app-passwords)\n3. Click **Create app password**.\n4. Give the app password a name related to the application that will use the password.\n5. Select the specific access and permissions you want this application password to have.\n6. Copy the generated password and either record or paste it into the application you want to give access. The password is only displayed this one time.\n\nThat's all there is to creating an app password. See your applications documentation for how to apply the app password for a specific application.\n\n### Basic auth\n\nBasic HTTP Authentication as per [RFC-2617](https://tools.ietf.org/html/rfc2617) (Digest not supported). Note that Basic Auth with username and password as credentials is only available on accounts that have 2-factor-auth / 2-step-verification disabled. If you use 2fa, you should authenticate using OAuth2 instead.\n", "title": "Authentication methods", "anchor": "authentication", "description": "How to authenticate API actions", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAxOTcuNjQ3MyAxODYuODEzOCI+CiAgPGRlZnM+CiAgICA8c3R5bGU+CiAgICAgIC5jbHMtMSB7CiAgICAgICAgaXNvbGF0aW9uOiBpc29sYXRlOwogICAgICB9CgogICAgICAuY2xzLTIgewogICAgICAgIGZpbGw6ICNkZTM1MGI7CiAgICAgIH0KCiAgICAgIC5jbHMtMyB7CiAgICAgICAgZmlsbDogI2ZmNTYzMDsKICAgICAgfQoKICAgICAgLmNscy00IHsKICAgICAgICBmaWxsOiAjZGZlMWU1OwogICAgICAgIG1peC1ibGVuZC1tb2RlOiBtdWx0aXBseTsKICAgICAgfQoKICAgICAgLmNscy01IHsKICAgICAgICBmaWxsOiAjZmFmYmZjOwogICAgICB9CgogICAgICAuY2xzLTYgewogICAgICAgIGZpbGw6ICNlYmVjZjA7CiAgICAgIH0KCiAgICAgIC5jbHMtNyB7CiAgICAgICAgZmlsbDogbm9uZTsKICAgICAgICBzdHJva2U6ICMwMDY1ZmY7CiAgICAgICAgc3Ryb2tlLW1pdGVybGltaXQ6IDEwOwogICAgICAgIHN0cm9rZS13aWR0aDogMnB4OwogICAgICB9CgogICAgICAuY2xzLTggewogICAgICAgIGZpbGw6ICM1ZTZjODQ7CiAgICAgIH0KCiAgICAgIC5jbHMtOSB7CiAgICAgICAgZmlsbDogIzI1Mzg1ODsKICAgICAgf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NDM5LDMuOTQzOSwwLDAsMC0zLjk0NDMtMy45NDQzSDQxLjA0MTdhMy45NDQzLDMuOTQ0MywwLDAsMCwwLDcuODg4N0g3Ny44NTMyQTMuOTQzOSwzLjk0MzksMCwwLDAsODEuNzk3NSwxMDAuMzFaIi8+CiAgICAgICAgPHBhdGggY2xhc3M9ImNscy0xMCIgZD0iTTIyLjQ5MzIsMTIyLjgwMjlBMjIuNDkyOSwyMi40OTI5LDAsMSwxLDQ0Ljk4NTgsMTAwLjMxLDIyLjUxODUsMjIuNTE4NSwwLDAsMSwyMi40OTMyLDEyMi44MDI5Wm0wLTM3LjA5NzJBMTQuNjA0MiwxNC42MDQyLDAsMSwwLDM3LjA5NzIsMTAwLjMxLDE0LjYyMDcsMTQuNjIwNywwLDAsMCwyMi40OTMyLDg1LjcwNTdaIi8+CiAgICAgIDwvZz4KICAgIDwvZz4KICA8L2c+Cjwvc3ZnPgo=" }, { "body": "\nYou can query the 2.0 API for specific objects using a simple language which resembles SQL.\n\nNote that filtering and querying by username has been deprecated, due to privacy changes. \nSee the [announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#changes-to-querying) \nfor details.\n\n---\n\n* [Supported endpoints](#supported-endpoints)\n* [Operators](#operators)\n* [Data types](#data-types)\n* [Querying](#querying)\n* [Sorting query results](#sorting-query-results)\n\n----\n\n### Supported endpoints\n\nMost 2.0 API resources that return paginated collections of objects support a single, shared, generic querying language that is used to filter down a result set.\n\nThis includes, but is in no way limited to:\n\n /2.0/repositories/{username}\n /2.0/repositories/{username}/{slug}/refs\n /2.0/repositories/{username}/{slug}/refs/branches\n /2.0/repositories/{username}/{slug}/refs/tags\n /2.0/repositories/{username}/{slug}/forks\n /2.0/repositories/{username}/{slug}/src\n /2.0/repositories/{username}/{slug}/issues\n /2.0/repositories/{username}/{slug}/pullrequests\n\nFiltering and sorting supports several distinct operators and data types as well as basic features, like logical operators (AND, OR).\nAs examples, the following queries could be used on the issue tracker endpoint (`/2.0/repositories/{workspace}/{slug}/issues/`):\n\n\t(state = \"open\" OR state = \"new\") AND assignee = null\n\treporter.nickname != \"evzijst\" AND priority >= \"major\"\n\t(title ~ \"unicode\" OR content.raw ~ \"unicode\") AND created_on > 2015-10-04T14:00:00-07:00\n\nFilter queries can be added to the URL using the q= query parameter. To sort the response, add sort=. Note that the entire query string is put in the q parameter and hence needs to be URL-encoded as shown in the following example:\n\n\t/2.0/repositories/foo/bar/issues?q=state=\"new\"&sort=-updated_on\n\n\n### Operators\n\nFiltering and sorting supports the following operators:\n\n| Operator | Definition | Example |\n|----------|--------------------------------|----------------------------|\n| \"=\" | test for equality | `nickname = \"evzijst\"` |\n| \"!=\" | not equal | `is_private != true` |\n| \"~\" | case-insensitive text contains | `description ~ \"beef\"` |\n| \"!~\" | case-insensitive not contains | `description !~ \"fubar\"` |\n| \">\" | greater than | `priority > \"major\"` |\n| \">=\" | greater than or equal | `priority <= \"trivial\"` |\n| \"<\" | less than | `id < 1234` |\n| \"<=\" | less than or equal | `updated_on <= 2015-03-04` |\n\n### Data types\n\nFiltering and sorting supports the following data types:\n\n| Type | Description | Example |\n|--------------|-----------------------------------------|---------------|\n| **String** | any text inside double quotes | `\"foo\"` |\n| **Number** | arbitrary precision integers and floats | `1, -10.302` |\n| **Null** | to test for the absence of a value | `null` |\n| **boolean** | the unquoted strings true or false | `true, false` |\n| **datetime** | an unquoted [ISO-8601][iso-8601] date time string with the timezone offset, milliseconds and entire time component being optional | `2015-03-04T14:08:59.123+02:00`, `2015-03-04T14:08:59` Date time strings are assumed to be in UTC, unless an explicit timezone offset is provided |\n\n[https://en.wikipedia.org/wiki/ISO_8601]: /iso-8601\n\n### Querying\n\nObjects can be filtered based on their properties. In principle, every element in an object's JSON document schema can be used as a filter criterion.\n\nNote that while the array of objects in a paginated response is wrapped in an\nenvelope with a `values` element, this prefix should not be included in the\nquery fields (so use `/2.0/repositories/foo/bar/issues?q=state=\"new\"`, not\n`/2.0/repositories/foo/bar/issues?q=values.state=\"new\"`).\n\n\n### Examples\n\nFields that contain embedded instances of other object types (e.g. owner is an embedded user object, while parent is an embedded repository) can be traversed recursively. For instance:\n\n\tparent.owner.nickname = \"bitbucket\"\n\nTo find pull requests which merge into master, come from a fork of the repo rather than a branch inside the repo, and on which I am a reviewer:\n\n```\nsource.repository.full_name != \"main/repo\" AND state = \"OPEN\" AND reviewers.nickname = \"evzijst\" AND destination.branch.name = \"master\"\n```\n```\n/2.0/repositories/main/repo/pullrequests?q=source.repository.full_name+%21%3D+%22main%2Frepo%22+AND+state+%3D+%22OPEN%22+AND+reviewers.nickname+%3D+%22evzijst%22+AND+destination.branch.name+%3D+%22master%22\n```\n\nTo find new or on-hold issues related to the UI, created or updated in the last day (SF local time), that have not yet been assigned to anyone:\n\n```\n(state = \"new\" OR state = \"on hold\") AND assignee = null AND component = \"UI\" and updated_on > 2015-11-11T00:00:00-07:00\n```\n```\n/2.0/repositories/main/repo/issues?q=%28state+%3D+%22new%22+OR+state+%3D+%22on+hold%22%29+AND+assignee+%3D+null+AND+component+%3D+%22UI%22+and+updated_on+%3E+2015-11-11T00%3A00%3A00-07%3A00\n```\n\nTo find all tags with the string \"2015\" in the name:\n\n```\nname ~ \"2015\"\n```\n```\n/2.0/repositories/{username}/{slug}/refs/tags?q=name+%7E+%222015%22\n```\nOr all my branches:\n\n```\nname ~ \"erik/\"\n```\n```\n/2.0/repositories/{username}/{slug}/refs/?q=name+%7E+%22erik%2F%22\n```\n### Sorting query results\n\nYou can sort result sets using the ?sort= query parameter, available on the same resources that support filtering:\n\n* In principle, every field that can be queried can also be used as a key for sorting.\n* By default the sort order is ascending. To reverse the order, prefix the field name with a hyphen (e.g. ?sort=-updated_on).\n* Only one field can be sorted on. Compound fields (e.g. sort on state first, followed by updated_on) are not supported.\n\n\n", "title": "Filter and sort API objects", "anchor": "filtering", "description": "Query the 2.0 API for specific objects", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwM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sMCwwLDEtNS4wODY3LDIuMjc4OWMtMTUuNzAyOSw1Ljk2MDktMjkuNjg5NSwyLjExLTM2LjQ5ODcuMTMwOC0yMC40MzA3LTUuOTM5LTI0Ljc5LTE3LjM3ODUtMzkuMDQxNC0yNC41ODIzYTQ4LjMwOTIsNDguMzA5MiwwLDAsMC0xNC4wOTM5LTQuNTNjLS4wODYyLjEzOTUtLjE3OTMuMjczLS4yNjQ0LjQxMzVBNTEuMTkwNyw1MS4xOTA3LDAsMCwwLDc5LjQzMywxMTYuOTgyWiIvPgogICAgICA8L2c+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K" }, { "body": "\nEndpoints that return collections of objects should always apply pagination.\nPaginated collections are always wrapped in the following wrapper object:\n\n```json\n{\n \"size\": 5421,\n \"page\": 2,\n \"pagelen\": 10,\n \"next\": \"https://api.bitbucket.org/2.0/repositories/pypy/pypy/commits?page=3\",\n \"previous\": \"https://api.bitbucket.org/2.0/repositories/pypy/pypy/commits?page=1\",\n \"values\": [\n ...\n ]\n}\n```\n\nPagination is often page-bound, with a query parameter page indicating which\npage is to be returned.\n\nHowever, clients are not expected to construct URLs themselves by manipulating\nthe page number query parameter. Instead, the response contains a link to the\nnext page. This link should be treated as an opaque location that is not to be\nconstructed by clients or even assumed to be predictable. The only contract\naround the next link is that it will return the next chunk of results.\n\nLack of a next link in the response indicates the end of the collection.\n\nThe paginated response contains the following fields:\n\n| Field | Value |\n|------------|----------|\n| `size` | Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute. |\n| `page` | Page number of the current results. This is an optional element that is not provided in all responses. |\n| `pagelen` | Current number of objects on the existing page. Globally, the minimum length is 10 and the maximum is 100. Some APIs may specify a different default. |\n| `next` | Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs. |\n| `previous` | Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs. |\n| `values` | The list of objects. This contains at most `pagelen` objects. |\n\nThe link to the next page is included such that you don't have to hardcode or construct any links. Only values and next are guaranteed (except the last page, which lacks next). This is because the previous and size values can be expensive for some data sets.\n\nIt is important to realize that Bitbucket support both list-based pagination and iterator-based pagination. List-based pagination assumes that the collection is a discrete, immutable, consistently ordered, finite array of objects with a fixed size. Clients navigate a list-based collection by requesting offset-based chunks. In Bitbucket Cloud, list-based responses include the optional size, page, and previous element. The the next and previous links typically resemble something like /foo/bar?page=4.\n\nHowever, not all result sets can be treated as immutable and finite – much like how programming languages tend to distinguish between lists and arrays on one hand and iterators or stream on the other. Where an list-based pagination offers random access into any point in a collection, iterator-based pagination can only navigate forward one element at a time. In Bitbucket such iterator-based pagination contains the next link and pagelen elements, but not necessarily anything else. In these cases, the next link's value often contains an unpredictable hash instead of an explicit page number. The commits resource uses iterator-based pagination.\n", "title": "Pagination", "anchor": "pagination", "description": "Learn more about pagination", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjM4LjgyIDE1MS42Ij48ZGVmcz48c3R5bGU+LmNscy0xe2ZpbGw6I2IyZDRmZjt9LmNscy0ye2ZpbGw6IzRjOWFmZjt9LmNscy0ze2ZpbGw6IzAwNTJjYzt9LmNscy00e29wYWNpdHk6MC42O30uY2xzLTV7ZmlsbDp1cmwoI2xpbmVhci1ncmFkaWVudCk7fS5jbHMtNntmaWxsOnVybCgjbGluZWFyLWdyYWRpZW50LTIpO30uY2xzLTd7ZmlsbDp1cmwoI2xpbmVhci1ncmFkaWVudC0zKTt9LmNscy04e2ZpbGw6dXJsKCNsaW5lYXItZ3JhZGllbnQtNCk7fS5jbHMtOXtmaWxsOnVybCgjbGluZWFyLWdyYWRpZW50LTUpO30uY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OS4xNiIgeTE9IjEwMi4zMyIgeDI9IjExNy4yNCIgeTI9IjEwMi4zMyIvPjxsaW5lIGNsYXNzPSJjbHMtMTAiIHgxPSI2Mi45MyIgeTE9IjEwMi4zMyIgeDI9IjcyLjYiIHkyPSIxMDIuMzMiLz48bGluZSBjbGFzcz0iY2xzLTEwIiB4MT0iMTI1Ljk4IiB5MT0iMTEzLjEiIHgyPSIxNDkuMDYiIHkyPSIxMTMuMSIvPjxsaW5lIGNsYXNzPSJjbHMtMTIiIHgxPSI3OS4xNiIgeTE9IjExMy4xIiB4Mj0iMTE3LjI0IiB5Mj0iMTEzLjEiLz48bGluZSBjbGFzcz0iY2xzLTEwIiB4MT0iNjIuOTMiIHkxPSIxMTMuMSIgeDI9IjcyLjYiIHkyPSIxMTMuMSIvPjwvZz48L2c+PC9zdmc+" }, { "body": "\nBy default, each endpoint returns the full representation of a resource and in\nsome cases that can be a lot of data. For example, retrieving a list of pull\nrequests can amount to quite a large document.\n\nFor better performance, you can ask the server to only return the fields you\nreally need and to omit unwanted data. To request a partial response and to\nadd or remove specific fields from a response, use the `fields` query\nparameter.\n\n\n### Example\n\nMost API resources embed a substantial list of links pointing to related\nresources. This saves the client from constructing its own URLs, but is\nsomewhat wasteful when the client doesn't need them.\n\nTo significantly reduce the size of the response, use `?fields=-links`:\n\n```json\n$ curl https://api.bitbucket.org/2.0/users/evzijst?fields=-links\n{\n \"nickname\": \"evzijst\",\n \"account_status\": \"active\",\n \"website\": \"\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{a288a0ab-e13b-43f0-a689-c4ef0a249875}\",\n \"created_on\": \"2010-07-07T05:16:36+00:00\",\n \"location\": null,\n \"type\": \"user\"\n}\n```\n\n### Fields parameter syntax\n\nThe `fields` parameter supports 3 modes of operation:\n\n1. Removal of select fields (e.g. `-links`)\n2. Pulling in additional fields not normally returned by an endpoint, while\n still getting all the default fields (e.g. `+reviewers`)\n3. Omitting all fields, except those specified (e.g. `owner.display_name`)\n\nThe fields parameter can contain a list of multiple comma-separated field names\n(e.g. `fields=owner.display_name,uuid,links.self.href`). The parameter itself is\nnot repeated.\n\nAs discussed at [Condensed Versus Full Objects](serialization#representations),\nmost objects that are embedded inside other objects (like how `owner` is an\nembedded `user` object in `repository`) appear in \"condensed\" form that omits\nmany fields. The `fields` parameter allows us to pull in additional fields in\nsuch cases.\n\nFor example, the embedded repository object in a pull request does not normally\ncontain its `owner`. To add that in we can use:\n`+values.destination.repository.owner`.\n\n\n### Wildcards\n\nThe asterisk can be used to match all fields on a particular level. For\nexample, removing all entries from the `links` element can be done like this:\n\n```json\n$ curl https://api.bitbucket.org/2.0/users/evzijst?fields=-links.*\n{\n \"nickname\": \"evzijst\",\n \"account_status\": \"active\",\n \"website\": \"\",\n \"display_name\": \"Erik van Zijst\",\n \"uuid\": \"{a288a0ab-e13b-43f0-a689-c4ef0a249875}\",\n \"links\": {},\n \"created_on\": \"2010-07-07T05:16:36+00:00\",\n \"location\": null,\n \"type\": \"user\"\n}\n```\n\nWildcards can be used in combination with exclusion and inclusion. For\ninstance, `-*,+foo,+bar` will remove all elements from the root level and then\nadd in `foo` and `bar`.\n\n\n### URL encoding\n\nBe aware that when using the `+foo.bar` syntax in the query string, that the\n\"+\" must be URL encoded as \"%2B\" and so the URL will be:\n\n```\nhttps://api.bitbucket.org/2.0/repositories/evzijst/interruptingcow?fields=%2Bowner.created_on\n```\n\nWithout URL escaping, \"+\" is interpreted as an encoded space which will not\nmatch any fields.\n\n\n### Field discovery\n\nWhile a resource's `self` URL, as well its \"collection\" URL typically return\nthe full object with all its fields, there are some exceptions for fields that\nare overly verbose or costly to generate.\n\nFor instance, a pull request contains the embedded lists of reviewers and\nparticipants. These fields are included from the `self` URL, but not from the\n`/pullrequests` collections resource, as it would impact performance too much.\n\nTo discover any additional fields that might not be included by default,\n`fields=*` can be used.\n\n\n### More examples\n\nIf we want to get a list of all reviewer nicknames on pull requests I created,\nwe could combine a [filter](filtering) with a partial response. This will omit\nall other data from the response:\n\n```\n/2.0/repositories/bitbucket/bitbucket/pullrequests?fields=values.id,values.reviewers.nickname,values.state&q=author.uuid%3D%22%7Bd301aafa-d676-4ee0-88be-962be7417567%7D%22\n{\n \"values\": [\n {\n \"reviewers\": [\n {\n \"nickname\": \"abhin\"\n },\n {\n \"nickname\": \"dtao\"\n },\n {\n \"nickname\": \"csomme\"\n }\n ],\n \"state\": \"OPEN\",\n \"id\": 11355\n },\n {\n \"reviewers\": [\n {\n \"nickname\": \"csomme\"\n },\n {\n \"nickname\": \"abhin\"\n },\n {\n \"nickname\": \"dstevens\"\n }\n ],\n \"state\": \"MERGED\",\n \"id\": 11347\n },\n {\n \"reviewers\": [\n {\n \"nickname\": \"csomme\"\n },\n {\n \"nickname\": \"jmooring\"\n },\n {\n \"nickname\": \"zdavis\"\n },\n {\n \"nickname\": \"flexbox\"\n }\n ],\n \"state\": \"OPEN\",\n \"id\": 11344\n }\n ]\n}\n```\n", "title": "Partial responses", "anchor": "partial-response", "description": "Tweak which fields are returned", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMTYyLjQ0ODcgMjEwLjExMTUiPgogIDxkZWZzPgogICAgPHN0eWxlPgogICAgICAuY2xzLTEgewogICAgICAgIGlzb2xhdGlvbjogaXNvbGF0ZTsKICAgICAgfQoKICAgICAgLmNscy0yLCAuY2xzLTYsIC5jbHMtOCB7CiAgICAgICAgZmlsbDogbm9uZTsKICAgICAgfQoKICAgICAgLmNscy0yLCAuY2xzLTggewogICAgICAgIHN0cm9rZTogIzAwNjVmZjsKICAgICAgICBzdHJva2Utd2lkdGg6IDJweDsKICAgICAgfQoKICAgICAgLmNscy0yIHsKICAgICAgICBzdHJva2UtbGluZWpvaW46IHJvdW5kOwogICAgICB9CgogICAgICAuY2xzLTMgewogICA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jExMzUiIHkyPSIyNi41ODM4Ii8+CiAgICAgICAgPHBvbHlnb24gY2xhc3M9ImNscy05IiBwb2ludHM9IjE2Mi40NDkgMzguNzQyIDEyMy43MDcgMzguNzQyIDEyMy43MDcgMCAxNjIuNDQ5IDM4Ljc0MiIvPgogICAgICA8L2c+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K" }, { "body": "\n----\n\n* [Open API Specification](#open-api-specification)\n* [JSON Schema](#json-schema)\n* [Condensed Versus Full Objects](#condensed-versus-full-objects)\n\n____\n\n\n### Open API Specification\n\nBitbucket uses the [Open API Specification](https://openapis.org) (OAI,\nformerly known as Swagger) to describe its APIs. Our OAI specification schema\nis hosted at [https://api.bitbucket.org/swagger.json](https://api.bitbucket.org/swagger.json)\nand serves as the canonical definition and comprehensive declaration of all\navailable endpoints.\n\nThe OAI specification makes writing client applications easier by:\nauto-generating boilerplate code (like data object classes) and dealing with\nauthentication and error handling.\n\nYou can find a comprehensive set of open tools for the OAI specification at:\n[https://github.com/swagger-api](https://github.com/swagger-api).\n\n\n### JSON Schema\n\nBitbucket uses JSON Schema to describe the layout of every type of object\nconsumed or produced by the API. These schemas are collected under the\n`#definitions` element of our swagger.json file.\n\nWhen an endpoint expects an object as part of a POST or PUT, it also expects\nthe object to validate against the JSON schemas. The same applies to objects\nreturned by an endpoint.\n\n\n### Condensed Versus Full Objects\n\nMost objects in Bitbucket come both in \"full\" and \"partial\" representation.\nThe full representation is when all elements are included. This is the layout\nreturned by a resource's `self` location (e.g. `/2.0/repositories/foo/bar`),\nas well as resource collection endpoints (e.g. `/2.0/repositories`).\n\nHowever, Bitbucket objects often embed other objects. For example, a `repository`\nobject embeds a `user` object for its owner. Likewise, a `pullrequest` object\nembeds its `repository` object.\n\nThese related objects are embedded, or inlined, to reduce the \"chatter\" when\nclients make frequent followup API calls to collect information on common,\nrelated information.\n\nEmbedded related objects are typically limited in their fields to avoid such\nobject graphs from becoming too deep and noisy. They often exclude their own\nnested objects in an attempt to strike a balance between performance and\nutility.\n\nAn object's embedded or condensed representation tends to be standardized,\nmeaning the fields included is the same set, regardless of where the object\nwas embedded.\n", "title": "Schemas and Serialization", "anchor": "serialization", "description": "Learn more about object representations", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyMjAuNzYyNCAyMDUuNTg2Ij4KICA8ZGVmcz4KICAgIDxzdHlsZT4KICAgICAgLmNscy0xIHsKICAgICAgICBpc29sYXRpb246IGlzb2xhdGU7CiAgICAgIH0KCiAgICAgIC5jbHMtMiwgLmNscy02IHsKICAgICAgICBtaXgtYmxlbmQtbW9kZTogbXVsdGlwbHk7CiAgICAgIH0KCiAgICAgIC5jbHMtMTMsIC5jbHMtMywgLmNscy00LCAuY2xzLTYgewogICAgICAgIGZpbGw6IG5vbmU7CiAgICAgICAgc3Ryb2tlOiAjYzFjN2QwOwogICAgICAgIHN0cm9rZS1saW5lY2FwOiByb3VuZDsKICAgICAgICBzdHJva2UtbWl0ZXJsaW1pdDogMTA7CiAgICAgICAgc3Ryb2tlLXdpZHRoOiAycHg7CiAgICAgIH0KCiAgICAgIC5jbHMtNCB7CiAgICAgICAgc3Ryb2tlLWRhc2hhcnJheTogMy43ODE2IDUuMjk0MzsKICAgICAgfQoKICAgICAgLmNscy01IHsKICAgICAgICBmaWxsOiAjMDA2NWZmOwogICAgICB9CgogICAgICAuY2xzLTYgewogICAgICAgIHN0cm9rZS1kYXNoYXJyYXk6IDMuOTIxOSA1LjQ5MDc7CiAgICAgIH0KCiAgICAgIC5jbHMtNyB7CiAgICAgICAgZmlsbDogIzAwNTJjYzsKICAgICAgfQoKICAgICAgLmNscy04IHsKICAgICAgICBmaWxsOiAjNGM5YWZmOwogICAgICB9CgogICAgICAuY2xzLTkgewogICAgICAgIGZpbGw6ICMwMDQ5YjA7CiAgICAgIH0KCiAgICAgIC5jbHMtMTAgewogICAgICAgIGZpbGw6ICM1N2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0IDE2Mi4yOTEgOTIuMzk0IDE3My44MTUiLz4KICAgICAgICA8cG9seWdvbiBjbGFzcz0iY2xzLTE1IiBwb2ludHM9Ijc0Ljg3NSAxODUuNjYyIDc1LjA1NCAyMDUuNTg2IDU3LjMxOSAxOTQuMDU3IDU3LjEzOSAxNzQuMTMyIDc0Ljg3NSAxODUuNjYyIi8+CiAgICAgICAgPHBvbHlnb24gY2xhc3M9ImNscy0xNiIgcG9pbnRzPSI5Mi4zOTQgMTczLjgxNSA5Mi41NzQgMTkzLjczOSA3NS4wNTQgMjA1LjU4NiA3NC44NzUgMTg1LjY2MiA5Mi4zOTQgMTczLjgxNSIvPgogICAgICA8L2c+CiAgICA8L2c+CiAgPC9nPgo8L3N2Zz4K" }, { "body": "\nYou should be familiar with REST architecture before writing an integration. Read this overview page to gain a good understanding of Bitbucket's REST implementation.\n\n----\n\n* [URI structure](#uri-structure)\n* [HTTP methods](#http-methods)\n* [UUID](#universally-unique-identifier)\n * [User object and UUID](#user-object-and-uuid)\n * [Repository object and UUID](#repository-object-and-uuid)\n * [Team object and UUID](#team-object-and-uuid)\n* [Standard error responses](#standardized-error-responses)\n* [Standard ISO-8601 timestamps](#standard-iso-8601-timestamps)\n\n----\n\n\n### URI structure\n\nAll Bitbucket Cloud requests start with the `https://api.bitbucket.org/2.0` prefix (for the 2.0 API) and `https://api.bitbucket.org/1.0` prefix (1.0 API).\n\nThe next segment of the URI path depends on the endpoint of the request. For example, using the curl command and the repositories endpoint you can list all the issues on Bitbucket's tutorial repository:\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/tutorials/tutorials.bitbucket.org\n```\nGiven a specific endpoint, you can then drill down to a particular aspect or resource of that endpoint. The issues resource on a repository is an example:\n\n```\ncurl https://api.bitbucket.org/1.0/repositories/tutorials/tutorials.bitbucket.org/issues\n```\n\n#### HTTP methods\n\nA given endpoint or resource has a series of actions (or methods) associated with it. The Bitbucket service supports these standard HTTP methods:\n\n| Call | Description |\n|------|-------------|\n| GET | Retrieves information. |\n| PUT | Updates existing information. |\n| POST | Creates new information. |\n| DELETE | Removes existing information. |\n\nFor example, you can call use the POST action on the issues resource and create an issue on the issue tracker.\n\n**Specifying content length**\n\nYou can get a `411 Length Required` response. If this happens, the API requires a Content-Length header but the client is not sending it. You should add the header yourself, for example using the curl client:\n\n```\ncurl -r PUT --header \"Content-Length: 0\" -u user:pass https://api.bitbucket.org/1.0/emails/rap@atlassian.com\n```\n\n### Universally Unique Identifier\n\nUUID's provide a single point of recognition for users, teams, and repositories. The UUID is distinct from the username, team name, and repository name fields and remains the same even when those fields change. For example when a user changes their username or moves a repository you will need to modify calls which use those identifiers but not if you are pointing to the UUID.\n\n#### UUID examples and structure\n\nUUID's work with both the 1.0 and 2.0 APIs for the user, team, and repository objects. The following examples the following characters are replacements for curly brackets: `%7B` replaces `{` and `%7D` replaces `}`. You will see this structure in the following example sections.\n\n#### User object and UUID\n\nWhen you make a call using either the username or the UUID for that user the response is the same.\n\n**Call with username**:\n\n```\ncurl https://api.bitbucket.org/2.0/users/tutorials\n```\n\n***Call with UUID for the user**:\n\n```\ncurl https://api.bitbucket.org/2.0/users/%7Bc788b2da-b7a2-404c-9e26-d3f077557007%7D\n```\n\n**Response**\n```JSON\n{\n \"username\": \"tutorials\",\n \"nickname\": \"tutorials\",\n \"account_status\": \"active\",\n \"website\": \"https://tutorials.bitbucket.org/\",\n \"display_name\": \"tutorials account\",\n \"uuid\": \"{c788b2da-b7a2-404c-9e26-d3f077557007}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials\"\n },\n \"repositories\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/tutorials\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/tutorials\"\n },\n \"followers\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/followers\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2013/Nov/25/tutorials-avatar-1563784409-6_avatar.png\"\n },\n \"following\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/following\"\n }\n },\n \"created_on\": \"2011-12-20T16:34:07.132459+00:00\",\n \"location\": \"Santa Monica, CA\",\n \"type\": \"user\"\n}\n```\n\n#### Repository object and UUID\n\nOnce you have the UUID for a repository you no longer need a username or team name to make the API call so long as you use an empty field. This helps you resolve repositories no matter if the username or team name changes.\n\n**Call with team name (1team) and repository name (moxie)**:\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/1team/moxie\n```\n**Call with UUID and empty field**:\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/%7B%7D/%7B21fa9bf8-b5b2-4891-97ed-d590bad0f871%7D\n```\n\n**Call with UUID and teamname**:\n\n```\ncurl https://api.bitbucket.org/2.0/repositories/1team/%7B21fa9bf8-b5b2-4891-97ed-d590bad0f871%7D\n```\n\n**Response**\n\n```JSON\n{\n \"created_on\": \"2013-11-08T01:11:03.222520+00:00\",\n \"description\": \"\",\n \"fork_policy\": \"allow_forks\",\n \"full_name\": \"1team/moxie\",\n \"has_issues\": false,\n \"has_wiki\": false,\n \"is_private\": false,\n \"language\": \"\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/1team/moxie/avatar/32/\"\n },\n \"branches\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/refs/branches\"\n },\n \"clone\": [\n {\n \"href\": \"https://bitbucket.org/1team/moxie.git\",\n \"name\": \"https\"\n },\n {\n \"href\": \"ssh://git@bitbucket.org/1team/moxie.git\",\n \"name\": \"ssh\"\n }\n ],\n \"commits\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/commits\"\n },\n \"downloads\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/downloads\"\n },\n \"forks\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/forks\"\n },\n \"hooks\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/hooks\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/1team/moxie\"\n },\n \"pullrequests\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/pullrequests\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie\"\n },\n \"tags\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/refs/tags\"\n },\n \"watchers\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/1team/moxie/watchers\"\n }\n },\n \"name\": \"moxie\",\n \"owner\": {\n \"display_name\": \"the team\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/1team/avatar/32/\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/1team/\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/teams/1team\"\n }\n },\n \"type\": \"team\",\n \"username\": \"1team\",\n \"uuid\": \"{aa559944-83c9-4963-a9a8-69ac8d9cf5d2}\"\n },\n \"project\": {\n \"key\": \"PROJ\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/user/1team/projects/PROJ/avatar/32\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/account/user/1team/projects/PROJ\"\n }\n },\n \"name\": \"Untitled project\",\n \"type\": \"project\",\n \"uuid\": \"{ab52aaeb-16ad-4fb0-bb1d-47e4f00367ff}\"\n },\n \"scm\": \"git\",\n \"size\": 33348,\n \"type\": \"repository\",\n \"updated_on\": \"2013-11-08T01:11:03.263237+00:00\",\n \"uuid\": \"{21fa9bf8-b5b2-4891-97ed-d590bad0f871}\",\n \"website\": \"\"\n}\n```\n\n#### Team object and UUID\n\nThis example shows a call for a list of team members using both the team name and with the UUID for the team object. As the call is unauthenticated in the following example the response object will only show members with public profiles. The response is the same in either case.\n\n**Call with teamname**\n\n```\ncurl https://api.bitbucket.org/2.0/teams/1team/members\n```\n**Call with UUID for team object**\n\n```\ncurl https://api.bitbucket.org/2.0/teams/%7Baa559944-83c9-4963-a9a8-69ac8d9cf5d2%7D/members\n```\n\n**Response**\n\n```JSON\n{\n \"page\": 1,\n \"pagelen\": 50,\n \"size\": 2,\n \"values\": [\n {\n \"created_on\": \"2011-12-20T16:34:07.132459+00:00\",\n \"display_name\": \"tutorials account\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/tutorials/avatar/32/\"\n },\n \"followers\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/followers\"\n },\n \"following\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/following\"\n },\n \"hooks\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/hooks\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/tutorials/\"\n },\n \"repositories\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/tutorials\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials\"\n },\n \"snippets\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/tutorials\"\n }\n },\n \"location\": null,\n \"type\": \"user\",\n \"username\": \"tutorials\",\n \"nickname\": \"tutorials\",\n \"account_status\": \"active\",\n \"uuid\": \"{c788b2da-b7a2-404c-9e26-d3f077557007}\",\n \"website\": \"https://tutorials.bitbucket.org/\"\n },\n {\n \"created_on\": \"2013-12-10T14:44:13+00:00\",\n \"display_name\": \"Dan Stevens [Atlassian]\",\n \"links\": {\n \"avatar\": {\n \"href\": \"https://bitbucket.org/account/dans9190/avatar/32/\"\n },\n \"followers\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/dans9190/followers\"\n },\n \"following\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/dans9190/following\"\n },\n \"hooks\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/dans9190/hooks\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/dans9190/\"\n },\n \"repositories\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/dans9190\"\n },\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/dans9190\"\n },\n \"snippets\": {\n \"href\": \"https://api.bitbucket.org/2.0/snippets/dans9190\"\n }\n },\n \"location\": null,\n \"type\": \"user\",\n \"username\": \"dans9190\",\n \"nickname\": \"dans9190\",\n \"account_status\": \"active\",\n \"uuid\": \"{1cd06601-cd0e-4fce-be03-e9ac226978b7}\",\n \"website\": \"\"\n }\n ]\n}\n```\n\n### Standardized error responses\n\nThe 2.0 API standardizes the error response layout. The 2.0 API serves a JSON\nobject along with the appropriate HTTP status code. The JSON object provides a\ndetailed problem description.\n\n```json\n{\n \"type\": \"error\",\n \"error\": {\n \"message\": \"Bad request\",\n \"fields\": {\n \"src\": [\n \"This field is required.\"\n ]\n },\n \"detail\": \"You must specify a valid source branch when creating a pull request.\",\n \"id\": \"d23a1cc5178f7637f3d9bf2d13824258\",\n \"data\": {\n \"extra\": \"Optional, endpoint-specific data to further augment the error.\"\n }\n }\n}\n```\n\nThis object contains an error element which contains the following nested\nelements:\n\n| Element | Description |\n| message | A short description of the problem. This element is always present. Its value may be localized. |\n| fields | This optional element is used in response to POST or PUT operations in which clients have provided invalid input. It contains a list of one or more client-provided fields that failed validation. The values may be localized. |\n| detail | An optional detailed explanation of the failure. Its value may be localized.\n| id | An optional unique error identifier that identifies the error in Bitbucket's logging system. If you feel you hit a bug in an API and this field is provided, please mention it if you decide to contact support as it will greatly help us narrow down the problem. |\n\n### Standard ISO-8601 timestamps\n\nAll 2.0 APIs use standardized ISO-8601 timestamps. In most cases, our APIs return UTC timestamps and for these, the timezone offset part will be 00:00. In rare cases where the original localized timestamp has significance, the timezone offset may identify the event's original timezone.\n", "title": "URI, UUID, and structures", "anchor": "uri-uuid", "description": "URL's, UUID's, errors, and timestamps", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAg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M9ImNscy0xMCIgeDE9IjEwMiIgeTE9IjEzMS4wNSIgeDI9IjE2My42MiIgeTI9IjEzMS4wNSIvPjxsaW5lIGNsYXNzPSJjbHMtMTMiIHgxPSI1NS44OSIgeTE9IjEzMS4wNSIgeDI9IjkzLjk5IiB5Mj0iMTMxLjA1Ii8+PGxpbmUgY2xhc3M9ImNscy0xMyIgeDE9IjU1Ljg5IiB5MT0iMTQ1LjEzIiB4Mj0iMTM5LjY3IiB5Mj0iMTQ1LjEzIi8+PGxpbmUgY2xhc3M9ImNscy05IiB4MT0iNzguOSIgeTE9IjE1OS4yMSIgeDI9IjExMy41MSIgeTI9IjE1OS4yMSIvPjxsaW5lIGNsYXNzPSJjbHMtOSIgeDE9IjU5LjYxIiB5MT0iODguODIiIHgyPSI5OS4zMyIgeTI9Ijg4LjgyIi8+PGxpbmUgY2xhc3M9ImNscy05IiB4MT0iNTkuNjEiIHkxPSIxMDIuODkiIHgyPSI5OS4zMyIgeTI9IjEwMi44OSIvPjxjaXJjbGUgY2xhc3M9ImNscy02IiBjeD0iMTMuNSIgY3k9IjEyLjA4IiByPSI1LjExIi8+PGNpcmNsZSBjbGFzcz0iY2xzLTciIGN4PSIzMC4xOCIgY3k9IjEyLjA4IiByPSI1LjExIi8+PGNpcmNsZSBjbGFzcz0iY2xzLTgiIGN4PSI0Ni44NiIgY3k9IjEyLjA4IiByPSI1LjExIi8+PC9nPjwvZz48L3N2Zz4=" }, { "body": "\nThis section describes [Cross-origin resource sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing) (CORS), what content types we support in requests and responses, and hyperlinking resources in each json responses.\n\n\n----\n\n* [CORS](#cors)\n* [Supported content types](#supported-content-types)\n* [Resource links](#resource-links)\n\n----\n\n### Cors\n\nThe Bitbucket API supports Cross-origin resource sharing to allow requests for restricted resources across domains. For more information you can refer to:\n\n* [Wikipedia article on CORS](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing)\n* [W3C CORS recommendation](https://www.w3.org/TR/cors/)\n\nSending a general request from the api to bitbucket.com:\n\n`curl -i https://api.bitbucket.org -H \"origin: http://bitbucket.com\"`\n\nGives this result:\n\n HTTP/1.1 302 FOUND\n Server: nginx/1.6.2\n Vary: Cookie\n Cache-Control: max-age=900\n Content-Type: text/html; charset=utf-8\n Strict-Transport-Security: max-age=31536000\n Date: Tue, 21 Jun 2016 17:54:37 GMT\n Location: http://confluence.atlassian.com/x/IYBGDQ\n X-Served-By: app-110\n X-Static-Version: 2c820eb0d2b3\n ETag: \"d41d8cd98f00b204e9800998ecf8427e\"\n X-Content-Type-Options: nosniff\n X-Render-Time: 0.00379920005798\n Connection: Keep-Alive\n X-Version: 2c820eb0d2b3\n X-Frame-Options: SAMEORIGIN\n X-Request-Count: 383\n X-Cache-Info: cached\n Content-Length: 0\n\nSending the same request with the CORS check -X OPTIONS in the call:\n\n`curl -i https://api.bitbucket.org -H \"origin: http://bitbucket.com\" -X OPTIONS`\n\nGives this result:\n\n HTTP/1.1 302 FOUND\n Server: nginx/1.6.2\n Vary: Cookie\n Cache-Control: max-age=900\n Content-Type: text/html; charset=utf-8\n Access-Control-Expose-Headers: Accept-Ranges, Content-Encoding, Content-Length, Content-Type, ETag, Last-Modified\n Strict-Transport-Security: max-age=31536000\n Date: Tue, 21 Jun 2016 18:04:30 GMT\n Access-Control-Max-Age: 86400\n Location: http://confluence.atlassian.com/x/IYBGDQ\n X-Served-By: app-111\n Access-Control-Allow-Origin: *\n X-Static-Version: 2c820eb0d2b3\n ETag: \"d41d8cd98f00b204e9800998ecf8427e\"\n X-Content-Type-Options: nosniff\n X-Render-Time: 0.00371098518372\n Connection: keep-alive\n X-Version: 2c820eb0d2b3\n X-Frame-Options: SAMEORIGIN\n X-Request-Count: 357\n Access-Control-Allow-Methods: GET, POST, PUT, PATCH, DELETE, OPTIONS\n Access-Control-Allow-Headers: Accept, Authorization, Content-Type, If-Match, If-Modified-Since, If-None-Match, If-Unmodified-Since, Origin, Range, X-CsrftokenX-Requested-With\n X-Cache-Info: not cacheable; request wasn't a GET or HEAD\n Content-Length: 0\n\n\n\n### Supported content types\n\nThe default and primary content type for 2.0 APIs is JSON. This applies both to responses from the server and to the request bodies provided by the client.\n\nUnless documented otherwise, whenever creating a new (POST) or modifying an existing (PUT) object, your client must provide the object's normal representation. Not every object element can be mutated. For example, a repository's created_on date is an auto-generated, immutable field. Your client can omit immutable fields from a request body.\n\nIn some cases, a resource might also accept regular application/x-www-url-form-encoded POST and PUT bodies. Such bodies can be more convenient in scripts and command line usage. Requests bodies can contain contain nested elements or they can be flat (without nested elements). Clients can send flat request bodies as either as application/json or as application/x-www-url-form-encoded. Nested objects always require JSON.\n\n### Resource links\n\nEvery 2.0 object contains a links element that points to related resources or alternate representations. Use links to quickly discover and traverse to related objects. Links serve a \"self-documenting\" function for each endpoint. For example, the following request for a specific user:\n\n\n`$ curl https://api.bitbucket.org/2.0/users/tutorials`\n\n```json\n{\n \"username\": \"tutorials\",\n \"nickname\": \"tutorials\",\n \"account_status\": \"active\",\n \"website\": \"https://tutorials.bitbucket.org/\",\n \"display_name\": \"tutorials account\",\n \"uuid\": \"{c788b2da-b7a2-404c-9e26-d3f077557007}\",\n \"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials\"\n },\n \"repositories\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/tutorials\"\n },\n \"html\": {\n \"href\": \"https://bitbucket.org/tutorials\"\n },\n \"followers\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/followers\"\n },\n \"avatar\": {\n \"href\": \"https://bitbucket-assetroot.s3.amazonaws.com/c/photos/2013/Nov/25/tutorials-avatar-1563784409-6_avatar.png\"\n },\n \"following\": {\n \"href\": \"https://api.bitbucket.org/2.0/users/tutorials/following\"\n }\n },\n \"created_on\": \"2011-12-20T16:34:07.132459+00:00\",\n \"location\": \"Santa Monica, CA\",\n \"type\": \"user\"\n}\n```\nLinks can be actual REST API resources or they can be informational. In this example, informative resources include the user's avatar and the HTML URL for the user's Bitbucket account. Your client should avoid hardcoding an API's URL and instead use the URLs returned in API responses.\n\nA link's key is its `rel` (relationship) attribute and it contains a mandatory href element. For example, the following link:\n\n```json\n\"self\": {\n \"href\": \"https://api.bitbucket.org/api/2.0/users/tutorials\"\n}\n```\n\nThe rel for this link is self and the href is https://api.bitbucket.org/api/2.0/users/tutorials. A single rel key can contain an list (array) of href objects. Your client should anticipate that any rel key can contain one or more href objects.\n\nFinally, links can also contain optional elements. Two common optional elements are the name element and the title element. They are often used to disambiguate links that share the same rel key. In the example below, the repository object that contains a clone link with two href objects. Each object contains the optional name element to clarify its use.\n\n```json\n\"links\": {\n \"self\": {\n \"href\": \"https://api.bitbucket.org/2.0/repositories/evzijst/bitbucket\"\n },\n \"clone\": [\n {\n \"href\": \"https://api.bitbucket.org/evzijst/bitbucket.git\",\n \"name\": \"https\"\n },\n {\n \"href\": \"ssh://git@bitbucket.org/erik/bitbucket.git\",\n \"name\": \"ssh\"\n }\n ],\n ...\n}\n```\nLinks can support [URI Templates](https://tools.ietf.org/html/rfc6570); Those that do contain a `\"templated\": \"true\"` element.\n", "title": "Cors and hypermedia", "anchor": "cors-hypermedia", "description": "Learn about resources and linking", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjM2LjYgMjE4LjQzIj48ZGVmcz48c3R5bGU+LmNscy0xe2lzb2xhdGlvbjppc29sYXRlO30uY2xzLTIsLmNscy0zLC5jbHMtNHtmaWxsOm5vbmU7c3Ryb2tlLWxpbmVjYXA6cm91bmQ7c3Ryb2tlLW1pdGVybGltaXQ6MTA7c3Ryb2tlLXdpZHRoOjExcHg7fS5jbHMtMntzdHJva2U6dXJsKCNsaW5lYXItZ3JhZGllbnQpO30uY2xzLTN7c3Ryb2tlOnVybCgjTmV3X0dyY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CwxODgsMTY5LjA4cy0yLjM1LTkuNDQtNy4zMy0xNi44M0E0My44OSw0My44OSwwLDAsMCwxNjksMTQxLjA4YTMxLjc3LDMxLjc3LDAsMCwwLDI5LjI4LDU2LjEzQzE5My43OSwxOTIuNDQsMTkwLjE4LDE4Ni45LDE4OS42MiwxODAuMzZaIi8+PGcgaWQ9Il9Hcm91cF8yIiBkYXRhLW5hbWU9IiZsdDtHcm91cCZndDsiPjxwYXRoIGNsYXNzPSJjbHMtOSIgZD0iTTg5LjksMzMuNzhhMzIuNDYsMzIuNDYsMCwxLDEsMTEuODgsNDQuMzRBMzIuNDksMzIuNDksMCwwLDEsODkuOSwzMy43OFoiLz48L2c+PHBhdGggY2xhc3M9ImNscy0xMCIgZD0iTTEyMi4yMyw2Ni4xM2E1OC45LDU4LjksMCwwLDAtMS41OS0xMS4yN3MtMi4zNS05LjQ0LTcuMzMtMTYuODNjLTMuMzctNS05LjA2LTkuNzktMTUuNDMtMTMuNDhBMzIuNDQsMzIuNDQsMCwwLDAsMTI4Ljc3LDgwLjZDMTI1LjMxLDc2LjM5LDEyMi43LDcxLjYxLDEyMi4yMyw2Ni4xM1oiLz48L2c+PC9nPjwvZz48L3N2Zz4=" }, { "body": "\nYou can use the Atlassian Connect for Bitbucket Cloud to build add-ons which\ncan connect with the Bitbucket UI and your own application set. An add-on could\nbe an integration with another existing service, new features for the Atlassian\napplication, or even a new product that runs within the Atlassian application.\n\nFor complete information see:\n[Atlassian Connect for Bitbucket Cloud](https://developer.atlassian.com/bitbucket/index.html)\n", "title": "Atlassian Connect", "anchor": "bb-connect", "description": "Build Bitbucket add-ons with Connect", "icon": "data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHhtbG5zOnhsaW5rPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5L3hsaW5rIiB2aWV3Qm94PSIwIDAgMjU3LjMxNjMgMTYyLjU5OTQiPgogIDxkZWZzPgogICAgPHN0eWxlPgogICAgICAuY2xzLTEgewogICAgICAgIGlzb2xhdGlvbjogaXNvbGF0ZTsKICAgICAgfQoKICAgICAgLmNscy0yIHsKICAgICAgICBmaWxsOiAjMzQ0NTYzOwogICAgICB9CgogICAgICAuY2xzLTMgewogICAgICAgIGZpbGw6ICMxZGI5ZDQ7CiAgICAgIH0KCiAgICAgIC5jbHMtNCB7CiAgICAgICAgZmlsbDogIzAwNTdkODsKICAgICAgfQoKICAgICAgLmNscy01LCAuY2xzLTcsIC5jbHMtOSB7CiAgICAgICAgbWl4LWJsZW5kLW1vZGU6IG11bHRpcGx5OwogICAgICB9CgogICAgICAuY2xzLTUgewogICAgICAgIGZpbGw6IHVybCgjTjc1KTsKICAgICAgfQoKICAgICAgLmNscy02IHsKICAgICAgICBmaWxsOiAjMDA2NWZmOwogICAgICB9CgogICAgICAuY2xzLTcgewogICAgICAgIGZpbGw6IHVybCgjTjc1LTIpOwogICAgICB9CgogICAgICAuY2xzLTggewogICAgICAgIGZpbGw6IHVybCgjbGluZWFyLWdyYWRpZW50KTsKICAgICAgfQoKICAgICAgLmNscy05IHsKICAgICAgICBmaWxsOiB1cmwoI043NS0zKTsKICAgICAgfQoKICAgICAgLmNscy0xMCB7CiAgICAgICAgZmlsbDogdXJsKCNUMjAwLVQ3NSk7CiAgICAgIH0KICAgIDwvc3R5bGU+CiAgICA8bGluZWFyR3JhZGllbnQgaWQ9Ik43NSIgeDE9Ii0yMTg5LjU1NiIgeTE9IjI4MDguMjI4NCIgeDI9Ii0yMDkxLjE1NTEiIHkyPSIyODA4LjIyODQiIGdyYWRpZW50VHJhbnNmb3JtPSJtYXRyaXgoMC4xNjgxLCAwLjk4NTgsIDAuOTg1OCwgLTAuMTY4MSwgLTIzNzMuNzM2LCAyNzIyLjEyNzgpIiBncmFkaWVudFVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+CiAgICAgIDxzdG9wIG9mZnNldD0iMCIgc3RvcC1jb2xvcj0iI2U1ZThlYyIvPgogIC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