Retrieve an application property value stored against a commit.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe value of the property.
An application property. It is a caller defined JSON object that Bitbucket will store and return.
The _attributes
field at its top level can be used to control who is allowed to read and update the property.
The keys of the JSON object must match an allowed pattern. For details,
see Application properties.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
1
2
3
4
5
{
"_attributes": [
"public"
]
}
Update an application property value stored against a commit.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe application property to create or update.
array<string>
any
An empty response.
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"_attributes": [
"public"
]
}'
Delete an application property value stored against a commit.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredAn empty response.
1
2
3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>'
Retrieve an application property value stored against a repository.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe value of the property.
An application property. It is a caller defined JSON object that Bitbucket will store and return.
The _attributes
field at its top level can be used to control who is allowed to read and update the property.
The keys of the JSON object must match an allowed pattern. For details,
see Application properties.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
1
2
3
4
5
{
"_attributes": [
"public"
]
}
Update an application property value stored against a repository.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe application property to create or update.
array<string>
any
An empty response.
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"_attributes": [
"public"
]
}'
Delete an application property value stored against a repository.
string
Requiredstring
Requiredstring
Requiredstring
RequiredAn empty response.
1
2
3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>'
Retrieve an application property value stored against a pull request.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe value of the property.
An application property. It is a caller defined JSON object that Bitbucket will store and return.
The _attributes
field at its top level can be used to control who is allowed to read and update the property.
The keys of the JSON object must match an allowed pattern. For details,
see Application properties.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
1
2
3
4
5
{
"_attributes": [
"public"
]
}
Update an application property value stored against a pull request.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredThe application property to create or update.
array<string>
any
An empty response.
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"_attributes": [
"public"
]
}'
Delete an application property value stored against a pull request.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
RequiredAn empty response.
1
2
3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>'
Search for code in the repositories of the specified team.
Note that searches can match in the file's text (content_matches
),
the path (path_matches
), or both.
You can use the same syntax for the search query as in the UI.
E.g. to search for "foo" only within the repository "demo",
use the query parameter search_query=foo+repo:demo
.
Similar to other APIs, you can request more fields using a
fields
query parameter. E.g. to get some more information about
the repository of matched files, use the query parameter
search_query=foo&fields=%2Bvalues.file.commit.repository
(the %2B
is a URL-encoded +
).
Try fields=%2Bvalues.*.*.*.*
to get an idea what's possible.
repository
string
Requiredstring
Requiredinteger
integer
Successful search
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/teams/{username}/search/code?search_query={search_query}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
"size": 1,
"page": 1,
"pagelen": 10,
"query_substituted": false,
"values": [
{
"type": "code_search_result",
"content_match_count": 2,
"content_matches": [
{
"lines": [
{
"line": 2,
"segments": []
},
{
"line": 3,
"segments": [
{
"text": "def "
},
{
"text": "foo",
"match": true
},
{
"text": "():"
}
]
},
{
"line": 4,
"segments": [
{
"text": " print(\"snek\")"
}
]
},
{
"line": 5,
"segments": []
}
]
}
],
"path_matches": [
{
"text": "src/"
},
{
"text": "foo",
"match": true
},
{
"text": ".py"
}
],
"file": {
"path": "src/foo.py",
"type": "commit_file",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/my-workspace/demo/src/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b/src/foo.py"
}
}
}
}
]
}
Retrieve an application property value stored against a user.
string
Requiredstring
Requiredstring
RequiredThe value of the property.
An application property. It is a caller defined JSON object that Bitbucket will store and return.
The _attributes
field at its top level can be used to control who is allowed to read and update the property.
The keys of the JSON object must match an allowed pattern. For details,
see Application properties.
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/users/{selected_user}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
1
2
3
4
5
{
"_attributes": [
"public"
]
}
Update an application property value stored against a user.
string
Requiredstring
Requiredstring
RequiredThe application property to create or update.
array<string>
any
An empty response.
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'https://api.bitbucket.org/2.0/users/{selected_user}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Content-Type: application/json' \
--data '{
"_attributes": [
"public"
]
}'
Delete an application property value stored against a user.
string
Requiredstring
Requiredstring
RequiredAn empty response.
1
2
3
curl --request DELETE \
--url 'https://api.bitbucket.org/2.0/users/{selected_user}/properties/{app_key}/{property_name}' \
--header 'Authorization: Bearer <access_token>'
Search for code in the repositories of the specified user.
Note that searches can match in the file's text (content_matches
),
the path (path_matches
), or both.
You can use the same syntax for the search query as in the UI.
E.g. to search for "foo" only within the repository "demo",
use the query parameter search_query=foo+repo:demo
.
Similar to other APIs, you can request more fields using a
fields
query parameter. E.g. to get some more information about
the repository of matched files, use the query parameter
search_query=foo&fields=%2Bvalues.file.commit.repository
(the %2B
is a URL-encoded +
).
repository
string
Requiredstring
Requiredinteger
integer
Successful search
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/users/{selected_user}/search/code?search_query={search_query}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
"size": 1,
"page": 1,
"pagelen": 10,
"query_substituted": false,
"values": [
{
"type": "code_search_result",
"content_match_count": 2,
"content_matches": [
{
"lines": [
{
"line": 2,
"segments": []
},
{
"line": 3,
"segments": [
{
"text": "def "
},
{
"text": "foo",
"match": true
},
{
"text": "():"
}
]
},
{
"line": 4,
"segments": [
{
"text": " print(\"snek\")"
}
]
},
{
"line": 5,
"segments": []
}
]
}
],
"path_matches": [
{
"text": "src/"
},
{
"text": "foo",
"match": true
},
{
"text": ".py"
}
],
"file": {
"path": "src/foo.py",
"type": "commit_file",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/my-workspace/demo/src/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b/src/foo.py"
}
}
}
}
]
}
Search for code in the repositories of the specified workspace.
Note that searches can match in the file's text (content_matches
),
the path (path_matches
), or both.
You can use the same syntax for the search query as in the UI.
E.g. to search for "foo" only within the repository "demo",
use the query parameter search_query=foo+repo:demo
.
Similar to other APIs, you can request more fields using a
fields
query parameter. E.g. to get some more information about
the repository of matched files, use the query parameter
search_query=foo&fields=%2Bvalues.file.commit.repository
(the %2B
is a URL-encoded +
).
Try fields=%2Bvalues.*.*.*.*
to get an idea what's possible.
repository
read:repository:bitbucket
string
Requiredstring
Requiredinteger
integer
Successful search
1
2
3
4
curl --request GET \
--url 'https://api.bitbucket.org/2.0/workspaces/{workspace}/search/code?search_query={search_query}' \
--header 'Authorization: Bearer <access_token>' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
{
"size": 1,
"page": 1,
"pagelen": 10,
"query_substituted": false,
"values": [
{
"type": "code_search_result",
"content_match_count": 2,
"content_matches": [
{
"lines": [
{
"line": 2,
"segments": []
},
{
"line": 3,
"segments": [
{
"text": "def "
},
{
"text": "foo",
"match": true
},
{
"text": "():"
}
]
},
{
"line": 4,
"segments": [
{
"text": " print(\"snek\")"
}
]
},
{
"line": 5,
"segments": []
}
]
}
],
"path_matches": [
{
"text": "src/"
},
{
"text": "foo",
"match": true
},
{
"text": ".py"
}
],
"file": {
"path": "src/foo.py",
"type": "commit_file",
"links": {
"self": {
"href": "https://api.bitbucket.org/2.0/repositories/my-workspace/demo/src/ad6964b5fe2880dbd9ddcad1c89000f1dbcbc24b/src/foo.py"
}
}
}
}
]
}
Rate this page: