{
"opencollection": "1.0.0",
"info": {
"name": "Atlassian Admin Account Source - Repositories API",
"version": "1.0.0"
},
"request": {
"auth": {
"type": "bearer",
"token": "{{bearerToken}}"
}
},
"items": [
{
"info": {
"name": "Source - Repositories",
"type": "folder"
},
"items": [
{
"info": {
"name": "Atlassian List Commits That Modified A File",
"type": "http"
},
"http": {
"method": "GET",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/filehistory/:commit/:path",
"params": [
{
"name": "commit",
"value": "",
"type": "path",
"description": "The commit's SHA1."
},
{
"name": "path",
"value": "",
"type": "path",
"description": "Path to the file."
},
{
"name": "repo_slug",
"value": "",
"type": "path",
"description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n"
},
{
"name": "workspace",
"value": "",
"type": "path",
"description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n"
},
{
"name": "renames",
"value": "",
"type": "query",
"description": "\nWhen `true`, Bitbucket will follow the history of the file across\nrenames (this is the default behavior). This can be turned off by\nspecifying `false`."
},
{
"name": "q",
"value": "",
"type": "query",
"description": "\nQuery string to narrow down the response as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)."
},
{
"name": "sort",
"value": "",
"type": "query",
"description": "\nName of a response property sort the result by as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#sorting-query-results).\n"
}
],
"auth": {
"type": "oauth2",
"flow": "authorization_code",
"authorizationUrl": "https://auth.atlassian.com/authorize",
"accessTokenUrl": "https://auth.atlassian.com/oauth/token",
"credentials": {
"clientId": "{{clientId}}",
"clientSecret": "{{clientSecret}}"
}
}
},
"docs": "Returns a paginated list of commits that modified the specified file.
Commits are returned in reverse chronological order. This is roughly
equivalent to the following commands:
$ git log --follow --date-order
By default, Bitbucket will follow renames and the path name in the
returned entries reflects that. This can be turned off using the
`?renames=false` query parameter.
Results are returned in descending chronological order by default, and
like mos"
},
{
"info": {
"name": "Atlassian Get The Root Directory Of The Main Branch",
"type": "http"
},
"http": {
"method": "GET",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/src",
"params": [
{
"name": "repo_slug",
"value": "",
"type": "path",
"description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n"
},
{
"name": "workspace",
"value": "",
"type": "path",
"description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n"
},
{
"name": "format",
"value": "",
"type": "query",
"description": "Instead of returning the file's contents, return the (json) meta data for it."
}
],
"auth": {
"type": "oauth2",
"flow": "authorization_code",
"authorizationUrl": "https://auth.atlassian.com/authorize",
"accessTokenUrl": "https://auth.atlassian.com/oauth/token",
"credentials": {
"clientId": "{{clientId}}",
"clientSecret": "{{clientSecret}}"
}
}
},
"docs": "This endpoint redirects the client to the directory listing of the
root directory on the main branch.
This is equivalent to directly hitting
[/2.0/repositories/{username}/{repo_slug}/src/{commit}/{path}](src/%7Bcommit%7D/%7Bpath%7D)
without having to know the name or SHA1 of the repo's main branch.
To create new commits, [POST to this endpoint](#post)"
},
{
"info": {
"name": "Atlassian Create A Commit By Uploading A File",
"type": "http"
},
"http": {
"method": "POST",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/src",
"params": [
{
"name": "repo_slug",
"value": "",
"type": "path",
"description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n"
},
{
"name": "workspace",
"value": "",
"type": "path",
"description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n"
},
{
"name": "message",
"value": "",
"type": "query",
"description": "The commit message. When omitted, Bitbucket uses a canned string."
},
{
"name": "author",
"value": "",
"type": "query",
"description": "\nThe raw string to be used as the new commit's author.\nThis string follows the format\n`Erik van Zijst `.\n\nWhen omitted, Bitbucket uses the authenticated user's\nfull/display name and primary email address. Commits cannot\nbe created anonymously."
},
{
"name": "parents",
"value": "",
"type": "query",
"description": "\nA comma-separated list of SHA1s of the commits that should\nbe the parents of the newly created commit.\n\nWhen omitted, the new commit will inherit from and become\na child of the main branch's tip/HEAD commit.\n\nWhen more than one SHA1 is provided, the first SHA1\nidentifies the commit from which the content will be\ninherited.\"."
},
{
"name": "files",
"value": "",
"type": "query",
"description": "\nOptional field that declares the files that the request is\nmanipulating. When adding a new file to a repo, or when\noverwriting an existing file, the client can just upload\nthe full contents of the file in a normal form field and\nthe use of this `files` meta data field is redundant.\nHowever, when the `files` field contains a file path that\ndoes not have a corresponding, identically-named form\nfield, then Bitbucket interprets that as the client wanting\nto replace the named file with the null set and the file is\ndeleted instead.\n\nPaths in the repo that are referenced in neither files nor\nan individual file field, remain unchanged and carry over\nfrom the parent to the new commit.\n\nThis API does not support renaming as an explicit feature.\nTo rename a file, simply delete it and recreate it under\nthe new name in the same commit.\n"
},
{
"name": "branch",
"value": "",
"type": "query",
"description": "\nThe name of the branch that the new commit should be\ncreated on. When omitted, the commit will be created on top\nof the main branch and will become the main branch's new\nhead.\n\nWhen a branch name is provided that already exists in the\nrepo, then the commit will be created on top of that\nbranch. In this case, *if* a parent SHA1 was also provided,\nthen it is asserted that the parent is the branch's\ntip/HEAD at the time the request is made. When this is not\nthe case, a 409 is returned.\n\nWhen a new branch name is specified (that does not already\nexist in the repo), and no parent SHA1s are provided, then\nthe new commit will inherit from the current main branch's\ntip/HEAD commit, but not advance the main branch. The new\ncommit will be the new branch. When the request *also*\nspecifies a parent SHA1, then the new commit and branch\nare created directly on top of the parent commit,\nregardless of the state of the main branch.\n\nWhen a branch name is not specified, but a parent SHA1 is\nprovided, then Bitbucket asserts that it represents the\nmain branch's current HEAD/tip, or a 409 is returned.\n\nWhen a branch name is not specified and the repo is empty,\nthe new commit will become the repo's root commit and will\nbe on the main branch.\n\nWhen a branch name is specified and the repo is empty, the\nnew commit will become the repo's root commit and also\ndefine the repo's main branch going forward.\n\nThis API cannot be used to create additional root commits\nin non-empty repos.\n\nThe branch field cannot be repeated.\n\nAs a side effect, this API can be used to create a new\nbranch without modifying any files, by specifying a new\nbranch name in this field, together with `parents`, but\nomitting the `files` fields, while not sending any files.\nThis will create a new commit and branch with the same\ncontents as the first parent. The diff of this commit\nagainst its first parent will be empty.\n"
}
],
"auth": {
"type": "oauth2",
"flow": "authorization_code",
"authorizationUrl": "https://auth.atlassian.com/authorize",
"accessTokenUrl": "https://auth.atlassian.com/oauth/token",
"credentials": {
"clientId": "{{clientId}}",
"clientSecret": "{{clientSecret}}"
}
}
},
"docs": "This endpoint is used to create new commits in the repository by
uploading files.
To add a new file to a repository:
```
$ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \\
-F /repo/path/to/image.png=@image.png
```
This will create a new commit on top of the main branch, inheriting the
contents of the main branch, but adding (or overwriting) the
`image.png` file to the repository in the `/repo/path/to` directory.
To create a commi"
},
{
"info": {
"name": "Atlassian Get File Or Directory Contents",
"type": "http"
},
"http": {
"method": "GET",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/src/:commit/:path",
"params": [
{
"name": "commit",
"value": "",
"type": "path",
"description": "The commit's SHA1."
},
{
"name": "path",
"value": "",
"type": "path",
"description": "Path to the file."
},
{
"name": "repo_slug",
"value": "",
"type": "path",
"description": "This can either be the repository slug or the UUID of the repository,\nsurrounded by curly-braces, for example: `{repository UUID}`.\n"
},
{
"name": "workspace",
"value": "",
"type": "path",
"description": "This can either be the workspace ID (slug) or the workspace UUID\nsurrounded by curly-braces, for example: `{workspace UUID}`.\n"
},
{
"name": "format",
"value": "",
"type": "query",
"description": "If 'meta' is provided, returns the (json) meta data for the contents of the file. If 'rendered' is provided, returns the contents of a non-binary file in HTML-formatted rendered markup. The 'rendered' option only supports these filetypes: `.md`, `.markdown`, `.mkd`, `.mkdn`, `.mdown`, `.text`, `.rst`, and `.textile`. Since Git does not generally track what text encoding scheme is used, this endpoint attempts to detect the most appropriate character encoding. While usually correct, determining the character encoding can be ambiguous which in exceptional cases can lead to misinterpretation of the characters. As such, the raw element in the response object should not be treated as equivalent to the file's actual contents."
},
{
"name": "q",
"value": "",
"type": "query",
"description": "Optional filter expression as per [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)."
},
{
"name": "sort",
"value": "",
"type": "query",
"description": "Optional sorting parameter as per [filtering and sorting](/cloud/bitbucket/rest/intro/#sorting-query-results)."
},
{
"name": "max_depth",
"value": "",
"type": "query",
"description": "If provided, returns the contents of the repository and its subdirectories recursively until the specified max_depth of nested directories. When omitted, this defaults to 1."
}
],
"auth": {
"type": "oauth2",
"flow": "authorization_code",
"authorizationUrl": "https://auth.atlassian.com/authorize",
"accessTokenUrl": "https://auth.atlassian.com/oauth/token",
"credentials": {
"clientId": "{{clientId}}",
"clientSecret": "{{clientSecret}}"
}
}
},
"docs": "This endpoints is used to retrieve the contents of a single file,
or the contents of a directory at a specified revision.
#### Raw file contents
When `path` points to a file, this endpoint returns the raw contents.
The response's Content-Type is derived from the filename
extension (not from the contents). The file contents are not processed
and no character encoding/recoding is performed and as a result no
character encoding is included as part of the Content-Type.