Dismisses the retention config review notification displayed by the audit plugin for the user that's currently logged in.
This request has no parameters.
A blank response
any
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/audit/latest/notification-settings/retention-config-review' \
--header 'Accept: application/json'
Retrieves the repository archive policy for the instance. The user must be authenticated to access this resource.
This request has no parameters.
A response containing the repository archive policy for the instance
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/policies/latest/admin/repos/archive' \
--header 'Accept: application/json'
1
2
3
{
"permission": "ADMIN"
}
Sets the repository archive policy for the instance.
The authenticated user must have SYS_ADMIN permission.
The request containing the details of the policy.
string
A response containing the repository archive policy for the instance
1
2
3
4
5
6
7
curl --request PUT \
--url 'http://{baseurl}/rest/policies/latest/admin/repos/archive' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"permission": "ADMIN"
}'
1
2
3
{
"permission": "ADMIN"
}
Retrieves the repository delete policy for the instance. The user must be authenticated to access this resource.
This request has no parameters.
A response containing the repository delete policy for the instance
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/policies/latest/admin/repos/delete' \
--header 'Accept: application/json'
1
2
3
{
"permission": "ADMIN"
}
Sets the repository delete policy for the instance.
The authenticated user must have SYS_ADMIN permission.
The request containing the details of the policy.
string
A response containing the repository delete policy for the instance
1
2
3
4
5
6
7
curl --request PUT \
--url 'http://{baseurl}/rest/policies/latest/admin/repos/delete' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"permission": "ADMIN"
}'
1
2
3
{
"permission": "ADMIN"
}
Gets the announcement banner, if one exists and is available to the user
This request has no parameters.
The requested banner
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/banner' \
--header 'Accept: application/json'
1
2
3
4
5
{
"enabled": true,
"message": "<string>",
"audience": "AUTHENTICATED"
}
Sets the announcement banner with the provided JSON. Only users authenticated as Admins may call this resource
string
Requiredboolean
string
The banner was set successfully
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/banner' \
--header 'Content-Type: application/json' \
--data '{
"audience": "AUTHENTICATED",
"enabled": true,
"message": "<string>"
}'
Deletes a banner, if one is present in the database.
This request has no parameters.
The query executed successfully, whether a banner was deleted or not
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/banner'
Gets information about the nodes that currently make up the stash cluster.
The authenticated user must have the SYS_ADMIN permission to call this resource.
This request has no parameters.
A response containing information about the cluster
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/cluster' \
--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
{
"running": true,
"nodes": [
{
"address": {
"address": "node.example.com",
"port": 8230
},
"name": "foo",
"id": "d4fde8b1-2504-4998-a0ba-14fbe98edd4d",
"local": true,
"buildVersion": "7.0.0"
}
],
"localNode": {
"address": {
"address": "node.example.com",
"port": 8230
},
"name": "foo",
"id": "d4fde8b1-2504-4998-a0ba-14fbe98edd4d",
"local": true,
"buildVersion": "7.0.0"
}
}
Retrieves the configured global default branch, which is used when creating new repositories if an explicit default branch is not specified. The user must be authenticated to call this resource.
This request has no parameters.
The configured global default branch.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/default-branch' \
--header 'Accept: application/json'
Configures the global default branch, which is used when creating new repositories if an explicit default branch is not specified.
The authenticated user must have ADMIN permission to call this resource.
string
The default branch has been set.
1
2
3
4
5
6
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/default-branch' \
--header 'Content-Type: application/json' \
--data '{
"id": "<string>"
}'
Clears the global default branch, which is used when creating new repositories if an explicit default branch is not specified, if one has been configured.
The authenticated user must have ADMIN permission to call this resource.
This request has no parameters.
The default branch has been cleared.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/default-branch'
Obtain the control plane PEM.
The authenticated user must have SYS_ADMIN permission.
This request has no parameters.
The control plane PEM.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/config/control-plane.pem' \
--header 'Accept: text/plain'
Generates a connectivity report between the Bitbucket node(s) and the Mesh node(s).
The authenticated user must have SYS_ADMIN permission.
This request has no parameters.
The connectivity report between the Bitbucket node(s) and Mesh node(s).
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/diagnostics/connectivity' \
--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
{
"reports": [
{
"node": {
"name": "My Node",
"id": "1",
"type": "BITBUCKET"
},
"summaries": [
{
"node": {
"name": "My Node",
"id": "1",
"type": "BITBUCKET"
},
"summary": {
"errorMessage": "Unable to connect to the node.",
"roundTripTime": 100,
"reachable": true
}
}
]
}
]
}
Get all the registered Mesh nodes.
The authenticated user must have SYS_ADMIN permission.
This request has no parameters.
The list of registered Mesh nodes.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"name": "My node",
"id": "1",
"state": "AVAILABLE",
"lastSeenDate": 1630041546433,
"offline": false,
"rpcId": "1",
"rpcUrl": "http://127.0.0.1:7999"
}
Register a new Mesh node.
The authenticated user must have SYS_ADMIN permission.
The request specifying the new Mesh node.
string
string
string
number
boolean
string
string
The newly registered Mesh node.
1
2
3
4
5
6
7
8
9
10
11
12
13
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "My node",
"id": "1",
"state": "AVAILABLE",
"lastSeenDate": 1630041546433,
"offline": false,
"rpcId": "1",
"rpcUrl": "http://127.0.0.1:7999"
}'
1
2
3
4
5
6
7
8
9
{
"name": "My node",
"id": "1",
"state": "AVAILABLE",
"lastSeenDate": 1630041546433,
"offline": false,
"rpcId": "1",
"rpcUrl": "http://127.0.0.1:7999"
}
Get the registered Mesh node that matches the supplied ID.
The authenticated user must have SYS_ADMIN permission.
string
RequiredThe Mesh node that matches the ID.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes/{id}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"name": "My node",
"id": "1",
"state": "AVAILABLE",
"lastSeenDate": 1630041546433,
"offline": false,
"rpcId": "1",
"rpcUrl": "http://127.0.0.1:7999"
}
Update a Mesh node.
The authenticated user must have SYS_ADMIN permission.
string
RequiredThe request specifying the updated Mesh node.
string
string
string
number
boolean
string
string
The updated Mesh node.
1
2
3
4
5
6
7
8
9
10
11
12
13
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes/{id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "My node",
"id": "1",
"state": "AVAILABLE",
"lastSeenDate": 1630041546433,
"offline": false,
"rpcId": "1",
"rpcUrl": "http://127.0.0.1:7999"
}'
1
2
3
4
5
6
7
8
9
{
"name": "My node",
"id": "1",
"state": "AVAILABLE",
"lastSeenDate": 1630041546433,
"offline": false,
"rpcId": "1",
"rpcUrl": "http://127.0.0.1:7999"
}
Get the support zips for all the Mesh nodes.
The authenticated user must have SYS_ADMIN permission.
This request has no parameters.
The support zips for all the Mesh nodes.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/support-zips' \
--header 'Accept: application/octet-stream'
Get the support zip for the Mesh node that matches the specified ID.
The authenticated user must have SYS_ADMIN permission.
string
RequiredThe support zip for the Mesh node that matches the ID.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/support-zips/{id}' \
--header 'Accept: application/octet-stream'
Retrieves details about the current license, as well as the current status of the system with regards to the installed license. The status includes the current number of users applied toward the license limit, as well as any status messages about the license (warnings about expiry or user counts exceeding license limits).
The authenticated user must have ADMIN permission. Unauthenticated users, and non-administrators, are not permitted to access license details.
This request has no parameters.
The currently-installed license.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/license' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"numberOfDaysBeforeExpiry": 2154,
"numberOfDaysBeforeGracePeriodExpiry": 2154,
"numberOfDaysBeforeMaintenanceExpiry": 2154,
"supportEntitlementNumber": "<support entitlement number embedded in license>",
"unlimitedNumberOfUsers": true,
"creationDate": 1331038800000,
"gracePeriodEndDate": 1372493732817,
"expiryDate": 1372493732817,
"daysBeforeExpiry": 2154,
"license": "<encoded license text>",
"maintenanceExpiryDate": 1372493732817,
"maximumNumberOfUsers": 12,
"purchaseDate": 1331038800000,
"status": {
"serverId": "<actual server ID>",
"currentNumberOfUsers": 2
},
"serverId": "<server ID embedded in license>"
}
Decodes the provided encoded license and sets it as the active license. If no license was provided, a 400 is returned. If the license cannot be decoded, or cannot be applied, a 409 is returned. Some possible reasons a license may not be applied include:
Otherwise, if the license is updated successfully, details for the new license are returned with a 200 response.
Warning: It is possible to downgrade the license during update, applying a license with a lower number of permitted users. If the number of currently-licensed users exceeds the limits of the new license, pushing will be disabled until the licensed user count is brought into compliance with the new license.
The authenticated user must have SYS_ADMIN permission. ADMIN users may view the current license details, but they may not update the license.
a JSON payload containing the encoded license to apply
string
The newly-installed license.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/license' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"license": "<encoded license text>"
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"numberOfDaysBeforeExpiry": 2154,
"numberOfDaysBeforeGracePeriodExpiry": 2154,
"numberOfDaysBeforeMaintenanceExpiry": 2154,
"supportEntitlementNumber": "<support entitlement number embedded in license>",
"unlimitedNumberOfUsers": true,
"creationDate": 1331038800000,
"gracePeriodEndDate": 1372493732817,
"expiryDate": 1372493732817,
"daysBeforeExpiry": 2154,
"license": "<encoded license text>",
"maintenanceExpiryDate": 1372493732817,
"maximumNumberOfUsers": 12,
"purchaseDate": 1331038800000,
"status": {
"serverId": "<actual server ID>",
"currentNumberOfUsers": 2
},
"serverId": "<server ID embedded in license>"
}
Retrieves the current mail configuration.
The authenticated user must have the SYS_ADMIN permission to call this resource.
This request has no parameters.
The mail configuration
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"protocol": "SMTP",
"port": 465,
"password": "password",
"username": "user",
"senderAddress": "stash-no-reply@company.com",
"hostname": "smtp.example.com",
"requireStartTls": true,
"useStartTls": true
}
Updates the mail configuration.
The authenticated user must have the SYS_ADMIN permission to call this resource.
string
string
integer
string
boolean
string
boolean
string
The updated mail configuration.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"hostname": "smtp.example.com",
"password": "password",
"port": 465,
"protocol": "SMTP",
"requireStartTls": true,
"senderAddress": "stash-no-reply@company.com",
"useStartTls": true,
"username": "user"
}'
1
2
3
4
5
6
7
8
9
10
{
"protocol": "SMTP",
"port": 465,
"password": "password",
"username": "user",
"senderAddress": "stash-no-reply@company.com",
"hostname": "smtp.example.com",
"requireStartTls": true,
"useStartTls": true
}
Deletes the current mail configuration.
The authenticated user must have the SYS_ADMIN permission to call this resource.
This request has no parameters.
The mail configuration was successfully deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server'
Retrieves the server email address
This request has no parameters.
The server email address
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server/sender-address' \
--header 'Accept: application/json'
Updates the server email address
The authenticated user must have the ADMIN permission to call this resource.
string
The from address used in notification emails
any
1
2
3
4
5
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server/sender-address' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '"<string>"'
Clears the server email address.
The authenticated user must have the ADMIN permission to call this resource.
This request has no parameters.
he server email address was successfully cleared.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server/sender-address'
Retrieves the recent rate limit history for the instance.
The authenticated user must have the ADMIN permission to call this resource.
string
number
number
A response containing a page of aggregated counters for users who have been recently rate limited.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/history' \
--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
{
"values": [
{
"user": {
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
},
"lastRejectTime": 1630041546433,
"rejectCount": 5
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Retrieves the rate limit settings for the instance. The user must be authenticated to call this resource.
This request has no parameters.
A response containing the rate limit plugin settings for the instance.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
{
"enabled": true,
"defaultSettings": {
"capacity": 60,
"fillRate": 5
}
}
Sets the rate limit settings for the instance.
The authenticated user must have ADMIN permission to call this resource.
Sets the rate limit settings for the instance.
The authenticated user must have ADMIN permission to call this resource.
boolean
object
A response containing the updated rate limit plugin settings for the instance.
1
2
3
4
5
6
7
8
9
10
11
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"enabled": true,
"defaultSettings": {
"capacity": 60,
"fillRate": 5
}
}'
1
2
3
4
5
6
7
{
"enabled": true,
"defaultSettings": {
"capacity": 60,
"fillRate": 5
}
}
Retrieves the user-specific rate limit settings for the given user.
The authenticated user must have ADMIN permission to call this resource.
string
number
number
A response containing all the user-specific rate limit settings filtered by the optional filter.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users' \
--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
{
"values": [
{
"settings": {
"capacity": 60,
"fillRate": 5
},
"user": {
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
},
"whitelisted": true
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Sets the given rate limit settings for the given users.
The authenticated user must have ADMIN permission to call this resource.
object
array<string>
boolean
A response containing the updated user settings.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"settings": {
"capacity": 60,
"fillRate": 5
},
"usernames": [
"<string>"
],
"whitelisted": true
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"settings": {
"capacity": 60,
"fillRate": 5
},
"user": {
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
},
"whitelisted": true
}
Retrieves the user-specific rate limit settings for the given user.
To call this resource, the user must be authenticated and either have ADMIN permission or be the same user as the one whose settings are requested. A user with ADMIN permission cannot get the settings of a user with SYS_ADMIN permission.
string
RequiredA response containing the user-specific rate limit settings for the given user.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users/{userSlug}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"settings": {
"capacity": 60,
"fillRate": 5
},
"user": {
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
},
"whitelisted": true
}
Sets the given rate limit settings for the given user.
The authenticated user must have ADMIN permission to call this resource.
string
Requiredobject
boolean
A response containing the updated user settings
1
2
3
4
5
6
7
8
9
10
11
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users/{userSlug}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"settings": {
"capacity": 60,
"fillRate": 5
},
"whitelisted": true
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"settings": {
"capacity": 60,
"fillRate": 5
},
"user": {
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
},
"whitelisted": true
}
Deletes the user-specific rate limit settings for the given user.
The authenticated user must have ADMIN permission to call this resource.
string
RequiredAn empty response indicating that the user settings have been deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users/{userSlug}'
Retrieve version information and other application properties. No authentication is required to call this resource.
This request has no parameters.
The application properties
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/application-properties' \
--header 'Accept: application/json'
1
2
3
4
5
6
{
"displayName": "Example.com Bitbucket",
"version": "2.1.0",
"buildNumber": "20220123103656677",
"buildDate": "1358897885952000"
}
Create a new hook script.
This endpoint requires SYS_ADMIN permission.
The multipart form data containing the hook script
string
string
string
string
The newly created hook script.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/hook-scripts' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"name": "<string>",
"id": 2154,
"type": "POST",
"version": 2154,
"createdDate": "<string>",
"pluginKey": "<string>",
"description": "<string>",
"updatedDate": "<string>"
}
Retrieves a hook script by ID.
string
RequiredThe hook script.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"name": "<string>",
"id": 2154,
"type": "POST",
"version": 2154,
"createdDate": "<string>",
"pluginKey": "<string>",
"description": "<string>",
"updatedDate": "<string>"
}
Updates a hook script.
This endpoint requires SYS_ADMIN permission.
string
RequiredThe multipart form data containing the hook script
string
string
string
The updated hook script.
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"name": "<string>",
"id": 2154,
"type": "POST",
"version": 2154,
"createdDate": "<string>",
"pluginKey": "<string>",
"description": "<string>",
"updatedDate": "<string>"
}
Deletes a registered hook script.
This endpoint requires SYS_ADMIN permission.
string
RequiredThe hook script was deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}'
Retrieves the hook script content.
This endpoint requires SYS_ADMIN permission.
string
RequiredThe hook script content.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}/content' \
--header 'Accept: application/json'
Returns a paged response of all the labels in the system. The user needs to be authenticated to use this resource.
string
number
number
Page of returned labels.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/labels' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
{
"values": [
{
"name": "labelName"
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Returns a label. The user needs to be authenticated to use this resource.
string
RequiredThe label.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/labels/{labelName}' \
--header 'Accept: application/json'
1
2
3
{
"name": "labelName"
}
Returns a page of labelables for a given label. Only labelables that the authenticated user has view access to will be returned.
string
Requiredstring
number
number
The page of labelables.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/labels/{labelName}/labeled' \
--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
{
"values": [
{
"labelableType": "REPOSITORY",
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Retrieve the current log level for a given logger.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe log level of the logger.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/logs/logger/{loggerName}' \
--header 'Accept: application/json'
1
2
3
{
"logLevel": "DEBUG"
}
Set the current log level for a given logger.
The authenticated user must have ADMIN permission or higher to call this resource.
string
Requiredstring
RequiredThe log level was successfully changed.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/logs/logger/{loggerName}/{levelName}'
Retrieve the current log level for the root logger.
The authenticated user must have ADMIN permission or higher to call this resource.
This request has no parameters.
The log level of the logger.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/logs/rootLogger' \
--header 'Accept: application/json'
1
2
3
{
"logLevel": "DEBUG"
}
Set the current log level for the root logger.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe log level was successfully changed.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/logs/rootLogger/{levelName}'
Starts a background job that exports the selected repositories.
Only 2 concurrent exports are supported per cluster node. If a request ends up on a node that is already running that many export jobs, the request will be rejected and an error returned.
The response includes a description of the job that has been started, and its ID can be used to query these details again, including the current progress, warnings and errors that occurred while processing the job, and to interrupt and cancel the execution of this job.
The request to start an export is similar to the one for previewing an export. Additionally, it accepts an optional parameter, exportLocation
, which can be used to specify a relative path within data/migration/export
in the shared home directory. No locations outside of that directory will be accepted for exports.
There are essentially three ways to select repositories for export. Regardless of which you use, a few general rules apply:
Now, a single repository can be selected like this:
1 2 3 4 5 6 7 8
{ "projectKey": "PRJ", "slug": "my-repo" }
Second, all repositories in a specific project can be selected like this:
1 2 3 4 5 6 7 8
{ "projectKey": "PRJ", "slug": *" }
And third, all projects and repositories in the system would be selected like this:
1 2 3 4 5 6 7 8
{ "projectKey": "*", "slug": *" }
The authenticated user must have ADMIN permission or higher to call this resource.
The request
string
object
RequiredDetails about the export job.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/exports' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"exportLocation": "example/sub/directory",
"repositoriesRequest": {
"includes": [
{
"projectKey": "PRJ",
"slug": "my-repo"
}
]
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"id": 1,
"state": "INITIALISING",
"type": "com.atlassian.bitbucket.migration.export",
"progress": {
"message": "Working on it...",
"percentage": 42
},
"nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4",
"initiator": {
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
},
"endDate": 1497657603000,
"startDate": 1497657601000,
"updatedDate": 1497657603000
}
Enumerates the projects and repositories that would be exported for a given export request.
All affected repositories will be enumerated explicitly, and while projects are listed as individual items in responses from this endpoint, their presence does not imply that all their repositories are included.
While this endpoint can be used to verify that all selectors in the request apply as intended, it should be noted that a subsequent, actual export might contain a different set of repositories, as they might have been added or deleted in the meantime.
Note that the overall response from this endpoint can become very large when a lot of repositories end up in the selection. This is why the server is streaming the response while it is being generated (as opposed to creating it in memory and then sending it all at once) and it can be consumed in a streaming way, too.
Also, due to the potential size of the response, projects and repositories are listed with fewer details than in other REST responses.
For a more detailed description of selectors, see the endpoint documentation for starting an export.
The authenticated user must have ADMIN permission or higher to call this resource.
the export request
string
object
RequiredThe effectively selected projects and repositories.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/exports/preview' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"exportLocation": "example/sub/directory",
"repositoriesRequest": {
"includes": [
{
"projectKey": "PRJ",
"slug": "my-repo"
}
]
}
}'
1
2
3
4
5
{
"scopes": [
{}
]
}
Gets the details, including the current status and progress, of the export job identified by the given ID.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe job, including status and progress information.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/exports/{jobId}' \
--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
{
"id": 1,
"state": "INITIALISING",
"type": "com.atlassian.bitbucket.migration.export",
"progress": {
"message": "Working on it...",
"percentage": 42
},
"nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4",
"initiator": {
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
},
"endDate": 1497657603000,
"startDate": 1497657601000,
"updatedDate": 1497657603000
}
Requests the cancellation of an export job.
The request to cancel a job will be processed successfully if the job is actually still running. If it has already finished (successfully or with errors) or if it has already been canceled before, then an error will be returned.
There might be a small delay between accepting the request and actually cancelling the job. In most cases, the delay will be close to instantaneously. In the unlikely case of communication issues across a cluster, it can however take a few seconds to cancel a job.
A client should always actively query the job status to confirm that a job has been successfully canceled.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe job has successfully been marked for cancellation
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/exports/{jobId}/cancel'
Gets the messages generated by the job.
Without any filter, all messages will be returned, but the response can optionally be filtered for the following severities. The severity parameter can be repeated to include multiple severities in one response.
The authenticated user must have ADMIN permission or higher to call this resource.
string
Requiredstring
string
number
number
The messages generated by this job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/exports/{jobId}/messages' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"values": [
{
"subject": "job",
"id": "617",
"createdDate": "<string>",
"severity": "INFO",
"text": "Something of interest happened"
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Starts a background job that imports the specified archive.
Only 1 import at a time is supported per cluster. If another request is made while an import is already running, the request will be rejected and an error returned.
The path in the request must point to a valid archive file. The file must be located within the data/migration/import
directory in the shared home directory.
The authenticated user must have ADMIN permission or higher to call this resource.
The request
string
Details about the export job.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/imports' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"archivePath": "Bitbucket_export_1.tar"
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"id": 1,
"state": "INITIALISING",
"type": "com.atlassian.bitbucket.migration.export",
"progress": {
"message": "Working on it...",
"percentage": 42
},
"nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4",
"initiator": {
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
},
"endDate": 1497657603000,
"startDate": 1497657601000,
"updatedDate": 1497657603000
}
Gets the details, including the current status and progress, of the import job identified by the given ID.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe job, including status and progress information.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/imports/{jobId}' \
--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
{
"id": 1,
"state": "INITIALISING",
"type": "com.atlassian.bitbucket.migration.export",
"progress": {
"message": "Working on it...",
"percentage": 42
},
"nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4",
"initiator": {
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
},
"endDate": 1497657603000,
"startDate": 1497657601000,
"updatedDate": 1497657603000
}
Requests the cancellation of an import job.
The request to cancel a job will be processed successfully if the job is actually still running. If it has already finished (successfully or with errors) or if it has already been canceled before, then an error will be returned.
Note that import jobs are not canceled as instantaneously as export jobs. Rather, once the request has been accepted, there are a number of checkpoints at which the job will actually apply it and stop. This is to keep the system in a reasonably consistent state:
A client should always actively query the job status to confirm that a job has been successfully canceled.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe job has successfully been marked for cancellation.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/imports/{jobId}/cancel'
Gets the messages generated by the job.
Without any filter, all messages will be returned, but the response can optionally be filtered for the following severities. The severity parameter can be repeated to include multiple severities in one response.
The authenticated user must have ADMIN permission or higher to call this resource.
string
Requiredstring
string
number
number
The messages generated by this job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/imports/{jobId}/messages' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"values": [
{
"subject": "job",
"id": "617",
"createdDate": "<string>",
"severity": "INFO",
"text": "Something of interest happened"
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Starts a background job that migrates selected projects/repositories to Mesh.
Only 1 job is supported per cluster.
The response includes a description of the job that has been started, and its ID can be used to query these details again, including the current progress, and to interrupt and cancel the execution of this job.
The request to start a migration is similar to the one for previewing a migration.
There are essentially three ways to select repositories for migration. Regardless of which you use, a few general rules apply:
1
- You can supply a list of repository IDs and project IDs. The selection will be additive. All repositories in the system are migrated if both lists are empty. - Repositories that are selected more than once due to overlapping IDs will be de-duplicated and effectively migrated only once. - For every selected repository, its full fork hierarchy will be considered selected, even if parts of that hierarchy would otherwise not be matched by the provided IDs. For example, when you explicitly select a single repository only, but that repository is a fork, then its origin will be migrated too.
Now, a single repository can be selected like this:
1 2 3 4
{ "repositoryIds": [1] }
Multiple repositories can be selected like this:
1 2 3 4
{ "repositoryIds": [1, 2] }
Second, all repositories in a specific project can be selected like this:
1 2 3 4
{ "projectIds": [1] }
And third, all projects and repositories in the system would be selected like this:
1 2 3 4 5
{ "projectIds": [], "repositoryIds": [] }
The authenticated user must have SYS_ADMIN permission to call this resource.
boolean
object
array<integer>
array<integer>
The started job
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/mesh' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"all": true,
"maxBytesPerSecond": {
"asLong": 2154,
"present": true
},
"projectIds": [
2154
],
"repositoryIds": [
2154
]
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"id": 1,
"state": "INITIALISING",
"type": "com.atlassian.bitbucket.migration.export",
"progress": {
"message": "Working on it...",
"percentage": 42
},
"nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4",
"initiator": {
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
},
"endDate": 1497657603000,
"startDate": 1497657601000,
"updatedDate": 1497657603000
}
Enumerates the projects and repositories that would be migrated for a given request.
All affected repositories will be enumerated explicitly, and while projects are listed as individual items in responses from this endpoint, their presence does not imply that all their repositories are included.
While this endpoint can be used to verify that all selectors in the request apply as intended, it should be noted that a subsequent, actual export might contain a different set of repositories, as they might have been added or deleted in the meantime.
Note that the overall response from this endpoint can become very large when a lot of repositories end up in the selection. This is why the server is streaming the response while it is being generated (as opposed to creating it in memory and then sending it all at once) and it can be consumed in a streaming way, too.
Also, due to the potential size of the response, projects and repositories are listed with fewer details than in other REST responses.
The authenticated user must have SYS_ADMIN permission to call this resource.
The export request
boolean
object
array<integer>
array<integer>
Enumeration of projects and repositories that would be migrated for a given request.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/preview' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"all": true,
"maxBytesPerSecond": {
"asLong": 2154,
"present": true
},
"projectIds": [
2154
],
"repositoryIds": [
2154
]
}'
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
{
"repositories": [
{
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
}
]
}
Searches for repositories in the system matching the specified criteria and enriches their MeshMigrationQueueState migration state if a migration is currently in progress.
The currently active migration can optionally be specified by passing a migrationId, if known. If this isn't passed, an attempt is made to locate the active migration and its ID is used.
If a migration is currently active, only repositories that are a part of the migration are filtered and returned. Otherwise, all repositories in the systems are filtered and returned.
Filtering by state is ignored when no migration is currently in progress. In such a case, results are not enriched with their MeshMigrationQueueState migration state.
The authenticated user must have SYS_ADMIN permission to call this resource.
string
string
string
string
string
number
number
A page of repositories matching the specified criteria.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/repos' \
--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
{
"values": [
{
"repository": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"migrationState": "QUEUED"
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Retrieve a page of Mesh migration job summaries. Jobs are ordered by when they were started, newest first.
The authenticated user must have SYS_ADMIN permission to call this resource.
number
number
The summary of the migration job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/summaries' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"values": [
{
"queue": {},
"state": "RUNNING",
"progress": 53,
"startTime": 1331038800000,
"jobId": 2154,
"endTime": 1331038800000,
"maxBandwidth": 2154
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Gets the summary, including the queue status and progress, of the currently active Mesh migration job.
The authenticated user must have SYS_ADMIN permission to call this resource.
This request has no parameters.
The summary of the currently active migration job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/summary' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"queue": {},
"state": "RUNNING",
"progress": 53,
"startTime": 1331038800000,
"jobId": 2154,
"endTime": 1331038800000,
"maxBandwidth": 2154
}
Gets the details, including the current status and progress, of the job identified by the given ID.
The authenticated user must have SYS_ADMIN permission to call this resource.
string
RequiredThe details of the migration job.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}' \
--header 'Accept: application/json'
Requests the cancellation of a migration job.
The request to cancel a job will be processed successfully if the job is actually still running. If it has already finished (successfully or with errors) or if it has already been canceled before, then an error will be returned.
There might be a small delay between accepting the request and actually cancelling the job. In most cases, the delay will be close to instantaneously. In the unlikely case of communication issues across a cluster, it can however take a few seconds to cancel a job.
A client should always actively query the job status to confirm that a job has been successfully canceled.
The authenticated user must have SYS_ADMIN permission to call this resource.
string
RequiredThe migration job was successfully marked for cancellation.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}/cancel'
Gets the messages generated by the job.
Without any filter, all messages will be returned, but the response can optionally be filtered for the following severities. The severity parameter can be repeated to include multiple severities in one response.
1 2 3
- INFO - WARN - ERROR
The authenticated user must have SYS_ADMIN permission to call this resource.
string
Requiredstring
string
number
number
The details of the migration job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}/messages' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"values": [
{
"subject": "job",
"id": "617",
"createdDate": "<string>",
"severity": "INFO",
"text": "Something of interest happened"
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Gets the summary, including the queue status and progress, of a Mesh migration job.
The authenticated user must have SYS_ADMIN permission to call this resource.
string
RequiredThe summary of the migration job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}/summary' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"queue": {},
"state": "RUNNING",
"progress": 53,
"startTime": 1331038800000,
"jobId": 2154,
"endTime": 1331038800000,
"maxBandwidth": 2154
}
Retrieve a page of users, optionally run through provided filters.
Only authenticated users may call this resource.
The following three sub-sections list parameters supported for permission filters (where [root]
is
the root permission filter name, e.g. permission
, permission.1
etc.) depending on the
permission resource. The system determines which filter to apply (Global, Project or Repository permission)
based on the [root]
permission value. E.g. ADMIN
is a global permission,
PROJECT_ADMIN
is a project permission and REPO_ADMIN
is a repository permission. Note
that the parameters for a given resource will be looked up in the order as they are listed below, that is e.g.
for a project resource, if both projectId
and projectKey
are provided, the system will
use projectId
for the lookup.
The permission value under [root]
is the only required and recognized parameter, as global
permissions do not apply to a specific resource.
Example valid filter: permission=ADMIN
.
[root]
- specifies the project permission[root].projectId
- specifies the project ID to lookup the project by[root].projectKey
- specifies the project key to lookup the project byExample valid filter: permission.1=PROJECT_ADMIN&permission.1.projectKey=TEST_PROJECT
.
[root]
- specifies the repository permission[root].projectId
- specifies the repository ID to lookup the repository by[root].projectKey
and [root].repositorySlug
- specifies the project key and repository slug to lookup the repository by; both values need to be provided for this look up to be triggeredExample valid filter: permission.2=REPO_ADMIN&permission.2.projectKey=TEST_PROJECT&permission.2.repositorySlug=test_repo
.
string
string
string
string
A page of users.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/users' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
}
Update the currently authenticated user's details. The update will always be applied to the currently authenticated user.
The user update details
string
string
string
The updated user.
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/users' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "Jane Citizen",
"email": "jane@example.com",
"name": "jcitizen"
}'
1
2
3
4
5
6
7
8
9
{
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
}
Update the currently authenticated user's password.
The password update details
string
string
string
The user's password was successfully updated.
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/users/credentials' \
--header 'Content-Type: application/json' \
--data '{
"oldPassword": "my-old-secret-password",
"password": "my-secret-password",
"passwordConfirm": "my-secret-password"
}'
Retrieve the user matching the supplied userSlug.
string
RequiredThe user matching the supplied userSlug. Note, this may not be the user's username, always use the user.slug property.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/users/{userSlug}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
}
Update the avatar for the user with the supplied slug.
This resource accepts POST multipart form data, containing a single image in a form-field named 'avatar'.
There are configurable server limits on both the dimensions (1024x1024 pixels by default) and uploaded file size (1MB by default). Several different image formats are supported, but PNG and JPEG are preferred due to the file size limit.
This resource has Cross-Site Request Forgery (XSRF) protection. To allow the request to
pass the XSRF check the caller needs to send an X-Atlassian-Token
HTTP header with the
value no-check
.
An example curl request to upload an image name 'avatar.png' would be:
1
curl -X POST -u username:password -H "X-Atlassian-Token: no-check" http://example.com/rest/api/latest/users/jdoe/avatar.png -F avatar=@avatar.png
Users are always allowed to update their own avatar. To update someone else's avatar the authenticated user must have global ADMIN permission, or global SYS_ADMIN permission to update a SYS_ADMIN user's avatar.
string
Requiredstring
Multipart form data containing a single image in a form-field named 'avatar'.
string
The avatar was uploaded successfully.
string
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/users/{userSlug}/avatar.png'
Delete the avatar associated to a user.
Users are always allowed to delete their own avatar. To delete someone else's avatar the authenticated user must have global ADMIN permission, or global SYS_ADMIN permission to update a SYS_ADMIN user's avatar.
string
RequiredThe new avatar URL if the local avatar was successfully deleted or did not exist
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/users/{userSlug}/avatar.png' \
--header 'Accept: application/json'
1
2
3
4
{
"name": "http",
"href": "https://bitbucket.example.com/scm/awesomeproject/awesomerepo.git"
}
Retrieve a map of user setting key values for a specific user identified by the user slug.
string
RequiredThe user settings for the specified user slug.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/users/{userSlug}/settings' \
--header 'Accept: application/json'
1
2
3
4
5
{
"string key": "string value",
"boolean key": true,
"long key": 10
}
Update the entries of a map of user setting key/values for a specific user identified by the user slug.
string
RequiredA map with the UserSettings entries which must be updated.
string
boolean
number
The UserSettings were updated successfully
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/users/{userSlug}/settings' \
--header 'Content-Type: application/json' \
--data '{
"string key": "string value",
"boolean key": true,
"long key": 10
}'
Rate this page: