{
"opencollection": "1.0.0",
"info": {
"name": "Atlassian Admin Account Refs API",
"version": "1.0.0"
},
"request": {
"auth": {
"type": "bearer",
"token": "{{bearerToken}}"
}
},
"items": [
{
"info": {
"name": "Refs",
"type": "folder"
},
"items": [
{
"info": {
"name": "Atlassian List Branches And Tags",
"type": "http"
},
"http": {
"method": "GET",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/refs",
"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": "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": "\nField by which the results should be sorted as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering). The `name`\nfield is handled specially for refs in that, if specified as the sort field, it\nuses a natural sort order instead of the default lexicographical sort order. For example,\nit will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2']."
}
],
"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 the branches and tags in the repository.
By default, results will be in the order the underlying source control system returns them and identical to
the ordering one sees when running \"$ git show-ref\". Note that this follows simple
lexical ordering of the ref names.
This can be undesirable as it does apply any natural sorting semantics, meaning for instance that refs are
sorted [\"branch1\", \"branch10\", \"branch2\", \"v10\", \"v11\", \"v9\"] instead of [\"branch1\", \"branch2\","
},
{
"info": {
"name": "Atlassian List Open Branches",
"type": "http"
},
"http": {
"method": "GET",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/refs/branches",
"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": "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": "\nField by which the results should be sorted as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering). The `name`\nfield is handled specially for branches in that, if specified as the sort field, it\nuses a natural sort order instead of the default lexicographical sort order. For example,\nit will return ['branch1', 'branch2', 'branch10'] instead of ['branch1', 'branch10', 'branch2']."
}
],
"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 list of all open branches within the specified repository.
Results will be in the order the source control manager returns them.
Branches support [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering)
that can be used to search for specific branches. For instance, to find
all branches that have \"stab\" in their name:
```
curl -s https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches -G --data-urlencode 'q=name ~ \"stab\"'
```
By"
},
{
"info": {
"name": "Atlassian Create A Branch",
"type": "http"
},
"http": {
"method": "POST",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/refs/branches",
"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"
}
],
"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": "Creates a new branch in the specified repository.
The payload of the POST should consist of a JSON document that
contains the name of the tag and the target hash.
```
curl https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/branches \\
-s -u seanfarley -X POST -H \"Content-Type: application/json\" \\
-d '{
\"name\" : \"smf/create-feature\",
\"target\" : {
\"hash\" : \"default\",
}
}'
```
This call requires authentication. Private"
},
{
"info": {
"name": "Atlassian Get A Branch",
"type": "http"
},
"http": {
"method": "GET",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/refs/branches/:name",
"params": [
{
"name": "name",
"value": "",
"type": "path",
"description": "The name of the branch."
},
{
"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"
}
],
"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 branch object within the specified repository.
This call requires authentication. Private repositories require the
caller to authenticate with an account that has appropriate
authorization.
For Git, the branch name should not include any prefixes (e.g.
refs/heads)."
},
{
"info": {
"name": "Atlassian Delete A Branch",
"type": "http"
},
"http": {
"method": "DELETE",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/refs/branches/:name",
"params": [
{
"name": "name",
"value": "",
"type": "path",
"description": "The name of the branch."
},
{
"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"
}
],
"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": "Delete a branch in the specified repository.
The main branch is not allowed to be deleted and will return a 400
response.
The branch name should not include any prefixes (e.g.
refs/heads)."
},
{
"info": {
"name": "Atlassian List Tags",
"type": "http"
},
"http": {
"method": "GET",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/refs/tags",
"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": "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": "\nField by which the results should be sorted as per\n[filtering and sorting](/cloud/bitbucket/rest/intro/#filtering). The `name`\nfield is handled specially for tags in that, if specified as the sort field, it\nuses a natural sort order instead of the default lexicographical sort order. For example,\nit will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2']."
}
],
"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 the tags in the repository.
By default, results will be in the order the underlying source control system returns them and identical to
the ordering one sees when running \"$ git tag --list\". Note that this follows simple
lexical ordering of the ref names.
This can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are
sorted [\"v10\", \"v11\", \"v9\"] instead of [\"v9\", \"v10\", \"v11\"].
Sorting can be changed using the ?sort"
},
{
"info": {
"name": "Atlassian Create A Tag",
"type": "http"
},
"http": {
"method": "POST",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/refs/tags",
"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"
}
],
"body": {
"type": "json",
"data": "{}"
},
"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": "Creates a new tag in the specified repository.
The payload of the POST should consist of a JSON document that
contains the name of the tag and the target hash.
```
curl https://api.bitbucket.org/2.0/repositories/jdoe/myrepo/refs/tags \\
-s -u jdoe -X POST -H \"Content-Type: application/json\" \\
-d '{
\"name\" : \"new-tag-name\",
\"target\" : {
\"hash\" : \"a1b2c3d4e5f6\",
}
}'
```
This endpoint does support using short hash prefixes for t"
},
{
"info": {
"name": "Atlassian Get A Tag",
"type": "http"
},
"http": {
"method": "GET",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/refs/tags/:name",
"params": [
{
"name": "name",
"value": "",
"type": "path",
"description": "The name of the tag."
},
{
"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"
}
],
"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 the specified tag.
```
$ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8 -G | jq .
{
\"name\": \"3.8\",
\"links\": {
\"commits\": {
\"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commits/3.8\"
},
\"self\": {
\"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8\"
},
\"html\": {
\"href\": \"https://bitbucket.org/seanfarley/hg/commits/tag/3.8\"
"
},
{
"info": {
"name": "Atlassian Delete A Tag",
"type": "http"
},
"http": {
"method": "DELETE",
"url": "https://api.atlassian.com/repositories/:workspace/:repo_slug/refs/tags/:name",
"params": [
{
"name": "name",
"value": "",
"type": "path",
"description": "The name of the tag."
},
{
"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"
}
],
"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": "Delete a tag in the specified repository.
The tag name should not include any prefixes (e.g. refs/tags)."
}
]
}
],
"bundled": true
}