blob: 49e40521c016347879c416083dcd12b4471e6763 [file] [log] [blame]
{
"info": {
"termsOfService": "https://www.atlassian.com/end-user-agreement",
"version": "2.0",
"contact": {
"url": "https://bitbucket.org/support",
"name": "Bitbucket Support",
"email": "support@bitbucket.org"
},
"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.",
"title": "Bitbucket API"
},
"paths": {
"/repositories/{username}/{repo_slug}/refs/branches/{name}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "name",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"refs"
]
}
},
"/teams/{username}/following": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"account"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the list of accounts this team is following.",
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The team's username",
"name": "username",
"in": "path"
}
],
"tags": [
"teams"
]
}
},
"/repositories/{username}/{repo_slug}/commit/{sha}/comments/{comment_id}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "sha",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "comment_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the specified commit comment.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"commits"
]
}
},
"/repositories/{username}/{repo_slug}/hooks": {
"post": {
"security": [
{
"oauth2": [
"webhook"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Creates a new webhook on the specified repository.",
"responses": {
"201": {
"description": "If the webhook was registered successfully.",
"schema": {
"$ref": "#/definitions/webhook_subscription"
}
},
"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"
}
}
},
"parameters": [],
"tags": [
"webhooks"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"webhook"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns a paginated list of webhooks installed on this repository.",
"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"
}
}
},
"parameters": [],
"tags": [
"webhooks"
]
}
},
"/repositories/{username}/{repo_slug}/issues/{issue_id}/attachments/{path}": {
"delete": {
"security": [
{
"oauth2": [
"issue:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Deletes an attachment.",
"responses": {
"401": {
"description": "If the issue tracker is private and the request was not authenticated."
},
"404": {
"description": "If the specified repository, issue, or attachment does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
},
"204": {
"description": "Indicates that the deletion was successful"
}
},
"parameters": [],
"tags": [
"issue_tracker"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "issue_id",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "path",
"in": "path"
}
],
"get": {
"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.",
"responses": {
"401": {
"description": "If the issue tracker is private and the request was not authenticated."
},
"404": {
"description": "If the specified repository or issue does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
},
"302": {
"headers": {
"Location": {
"type": "string"
}
},
"description": "A redirect to the file's contents"
}
},
"parameters": [],
"tags": [
"issue_tracker"
]
}
},
"/repositories/{username}/{repo_slug}/versions/{version_id}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "version_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"issue"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the specified issue tracker version object.",
"responses": {
"200": {
"description": "The specified version object.",
"schema": {
"$ref": "#/definitions/version"
}
},
"404": {
"description": "If the specified repository or version does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "integer",
"description": "The version's id",
"name": "version_id",
"in": "path"
}
],
"tags": [
"issue_tracker"
]
}
},
"/repositories/{username}/{repo_slug}/issues/{issue_id}/vote": {
"put": {
"security": [
{
"oauth2": [
"issue",
"account:write"
]
},
{
"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.",
"responses": {
"401": {
"description": "When the request wasn't authenticated.",
"schema": {
"$ref": "#/definitions/error"
}
},
"404": {
"description": "When the issue does not exist, the repo does not exist, or when the repos does not have an issue tracker.",
"schema": {
"$ref": "#/definitions/error"
}
},
"204": {
"description": "Indicating the authenticated user has cast their vote successfully.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "integer",
"description": "The issue's id",
"name": "issue_id",
"in": "path"
}
],
"tags": [
"issue_tracker"
]
},
"delete": {
"security": [
{
"oauth2": [
"issue:write",
"account:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Retract your vote.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "integer",
"description": "The issue's id",
"name": "issue_id",
"in": "path"
}
],
"tags": [
"issue_tracker"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "issue_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"issue",
"account"
]
},
{
"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.",
"responses": {
"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"
}
},
"204": {
"description": "If the authenticated user has not voted for this issue.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "integer",
"description": "The issue's id",
"name": "issue_id",
"in": "path"
}
],
"tags": [
"issue_tracker"
]
}
},
"/repositories/{username}/{repo_slug}/milestones": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"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.",
"responses": {
"200": {
"description": "The milestones that have been defined in the issue tracker.",
"schema": {
"$ref": "#/definitions/paginated_milestones"
}
},
"404": {
"description": "If the specified repository does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"issue_tracker"
]
}
},
"/repositories/{username}/{repo_slug}/components": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"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.",
"responses": {
"200": {
"description": "The components that have been defined in the issue tracker.",
"schema": {
"$ref": "#/definitions/paginated_components"
}
},
"404": {
"description": "If the specified repository does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"issue_tracker"
]
}
},
"/account/{username}/addons/{encoded_context_id}/refresh": {
"put": {
"security": [
{
"oauth2": [
"account:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_context_id",
"in": "path"
}
]
},
"/addon/linkers/{linker_key}/values": {
"put": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
},
"post": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
},
"delete": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "linker_key",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
}
},
"/repositories/{username}/{repo_slug}/refs/branches": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"refs"
]
}
},
"/hook_events/{subject_type}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "subject_type",
"in": "path"
}
],
"get": {
"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.",
"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"
}
}
},
"parameters": [
{
"enum": [
"user",
"repository",
"team"
],
"name": "subject_type",
"required": true,
"in": "path",
"type": "string",
"description": "A resource or subject type."
}
],
"tags": [
"webhooks"
]
}
},
"/users/{username}/followers": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the list of accounts that are following this team.",
"responses": {
"200": {
"description": "A paginated list of user objects.",
"schema": {
"$ref": "#/definitions/paginated_users"
}
},
"404": {
"description": "If no account exists for the specified name, or if the specified account is a team account, not a personal account.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The account's username",
"name": "username",
"in": "path"
}
],
"tags": [
"users"
]
}
},
"/repositories/{username}/{repo_slug}/default-reviewers": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"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.",
"responses": {
"200": {
"description": "The paginated list of default reviewers"
}
},
"parameters": [],
"tags": [
"pullrequests"
]
}
},
"/repositories/{username}/{repo_slug}/downloads/{filename}": {
"delete": {
"security": [
{
"oauth2": [
"repository:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Deletes the specified download artifact from the repository.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"downloads"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "filename",
"in": "path"
}
],
"get": {
"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",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"downloads"
]
}
},
"/repositories/{username}/{repo_slug}/commit/{node}/statuses/build/{key}": {
"put": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": []
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "node",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "key",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": []
}
},
"/repositories/{username}/{repo_slug}/watchers": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns a paginated list of all the watchers on the specified\nrepository.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"repositories"
]
}
},
"/snippets/{username}/{encoded_id}/commits": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"snippet"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the changes (commits) made on this snippet.",
"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"
}
}
},
"parameters": [],
"tags": [
"snippets"
]
}
},
"/users/{username}/repositories": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "All repositories owned by a user/team. This includes private\nrepositories, but filtered down to the ones that the calling user has\naccess to.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"users",
"teams"
]
}
},
"/repositories/{username}/{repo_slug}/pullrequests/activity": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"pullrequest"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the pull request's activity log. This includes comments that\nwere made by the reviewers, updates and approvals.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
}
},
"/snippets/{username}/{encoded_id}/comments/{comment_id}": {
"put": {
"security": [
{
"oauth2": [
"snippet"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Updates a comment.\n\nComments can only be updated by their author.",
"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"
}
}
},
"parameters": [],
"tags": [
"snippets"
]
},
"delete": {
"security": [
{
"oauth2": [
"snippet"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Deletes a snippet comment.\n\nComments can only be removed by their author.",
"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"
}
}
},
"parameters": [],
"tags": [
"snippets"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_id",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "comment_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"snippet"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the specific snippet comment.",
"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"
}
}
},
"parameters": [],
"tags": [
"snippets"
]
}
},
"/repositories/{username}/{repo_slug}/diff/{spec}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "spec",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"commits"
]
}
},
"/repositories/{username}/{repo_slug}/branch-restrictions": {
"post": {
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"branch_restrictions"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"branch_restrictions"
]
}
},
"/repositories/{username}/{repo_slug}/issues/{issue_id}/comments/{comment_id}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "issue_id",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "comment_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"issue"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the specified issue comment object.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"issue_tracker"
]
}
},
"/repositories/{username}/{repo_slug}/hooks/{uid}": {
"put": {
"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`",
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The installed webhook's id",
"name": "uid",
"in": "path"
}
],
"tags": [
"webhooks"
]
},
"delete": {
"security": [
{
"oauth2": [
"webhook"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Deletes the specified webhook subscription.",
"responses": {
"204": {
"description": "When the webhook was deleted successfully",
"schema": {
"$ref": "#/definitions/webhook_subscription"
}
},
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The installed webhook's id",
"name": "uid",
"in": "path"
}
],
"tags": [
"webhooks"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "uid",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"webhook"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the webhook installed on the specified repository.",
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The installed webhook's id.",
"name": "uid",
"in": "path"
}
],
"tags": [
"webhooks"
]
}
},
"/users/{username}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"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.",
"responses": {
"200": {
"description": "The user object",
"schema": {
"$ref": "#/definitions/team"
}
},
"404": {
"description": "If no user exists for the specified name or UUID, or if the specified account is a team account, not a personal account.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The account's username or UUID.",
"name": "username",
"in": "path"
}
],
"tags": [
"users"
]
}
},
"/snippets/{username}/{encoded_id}": {
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The snippet's id.",
"name": "encoded_id",
"in": "path"
}
],
"tags": [
"snippets"
],
"produces": [
"application/json",
"multipart/related",
"multipart/form-data"
],
"security": [
{
"oauth2": [
"snippet:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"consumes": [
"application/json",
"multipart/related",
"multipart/form-data"
],
"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."
},
"delete": {
"security": [
{
"oauth2": [
"snippet:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Deletes a snippet and returns an empty response.",
"responses": {
"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"
}
},
"204": {
"description": "If the snippet was deleted successfully."
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The snippet's id.",
"name": "encoded_id",
"in": "path"
}
],
"tags": [
"snippets"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_id",
"in": "path"
}
],
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The snippet's id.",
"name": "encoded_id",
"in": "path"
}
],
"produces": [
"application/json",
"multipart/related",
"multipart/form-data"
],
"tags": [
"snippets"
],
"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#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#image.png\"\n }\n }\n }\n ],\n \"owner\": {\n \"username\": \"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 \"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--"
}
},
"/addon/linkers": {
"parameters": [],
"get": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
}
},
"/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "pull_request_id",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "comment_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"pullrequest"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns a specific pull request comment.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
}
},
"/repositories/{username}/{repo_slug}/components/{component_id}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "component_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"issue"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the specified issue tracker component object.",
"responses": {
"200": {
"description": "The specified component object.",
"schema": {
"$ref": "#/definitions/component"
}
},
"404": {
"description": "If the specified repository or component does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "integer",
"description": "The component's id",
"name": "component_id",
"in": "path"
}
],
"tags": [
"issue_tracker"
]
}
},
"/addon": {
"put": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
},
"parameters": [],
"delete": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
}
},
"/users/{username}/following": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"account"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the list of accounts this user is following.",
"responses": {
"200": {
"description": "A paginated list of user objects.",
"schema": {
"$ref": "#/definitions/paginated_users"
}
},
"404": {
"description": "If no user exists for the specified name, or if the specified account is a team account, not a personal account.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The user's username",
"name": "username",
"in": "path"
}
],
"tags": [
"users"
]
}
},
"/repositories/{username}/{repo_slug}/issues/{issue_id}": {
"delete": {
"security": [
{
"oauth2": [
"issue:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Deletes the specified issue. This requires write access to the\nrepository.",
"responses": {
"200": {
"description": "The issue object.",
"schema": {
"$ref": "#/definitions/issue"
}
},
"403": {
"description": "When the authenticated user lacks isn't authorized to delete the issue tracker.",
"schema": {
"$ref": "#/definitions/error"
}
},
"404": {
"description": "If the specified repository or issue does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"issue_tracker"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "issue_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"issue"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the specified issue.",
"responses": {
"200": {
"description": "The issue object.",
"schema": {
"$ref": "#/definitions/issue"
}
},
"403": {
"description": "When the authenticated user lacks isn't authorized to access the issue tracker.",
"schema": {
"$ref": "#/definitions/error"
}
},
"404": {
"description": "If the specified repository or issue does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"issue_tracker"
]
}
},
"/teams/{username}/repositories": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "All repositories owned by a user/team. This includes private\nrepositories, but filtered down to the ones that the calling user has\naccess to.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"users",
"teams"
]
}
},
"/repositories/{username}/{repo_slug}/downloads": {
"post": {
"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.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"downloads"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns a list of download links associated with the repository.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"downloads"
]
}
},
"/repositories/{username}/{repo_slug}/refs": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"refs"
]
}
},
"/hook_events": {
"parameters": [],
"get": {
"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 `event` 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.",
"responses": {
"200": {
"description": "A mapping of resource/subject types pointing to their individual event types.",
"schema": {
"$ref": "#/definitions/subject_types"
}
}
},
"parameters": [],
"tags": [
"webhooks"
]
}
},
"/teams/{username}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"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.",
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The team's username or UUID.",
"name": "username",
"in": "path"
}
],
"tags": [
"teams"
]
}
},
"/user/emails/{email}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "email",
"in": "path"
}
],
"get": {
"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.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"users"
]
}
},
"/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/approve": {
"post": {
"security": [
{
"oauth2": [
"pullrequest:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Approve the specified pull request as the authenticated user.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "pull_request_id",
"in": "path"
}
],
"delete": {
"security": [
{
"oauth2": [
"pullrequest:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Redact the authenticated user's approval of the specified pull\nrequest.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
}
},
"/repositories/{username}/{repo_slug}/patch/{spec}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "spec",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"commits"
]
}
},
"/snippets/{username}/{encoded_id}/{node_id}/diff": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_id",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "node_id",
"in": "path"
}
],
"get": {
"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.",
"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"
}
}
},
"parameters": [
{
"type": "string",
"description": "When used, only one the diff of the specified file will be returned.",
"name": "path",
"in": "query"
},
{
"required": true,
"type": "string",
"description": "The snippet id.",
"name": "encoded_id",
"in": "path"
}
],
"tags": [
"snippets"
]
}
},
"/repositories/{username}/{repo_slug}/forks": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns a paginated list of all the forks of the specified\nrepository.",
"responses": {
"200": {
"description": "All forks.",
"schema": {
"$ref": "#/definitions/paginated_repositories"
}
}
},
"parameters": [],
"tags": [
"repositories"
]
}
},
"/repositories/{username}/{repo_slug}/issues": {
"post": {
"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 authorisation.\n\nThe authenticated user is used for the issue's `reporter` field.",
"responses": {
"201": {
"headers": {
"Location": {
"type": "string",
"description": "The (absolute) URL of the newly created issue."
}
},
"description": "The newly created issue.",
"schema": {
"$ref": "#/definitions/issue"
}
},
"403": {
"description": "When the authenticated user lacks the privilege to create issues in the issue tracker.",
"schema": {
"$ref": "#/definitions/error"
}
},
"404": {
"description": "If the specified repository or version does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
},
"401": {
"description": "When the request wasn't authenticated.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"schema": {
"$ref": "#/definitions/issue"
},
"required": true,
"description": "The new issue. Note that the only required element is `title`. All other elements can be omitted from the body.",
"name": "_body",
"in": "body"
}
],
"tags": [
"issue_tracker"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"issue"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the issues in the issue tracker.",
"responses": {
"200": {
"description": "A paginated list of the issues matching any filter criteria that were provided.",
"schema": {
"$ref": "#/definitions/paginated_issues"
}
},
"404": {
"description": "If the specified repository or version does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"issue_tracker"
]
}
},
"/repositories/{username}/{repo_slug}/issues/{issue_id}/attachments": {
"post": {
"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.",
"responses": {
"400": {
"description": "If no files were uploaded, or if the wrong `Content-Type` was used."
},
"201": {
"headers": {
"Location": {
"type": "string",
"description": "The URL to the issue's collection of attachments."
}
},
"description": "An empty response document."
},
"404": {
"description": "If the specified repository or issue does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
},
"401": {
"description": "If the issue tracker is private and the request was not authenticated."
}
},
"parameters": [
{
"required": true,
"type": "integer",
"description": "The issue's id",
"name": "issue_id",
"in": "path"
}
],
"tags": [
"issue_tracker"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "issue_id",
"in": "path"
}
],
"get": {
"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.",
"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": "If the specified repository or version does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "integer",
"description": "The issue's id",
"name": "issue_id",
"in": "path"
}
],
"tags": [
"issue_tracker"
]
}
},
"/repositories/{username}/{repo_slug}/versions": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"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.",
"responses": {
"200": {
"description": "The versions that have been defined in the issue tracker.",
"schema": {
"$ref": "#/definitions/paginated_versions"
}
},
"404": {
"description": "If the specified repository does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"issue_tracker"
]
}
},
"/repositories/{username}/{repo_slug}/refs/tags/{name}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "name",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"refs"
]
}
},
"/snippets/{username}/{encoded_id}/watch": {
"put": {
"security": [
{
"oauth2": [
"snippet:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Used to start watching a specific snippet. Returns 204 (No Content).",
"responses": {
"401": {
"description": "If the request was not authenticated.",
"schema": {
"$ref": "#/definitions/error"
}
},
"404": {
"description": "If the snippet does not exist.",
"schema": {
"$ref": "#/definitions/error"
}
},
"204": {
"description": "Indicates the authenticated user is now watching the snippet.",
"schema": {
"$ref": "#/definitions/paginated_users"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The snippet id.",
"name": "encoded_id",
"in": "path"
}
],
"tags": [
"snippets"
]
},
"delete": {
"security": [
{
"oauth2": [
"snippet:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Used to stop watching a specific snippet. Returns 204 (No Content)\nto indicate success.",
"responses": {
"401": {
"description": "If the request was not authenticated.",
"schema": {
"$ref": "#/definitions/error"
}
},
"404": {
"description": "If the snippet does not exist.",
"schema": {
"$ref": "#/definitions/error"
}
},
"204": {
"description": "Indicates the user stopped watching the snippet successfully.",
"schema": {
"$ref": "#/definitions/paginated_users"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The snippet id.",
"name": "encoded_id",
"in": "path"
}
],
"tags": [
"snippets"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_id",
"in": "path"
}
],
"get": {
"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.",
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The snippet id.",
"name": "encoded_id",
"in": "path"
}
],
"tags": [
"snippets"
]
}
},
"/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/diff": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "pull_request_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"pullrequest"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
}
},
"/snippets": {
"post": {
"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 the owner, creator\nand members of the team in case the snippet is owned by a team). This\nis 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 the owner and team members (for team\n snippets) can view it\n\nTo create the snippet under a team account, just append the team name\nto the URL (see `/2.0/snippets/{username}`).",
"responses": {
"201": {
"headers": {
"Location": {
"type": "string",
"description": "The URL of the newly created snippet."
}
},
"description": "The newly created snippet object.",
"schema": {
"$ref": "#/definitions/snippet"
}
},
"401": {
"description": "If the request was not authenticated",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"schema": {
"$ref": "#/definitions/snippet"
},
"required": true,
"description": "The new snippet object.",
"name": "_body",
"in": "body"
}
],
"tags": [
"snippets"
]
},
"parameters": [],
"get": {
"security": [
{
"oauth2": [
"snippet"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns all snippets. Like pull requests, repositories and teams, the\nfull set of snippets is defined by what the current user has access to.\n\nThis includes all snippets owned by the current user, but also all snippets\nowned by any of the teams the user is a member of, or snippets by other\nusers that the current user is either watching or has collaborated on (for\ninstance 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`: owned by the user, their teams, 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.",
"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"
}
}
},
"parameters": [
{
"enum": [
"owner",
"contributor",
"member"
],
"name": "role",
"required": false,
"in": "query",
"type": "string",
"description": "Filter down the result based on the authenticated user's role (`owner`, `contributor`, or `member`)."
}
],
"tags": [
"snippets"
]
}
},
"/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}": {
"put": {
"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.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "pull_request_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"pullrequest"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the specified pull request.",
"responses": {
"200": {
"description": "The pull request object",
"schema": {
"$ref": "#/definitions/pullrequest"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
}
},
"/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/comments": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "pull_request_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"pullrequest"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns all the pull request's comments.\n\nThis includes both global, inline comments and replies.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
}
},
"/account/{username}/addons/{encoded_context_id}": {
"put": {
"security": [
{
"oauth2": [
"account:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
},
"delete": {
"security": [
{
"oauth2": [
"account:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_context_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"account:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
}
},
"/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/decline": {
"post": {
"security": [
{
"oauth2": [
"pullrequest:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "pull_request_id",
"in": "path"
}
]
},
"/user/emails": {
"parameters": [],
"get": {
"security": [
{
"oauth2": [
"email"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns all the authenticated user's email addresses. Both\nconfirmed and unconfirmed.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"users"
]
}
},
"/repositories/{username}/{repo_slug}/pullrequests": {
"post": {
"security": [
{
"oauth2": [
"pullrequest:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Creates a new pull request.",
"responses": {
"201": {
"headers": {
"Location": {
"type": "string",
"description": "The URL of new newly created pull request."
}
},
"description": "The newly created pull request.",
"schema": {
"$ref": "#/definitions/pullrequest"
}
}
},
"parameters": [
{
"schema": {
"$ref": "#/definitions/pullrequest"
},
"required": false,
"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.",
"name": "_body",
"in": "body"
}
],
"tags": [
"pullrequests"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"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.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"enum": [
"MERGED",
"SUPERSEDED",
"OPEN",
"DECLINED"
],
"type": "string",
"description": "Only return pull requests that in this state. This parameter can be repeated.",
"name": "state",
"in": "query"
}
],
"tags": [
"pullrequests"
]
}
},
"/repositories/{username}/{repo_slug}/commits": {
"post": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Identical to `GET /repositories/{username}/{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.**",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"commits"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"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/{username}/{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/{username}/{repo_slug}/commits/master\n\nReturns all commits on rev `master` (similar to `git log master`,\n`hg log master`).\n\n## GET /repositories/{username}/{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/{username}/{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/{username}/{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\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 ca fit in a\nquery string, clients can use a `x-www-form-urlencoded` POST instead.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"commits"
]
}
},
"/repositories/{username}/{repo_slug}/commit/{sha}/comments": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "sha",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the commit's comments.\n\nThis includes both global and inline comments.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"commits"
]
}
},
"/repositories/{username}/{repo_slug}/commit/{revision}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "revision",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the specified commit.",
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The commit's SHA1.",
"name": "revision",
"in": "path"
}
],
"tags": [
"commits"
]
}
},
"/snippets/{username}": {
"post": {
"security": [
{
"oauth2": [
"snippet:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Identical to `/snippets`, except that the new snippet will be\ncreated under the account specified in the path parameter `{username}`.",
"responses": {
"201": {
"headers": {
"Location": {
"type": "string",
"description": "The URL of the newly created snippet."
}
},
"description": "The newly created snippet object.",
"schema": {
"$ref": "#/definitions/snippet"
}
},
"403": {
"description": "If the authenticated user does not have permission to create snippets under the specified account.",
"schema": {
"$ref": "#/definitions/error"
}
},
"401": {
"description": "If the request was not authenticated",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"schema": {
"$ref": "#/definitions/snippet"
},
"required": true,
"description": "The new snippet object.",
"name": "_body",
"in": "body"
}
],
"tags": [
"snippets"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"snippet"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Identical to `/snippets`, except that the result is further filtered\nby the snippet owner and only those that are owned by `{username}` are\nreturned.",
"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"
}
}
},
"parameters": [
{
"enum": [
"owner",
"contributor",
"member"
],
"name": "role",
"required": false,
"in": "query",
"type": "string",
"description": "Filter down the result based on the authenticated user's role (`owner`, `contributor`, or `member`)."
},
{
"required": true,
"type": "string",
"description": "Limits the result to snippets owned by this user.",
"name": "username",
"in": "path"
}
],
"tags": [
"snippets"
]
}
},
"/repositories/{username}/{repo_slug}/issues/{issue_id}/watch": {
"put": {
"security": [
{
"oauth2": [
"issue",
"account:write"
]
},
{
"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.",
"responses": {
"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"
}
},
"204": {
"description": "Indicates that the authenticated user successfully started watching this issue.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "integer",
"description": "The issue's id",
"name": "issue_id",
"in": "path"
}
],
"tags": [
"issue_tracker"
]
},
"delete": {
"security": [
{
"oauth2": [
"issue:write",
"account:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Stop watching this issue.",
"responses": {
"401": {
"description": "When the request wasn't authenticated.",
"schema": {
"$ref": "#/definitions/error"
}
},
"404": {
"description": "If the issue or the repo does not exist, or the repository does not have an issue tracker.",
"schema": {
"$ref": "#/definitions/error"
}
},
"204": {
"description": "Indicates that the authenticated user successfully stopped watching this issue.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "integer",
"description": "The issue's id",
"name": "issue_id",
"in": "path"
}
],
"tags": [
"issue_tracker"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "issue_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"issue",
"account"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Indicated whether or not the authenticated user is watching this\nissue.",
"responses": {
"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"
}
},
"204": {
"description": "If the authenticated user is watching this issue.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "integer",
"description": "The issue's id",
"name": "issue_id",
"in": "path"
}
],
"tags": [
"issue_tracker"
]
}
},
"/repositories/{username}/{repo_slug}/milestones/{milestone_id}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "milestone_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"issue"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the specified issue tracker milestone object.",
"responses": {
"200": {
"description": "The specified milestone object.",
"schema": {
"$ref": "#/definitions/milestone"
}
},
"404": {
"description": "If the specified repository or milestone does not exist, or if the repository doesn't have the issue tracker enabled.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "integer",
"description": "The milestone's id",
"name": "milestone_id",
"in": "path"
}
],
"tags": [
"issue_tracker"
]
}
},
"/teams": {
"parameters": [],
"get": {
"security": [
{
"oauth2": [
"team"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns all the teams that the authenticated user is associated\nwith.",
"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"
}
}
},
"parameters": [
{
"enum": [
"admin",
"contributor",
"member"
],
"name": "role",
"required": false,
"in": "query",
"type": "string",
"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"
}
],
"tags": [
"teams"
]
}
},
"/user": {
"parameters": [],
"get": {
"security": [
{
"oauth2": [
"account"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the currently logged in user.",
"responses": {
"200": {
"description": "The current user.",
"schema": {
"$ref": "#/definitions/user"
}
},
"401": {
"description": "When the request wasn't authenticated.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"users"
]
}
},
"/repositories/{username}/{repo_slug}/commits/{revision}": {
"post": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Identical to `GET /repositories/{username}/{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.**",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"commits"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "revision",
"in": "path"
}
],
"get": {
"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/{username}/{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/{username}/{repo_slug}/commits/master\n\nReturns all commits on rev `master` (similar to `git log master`,\n`hg log master`).\n\n## GET /repositories/{username}/{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/{username}/{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/{username}/{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\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 ca fit in a\nquery string, clients can use a `x-www-form-urlencoded` POST instead.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"commits"
]
}
},
"/snippets/{username}/{encoded_id}/comments": {
"post": {
"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`.",
"responses": {
"201": {
"headers": {
"Location": {
"type": "string",
"description": "The URL of the new comment"
}
},
"description": "The newly created comment.",
"schema": {
"$ref": "#/definitions/snippet"
}
},
"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"
}
}
},
"parameters": [
{
"schema": {
"$ref": "#/definitions/snippet"
},
"required": true,
"description": "The contents of the new comment.",
"name": "_body",
"in": "body"
}
],
"tags": [
"snippets"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_id",
"in": "path"
}
],
"get": {
"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.",
"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"
}
}
},
"parameters": [],
"tags": [
"snippets"
]
}
},
"/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/activity": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "pull_request_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"pullrequest"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the pull request's activity log. This includes comments that\nwere made by the reviewers, updates and approvals.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
}
},
"/repositories/{username}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns all repositories owned by the specified account.\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).",
"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"
}
}
},
"parameters": [
{
"enum": [
"admin",
"contributor",
"member",
"owner"
],
"name": "role",
"required": false,
"in": "query",
"type": "string",
"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"
}
],
"tags": [
"repositories"
]
}
},
"/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/merge": {
"post": {
"security": [
{
"oauth2": [
"pullrequest:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "pull_request_id",
"in": "path"
}
]
},
"/snippets/{username}/{encoded_id}/commits/": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"snippet"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"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"
}
}
},
"parameters": [],
"tags": [
"snippets"
]
}
},
"/snippets/{username}/{encoded_id}/{node_id}/patch": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_id",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "node_id",
"in": "path"
}
],
"get": {
"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.",
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The snippet id.",
"name": "encoded_id",
"in": "path"
}
],
"tags": [
"snippets"
]
}
},
"/teams/{username}/followers": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the list of accounts that are following this team.",
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The team's username",
"name": "username",
"in": "path"
}
],
"tags": [
"teams"
]
}
},
"/snippets/{username}/{encoded_id}/{node_id}/files/{path}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_id",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "node_id",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "path",
"in": "path"
}
],
"get": {
"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.",
"responses": {
"200": {
"headers": {
"Content-Type": {
"type": "string",
"description": "The mime type as derived from the filename"
},
"Content-Disposition": {
"type": "string",
"description": "attachment"
}
},
"description": "Returns the contents of the specified file."
},
"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"
}
}
},
"parameters": [],
"tags": [
"snippets"
]
}
},
"/addon/linkers/{linker_key}": {
"parameters": [
{
"required": true,
"type": "string",
"name": "linker_key",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
}
},
"/repositories/{username}/{repo_slug}/refs/tags": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"refs"
]
}
},
"/repositories/{username}/{repo_slug}/commit/{node}/approve": {
"post": {
"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.",
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The commit's SHA1.",
"name": "node",
"in": "path"
}
],
"tags": [
"commits"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "node",
"in": "path"
}
],
"delete": {
"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.",
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The commit's SHA1.",
"name": "node",
"in": "path"
}
],
"tags": [
"commits"
]
}
},
"/account/{username}/addons": {
"post": {
"security": [
{
"oauth2": [
"account:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"account:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
}
},
"/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/commits": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "pull_request_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"pullrequest"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the pull request's commits.\n\nThese are the commits that are being merged into the destination\nbranch when the pull requests gets accepted.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
}
},
"/snippets/{username}/{encoded_id}/watchers": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_id",
"in": "path"
}
],
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The snippet id.",
"name": "encoded_id",
"in": "path"
}
],
"tags": [
"snippets"
],
"deprecated": true,
"security": [
{
"oauth2": [
"snippet"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns a paginated list of all users watching a specific snippet."
}
},
"/repositories/{username}/{repo_slug}/branch-restrictions/{id}": {
"put": {
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"branch_restrictions"
]
},
"delete": {
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"branch_restrictions"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"branch_restrictions"
]
}
},
"/repositories/{username}/{repo_slug}/commit/{node}/statuses/build": {
"post": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": []
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "node",
"in": "path"
}
]
},
"/repositories/{username}/{repo_slug}": {
"post": {
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Creates a new repository.",
"responses": {
"200": {
"description": "The newly created repository.",
"schema": {
"$ref": "#/definitions/repository"
}
},
"401": {
"description": "If the request was not authenticated.",
"schema": {
"$ref": "#/definitions/error"
}
},
"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"
}
}
},
"parameters": [
{
"schema": {
"$ref": "#/definitions/repository"
},
"required": false,
"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.",
"name": "_body",
"in": "body"
}
],
"tags": [
"repositories"
]
},
"delete": {
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Deletes the repository. This is an irreversible operation.\n\nThis does not affect its forks.",
"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"
}
}
},
"parameters": [],
"tags": [
"repositories"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns the object describing this repository.",
"responses": {
"200": {
"description": "The repository object.",
"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"
}
}
},
"parameters": [],
"tags": [
"repositories"
]
}
},
"/repositories/{username}/{repo_slug}/default-reviewers/{target_username}": {
"put": {
"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.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
},
"delete": {
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Removes a default reviewer from the repository.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "target_username",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"repository:admin"
]
},
{
"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.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
}
},
"/repositories/{username}/{repo_slug}/issues/{issue_id}/comments": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "issue_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"issue"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns all comments that were made on the specified issue.",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"issue_tracker"
]
}
},
"/snippets/{username}/{encoded_id}/{node_id}": {
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The snippet's id.",
"name": "encoded_id",
"in": "path"
},
{
"required": true,
"type": "string",
"description": "A commit revision (SHA1).",
"name": "node_id",
"in": "path"
}
],
"tags": [
"snippets"
],
"produces": [
"application/json",
"multipart/related",
"multipart/form-data"
],
"security": [
{
"oauth2": [
"snippet:write"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"consumes": [
"application/json",
"multipart/related",
"multipart/form-data"
],
"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."
},
"delete": {
"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.",
"responses": {
"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"
}
},
"204": {
"description": "If the snippet was deleted successfully."
},
"405": {
"description": "If `{node_id}` is not the latest revision.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The snippet's id.",
"name": "encoded_id",
"in": "path"
}
],
"tags": [
"snippets"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "encoded_id",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "node_id",
"in": "path"
}
],
"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"
}
}
},
"parameters": [
{
"required": true,
"type": "string",
"description": "The snippet's id.",
"name": "encoded_id",
"in": "path"
},
{
"required": true,
"type": "string",
"description": "A commit revision (SHA1).",
"name": "node_id",
"in": "path"
}
],
"produces": [
"application/json",
"multipart/related",
"multipart/form-data"
],
"tags": [
"snippets"
],
"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."
}
},
"/repositories/{username}/{repo_slug}/pullrequests/{pull_request_id}/patch": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "repo_slug",
"in": "path"
},
{
"required": true,
"type": "string",
"name": "pull_request_id",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"pullrequest"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"pullrequests"
]
}
},
"/addon/linkers/{linker_key}/values/": {
"delete": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
},
"parameters": [
{
"required": true,
"type": "string",
"name": "linker_key",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": []
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "",
"responses": {
"default": {
"description": "Unexpected error.",
"schema": {
"$ref": "#/definitions/error"
}
}
},
"parameters": [],
"tags": [
"addon"
]
}
},
"/repositories": {
"parameters": [],
"get": {
"security": [
{
"oauth2": [
"repository"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "Returns all public repositories.",
"responses": {
"200": {
"description": "All public repositories.",
"schema": {
"$ref": "#/definitions/paginated_repositories"
}
}
},
"parameters": [],
"tags": [
"repositories"
]
}
},
"/teams/{username}/members": {
"parameters": [
{
"required": true,
"type": "string",
"name": "username",
"in": "path"
}
],
"get": {
"security": [
{
"oauth2": [
"account"
]
},
{
"basic": []
},
{
"api_key": []
}
],
"description": "All members of a team.\n\nReturns 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\nNote that members using the \"private profile\" feature are not included.",
"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"
}
}
},
"parameters": [],
"tags": [
"teams"
]
}
}
},
"schemes": [
"https"
],
"tags": [
{
"name": "users",
"description": ""
},
{
"name": "teams",
"description": ""
},
{
"name": "repositories",
"description": ""
},
{
"name": "refs",
"description": ""
},
{
"name": "commits",
"description": ""
},
{
"name": "pullrequests",
"description": ""
},
{
"name": "issue_tracker",
"description": "The issues resource provides 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"
}
],
"basePath": "/2.0",
"produces": [
"application/json"
],
"securityDefinitions": {
"oauth2": {
"scopes": {
"wiki": "Read and write to your repositories' wikis",
"snippet": "Read your snippets",
"account": "Read your account information",
"repository:admin": "Administer your repositories",
"repository": "Read your repositories",
"snippet:write": "Read and write to your snippets",
"issue:write": "Read and write to your repositories' issues",
"pullrequest": "Read your repositories and their pull requests",
"webhook": "Read and write to your repositories' webhooks",
"pullrequest:write": "Read and write to your repositories and their pull requests",
"project": "Read your team's projects",
"project:write": "Read and write to your team's projects and move repositories between them",
"team": "Read your team membership information",
"repository:write": "Read and write to your repositories",
"team:write": "Read and write to your team membership information",
"account:write": "Read and write to your account information",
"issue": "Read your repositories' issues",
"email": "Read your account's primary email address"
},
"tokenUrl": "http://dev.bitbucket.org:8000/site/oauth2/access_token",
"description": "OAuth 2 as per [RFC-6749](https://tools.ietf.org/html/rfc6749).",
"flow": "accessCode",
"type": "oauth2",
"authorizationUrl": "http://dev.bitbucket.org:8000/site/oauth2/authorize"
},
"api_key": {
"in": "header",
"type": "apiKey",
"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.",
"name": "Authorization"
},
"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."
}
},
"x-revision": "dev-1452122794",
"host": "api.dev.bitbucket.org:8000",
"definitions": {
"paginated_repositories": {
"allOf": [
{
"$ref": "#/definitions/page"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of repositories.",
"properties": {
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/repository"
},
"uniqueItems": true,
"type": "array"
}
}
}
]
},
"subject_types": {
"additionalProperties": false,
"type": "object",
"description": "The mapping of resource/subject types pointing to their individual event types.",
"properties": {
"user": {
"additionalProperties": false,
"type": "object",
"properties": {
"events": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
},
"repository": {
"additionalProperties": false,
"type": "object",
"properties": {
"events": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
},
"team": {
"additionalProperties": false,
"type": "object",
"properties": {
"events": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
},
"paginated_hook_events": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of webhook types available to subscribe on.",
"properties": {
"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"
},
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/hook_event"
},
"uniqueItems": true,
"type": "array"
},
"pagelen": {
"minimum": 1,
"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."
},
"size": {
"minimum": 0,
"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."
},
"page": {
"minimum": 1,
"type": "integer",
"description": "Page number of the current results. This is an optional element that is not provided in all responses."
},
"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"
}
}
}
]
},
"base_commit": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "The common base type for both repository and snippet commits.",
"properties": {
"date": {
"type": "string",
"format": "date-time"
},
"parents": {
"minItems": 0,
"items": {
"$ref": "#/definitions/base_commit"
},
"type": "array"
},
"message": {
"type": "string"
},
"hash": {
"pattern": "[0-9a-f]{7,}?",
"type": "string"
},
"author": {
"$ref": "#/definitions/account"
}
}
}
]
},
"error": {
"additionalProperties": false,
"type": "object",
"properties": {
"error": {
"additionalProperties": false,
"required": [
"message"
],
"type": "object",
"properties": {
"message": {
"type": "string"
},
"detail": {
"type": "string"
}
}
}
}
},
"participant": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "Object describing a user's role on resources like commits or pull requests.",
"properties": {
"role": {
"enum": [
"PARTICIPANT",
"REVIEWER"
],
"type": "string"
},
"user": {
"$ref": "#/definitions/user"
},
"approved": {
"type": "boolean"
}
}
}
]
},
"paginated_versions": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of issue tracker versions.",
"properties": {
"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"
},
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/version"
},
"uniqueItems": true,
"type": "array"
},
"pagelen": {
"minimum": 1,
"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."
},
"size": {
"minimum": 0,
"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."
},
"page": {
"minimum": 1,
"type": "integer",
"description": "Page number of the current results. This is an optional element that is not provided in all responses."
},
"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"
}
}
}
]
},
"paginated_users": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of users.",
"properties": {
"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"
},
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/user"
},
"uniqueItems": true,
"type": "array"
},
"pagelen": {
"minimum": 1,
"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."
},
"size": {
"minimum": 0,
"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."
},
"page": {
"minimum": 1,
"type": "integer",
"description": "Page number of the current results. This is an optional element that is not provided in all responses."
},
"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"
}
}
}
]
},
"snippet": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A snippet object.",
"properties": {
"scm": {
"enum": [
"hg",
"git"
],
"type": "string",
"description": "The DVCS used to store the snippet."
},
"title": {
"type": "string"
},
"creator": {
"$ref": "#/definitions/account"
},
"created_on": {
"type": "string",
"format": "date-time"
},
"owner": {
"$ref": "#/definitions/account"
},
"updated_on": {
"type": "string",
"format": "date-time"
},
"id": {
"minimum": 0,
"type": "integer"
},
"is_private": {
"type": "boolean"
}
}
}
]
},
"hook_event": {
"additionalProperties": false,
"type": "object",
"description": "An event, associated with a resource or subject type.",
"properties": {
"category": {
"type": "string",
"description": "The category this event belongs to."
},
"event": {
"enum": [
"pullrequest:updated",
"repo:commit_status_created",
"repo:fork",
"issue:comment_created",
"pullrequest:rejected",
"pullrequest:fulfilled",
"pullrequest:comment_created",
"pullrequest:comment_deleted",
"issue:created",
"repo:commit_comment_created",
"pullrequest:approved",
"repo:commit_status_updated",
"pullrequest:comment_updated",
"issue:updated",
"pullrequest:unapproved",
"pullrequest:created",
"repo:push"
],
"type": "string",
"description": "The event identifier."
},
"description": {
"type": "string",
"description": "More detailed description of the webhook event type."
},
"label": {
"type": "string",
"description": "Summary of the webhook event type."
}
}
},
"version": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A version as defined in a repository's issue tracker.",
"properties": {
"name": {
"type": "string"
},
"links": {
"additionalProperties": false,
"type": "object",
"properties": {
"self": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
},
"id": {
"type": "integer"
}
}
}
]
},
"issue": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "An issue.",
"properties": {
"content": {
"additionalProperties": false,
"type": "object",
"properties": {
"raw": {
"type": "string",
"description": "The text as it was typed by a user."
},
"markup": {
"enum": [
"markdown",
"creole"
],
"type": "string",
"description": "The type of markup language the content is to be interpreted in."
},
"html": {
"type": "string",
"description": "The user's markup rendered as HTML."
}
}
},
"kind": {
"enum": [
"bug",
"enhancement",
"proposal",
"task"
],
"type": "string"
},
"repository": {
"$ref": "#/definitions/repository"
},
"links": {
"additionalProperties": false,
"type": "object",
"properties": {
"attachments": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"self": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"watch": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"comments": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"html": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"vote": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
},
"title": {
"type": "string"
},
"reporter": {
"$ref": "#/definitions/user"
},
"component": {
"$ref": "#/definitions/component"
},
"votes": {
"type": "integer"
},
"priority": {
"enum": [
"trivial",
"minor",
"major",
"critical",
"blocker"
],
"type": "string"
},
"assignee": {
"$ref": "#/definitions/user"
},
"state": {
"enum": [
"new",
"open",
"resolved",
"on hold",
"invalid",
"duplicate",
"wontfix",
"closed"
],
"type": "string"
},
"version": {
"$ref": "#/definitions/version"
},
"edited_on": {
"type": "string",
"format": "date-time"
},
"created_on": {
"type": "string",
"format": "date-time"
},
"milestone": {
"$ref": "#/definitions/milestone"
},
"updated_on": {
"type": "string",
"format": "date-time"
},
"id": {
"type": "integer"
}
}
}
]
},
"webhook_subscription": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A Webhook subscription.",
"properties": {
"subject_type": {
"enum": [
"user",
"repository",
"team"
],
"type": "string",
"description": "The type of entity, which is `repository` in the case of webhook subscriptions on repositories."
},
"uuid": {
"type": "string",
"description": "The webhook's id"
},
"url": {
"type": "string",
"description": "The URL events get delivered to.",
"format": "uri"
},
"created_at": {
"type": "string",
"format": "date-time"
},
"description": {
"type": "string",
"description": "A user-defined description of the webhook."
},
"active": {
"type": "boolean"
},
"events": {
"minItems": 1,
"items": {
"enum": [
"pullrequest:updated",
"repo:commit_status_created",
"repo:fork",
"issue:comment_created",
"pullrequest:rejected",
"pullrequest:fulfilled",
"pullrequest:comment_created",
"pullrequest:comment_deleted",
"issue:created",
"repo:commit_comment_created",
"pullrequest:approved",
"repo:commit_status_updated",
"pullrequest:comment_updated",
"issue:updated",
"pullrequest:unapproved",
"pullrequest:created",
"repo:push"
],
"type": "string"
},
"uniqueItems": true,
"description": "The events this webhook is subscribed to.",
"type": "array"
},
"subject": {
"$ref": "#/definitions/object"
}
}
}
]
},
"repository": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A Bitbucket repository.",
"properties": {
"scm": {
"enum": [
"hg",
"git"
],
"type": "string"
},
"has_wiki": {
"type": "boolean"
},
"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."
},
"links": {
"additionalProperties": false,
"type": "object",
"properties": {
"watchers": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"commits": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"downloads": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"self": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"html": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"avatar": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"hooks": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"forks": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"clone": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"pullrequests": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
},
"fork_policy": {
"enum": [
"allow_forks",
"no_public_forks",
"no_forks"
],
"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"
},
"description": {
"type": "string"
},
"language": {
"type": "string"
},
"created_on": {
"type": "string",
"format": "date-time"
},
"parent": {
"$ref": "#/definitions/repository"
},
"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."
},
"has_issues": {
"type": "boolean"
},
"owner": {
"$ref": "#/definitions/account"
},
"updated_on": {
"type": "string",
"format": "date-time"
},
"size": {
"type": "integer"
},
"is_private": {
"type": "boolean"
},
"name": {
"type": "string"
}
}
}
]
},
"snippet_commit": {
"allOf": [
{
"$ref": "#/definitions/base_commit"
},
{
"additionalProperties": true,
"type": "object",
"description": "",
"properties": {
"snippet": {
"$ref": "#/definitions/snippet"
},
"links": {
"additionalProperties": false,
"type": "object",
"properties": {
"diff": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"self": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"html": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}
]
},
"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`.",
"required": [
"type"
],
"additionalProperties": true,
"discriminator": "type",
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"component": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A component as defined in a repository's issue tracker.",
"properties": {
"name": {
"type": "string"
},
"links": {
"additionalProperties": false,
"type": "object",
"properties": {
"self": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
},
"id": {
"type": "integer"
}
}
}
]
},
"paginated_issues": {
"allOf": [
{
"$ref": "#/definitions/page"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of issues.",
"properties": {
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/issue"
},
"uniqueItems": true,
"type": "array"
}
}
}
]
},
"user": {
"allOf": [
{
"$ref": "#/definitions/account"
},
{
"additionalProperties": true,
"type": "object",
"description": "A user object.",
"properties": {}
}
]
},
"milestone": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A milestone as defined in a repository's issue tracker.",
"properties": {
"name": {
"type": "string"
},
"links": {
"additionalProperties": false,
"type": "object",
"properties": {
"self": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
},
"id": {
"type": "integer"
}
}
}
]
},
"paginated_issue_attachments": {
"allOf": [
{
"$ref": "#/definitions/page"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of issue attachments.",
"properties": {
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/issue_attachment"
},
"type": "array"
}
}
}
]
},
"paginated_webhook_subscriptions": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of webhook subscriptions",
"properties": {
"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"
},
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/webhook_subscription"
},
"uniqueItems": true,
"type": "array"
},
"pagelen": {
"minimum": 1,
"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."
},
"size": {
"minimum": 0,
"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."
},
"page": {
"minimum": 1,
"type": "integer",
"description": "Page number of the current results. This is an optional element that is not provided in all responses."
},
"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"
}
}
}
]
},
"snippet_comment": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A comment on a snippet.",
"properties": {
"snippet": {
"$ref": "#/definitions/snippet"
},
"links": {
"additionalProperties": false,
"type": "object",
"properties": {
"self": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"html": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}
]
},
"paginated_milestones": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of issue tracker milestones.",
"properties": {
"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"
},
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/milestone"
},
"uniqueItems": true,
"type": "array"
},
"pagelen": {
"minimum": 1,
"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."
},
"size": {
"minimum": 0,
"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."
},
"page": {
"minimum": 1,
"type": "integer",
"description": "Page number of the current results. This is an optional element that is not provided in all responses."
},
"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"
}
}
}
]
},
"paginated_components": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of issue tracker components.",
"properties": {
"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"
},
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/component"
},
"uniqueItems": true,
"type": "array"
},
"pagelen": {
"minimum": 1,
"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."
},
"size": {
"minimum": 0,
"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."
},
"page": {
"minimum": 1,
"type": "integer",
"description": "Page number of the current results. This is an optional element that is not provided in all responses."
},
"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"
}
}
}
]
},
"account": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "An account object.",
"properties": {
"username": {
"pattern": "^[a-zA-Z0-9_\\-]+$",
"type": "string"
},
"website": {
"type": "string"
},
"display_name": {
"type": "string"
},
"uuid": {
"type": "string"
},
"links": {
"additionalProperties": false,
"type": "object",
"properties": {
"self": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"repositories": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"html": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"followers": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"avatar": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"following": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
},
"created_on": {
"type": "string",
"format": "date-time"
}
}
}
]
},
"issue_attachment": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "An issue file attachment's meta data. Note this does not contain the file's actual contents.",
"properties": {
"name": {
"type": "string"
},
"links": {
"additionalProperties": false,
"type": "object",
"properties": {
"self": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}
]
},
"paginated_snippet_commit": {
"allOf": [
{
"$ref": "#/definitions/page"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of snippet commits.",
"properties": {
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/snippet_commit"
},
"type": "array"
}
}
}
]
},
"pullrequest": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A pull request object.",
"properties": {
"state": {
"enum": [
"MERGED",
"SUPERSEDED",
"OPEN",
"DECLINED"
],
"type": "string"
},
"author": {
"$ref": "#/definitions/account"
},
"id": {
"type": "integer"
},
"links": {
"additionalProperties": false,
"type": "object",
"properties": {
"decline": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"commits": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"self": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"comments": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"merge": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"html": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"activity": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"diff": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"approve": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
},
"title": {
"type": "string"
}
}
}
]
},
"paginated_teams": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of teams.",
"properties": {
"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"
},
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/team"
},
"uniqueItems": true,
"type": "array"
},
"pagelen": {
"minimum": 1,
"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."
},
"size": {
"minimum": 0,
"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."
},
"page": {
"minimum": 1,
"type": "integer",
"description": "Page number of the current results. This is an optional element that is not provided in all responses."
},
"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"
}
}
}
]
},
"paginated_snippet_comments": {
"allOf": [
{
"$ref": "#/definitions/page"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of snippet comments.",
"properties": {
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/snippet_comment"
},
"uniqueItems": true,
"type": "array"
}
}
}
]
},
"team": {
"allOf": [
{
"$ref": "#/definitions/account"
},
{
"additionalProperties": true,
"type": "object",
"description": "A team object.",
"properties": {}
}
]
},
"commit": {
"allOf": [
{
"$ref": "#/definitions/base_commit"
},
{
"additionalProperties": true,
"type": "object",
"description": "A repository commit object.",
"properties": {
"participants": {
"minItems": 0,
"items": {
"$ref": "#/definitions/participant"
},
"type": "array"
},
"repository": {
"$ref": "#/definitions/repository"
},
"links": {
"additionalProperties": false,
"type": "object",
"properties": {
"self": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"comments": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"patch": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"html": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"diff": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
},
"approve": {
"additionalProperties": false,
"type": "object",
"properties": {
"href": {
"type": "string",
"format": "uri"
}
}
}
}
}
}
}
]
},
"paginated_snippets": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"type": "object",
"description": "A paginated list of snippets.",
"properties": {
"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"
},
"values": {
"minItems": 0,
"items": {
"$ref": "#/definitions/snippet"
},
"uniqueItems": true,
"type": "array"
},
"pagelen": {
"minimum": 1,
"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."
},
"size": {
"minimum": 0,
"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."
},
"page": {
"minimum": 1,
"type": "integer",
"description": "Page number of the current results. This is an optional element that is not provided in all responses."
},
"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"
}
}
}
]
},
"page": {
"allOf": [
{
"$ref": "#/definitions/object"
},
{
"additionalProperties": true,
"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": {
"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"
},
"pagelen": {
"minimum": 1,
"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",
"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"
},
"page": {
"minimum": 1,
"type": "integer",
"description": "Page number of the current results. This is an optional element that is not provided in all responses."
},
"size": {
"minimum": 0,
"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."
}
}
}
]
}
},
"swagger": "2.0",
"consumes": [
"application/json"
]
}