Retrieve a page of groups.
The authenticated user must have LICENSED_USER permission or higher to call this resource.
string
number
number
A page of groups.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/groups' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"values": [
{
"deletable": true,
"name": "group-a"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Create a new group.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe newly created group.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/groups?name={name}' \
--header 'Accept: application/json'
1
2
3
4
{
"deletable": true,
"name": "group-a"
}
Deletes the specified group, removing them from the system. This also removes any permissions that may have been granted to the group.
A user may not delete the last group that is granting them administrative permissions, or a group with greater permissions than themselves.
The authenticated user must have the ADMIN permission to call this resource.
string
RequiredThe deleted group.
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/groups?name={name}' \
--header 'Accept: application/json'
1
2
3
4
{
"deletable": true,
"name": "group-a"
}
Add multiple users to a group.
The authenticated user must have the ADMIN permission to call this resource.
string
array<string>
RequiredAll the users were added to the group
any
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/groups/add-users' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"group": "group",
"users": [
"user1",
"user2"
]
}'
Retrieves a list of users that are members of a specified group.
The authenticated user must have the LICENSED_USER permission to call this resource.
string
string
Requirednumber
number
A page of users.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/groups/more-members?context={context}' \
--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
{
"values": [
{
"lastAuthenticationTimestamp": 1368145580548,
"directoryName": "Bitbucket Internal Directory",
"deletable": true,
"mutableDetails": true,
"mutableGroups": true,
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieves a list of users that are not members of a specified group.
The authenticated user must have the LICENSED_USER permission to call this resource.
string
string
Requirednumber
number
A page of users.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/groups/more-non-members?context={context}' \
--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
{
"values": [
{
"lastAuthenticationTimestamp": 1368145580548,
"directoryName": "Bitbucket Internal Directory",
"deletable": true,
"mutableDetails": true,
"mutableGroups": true,
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of groups that have been granted at least one global permission.
The authenticated user must have ADMIN permission or higher to call this resource.
string
number
number
A page of groups and their highest global permissions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/groups' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"values": [
{
"group": {
"name": "group_a"
},
"permission": "ADMIN"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Promote or demote a group's global permission level. Available global permissions are:
See the Bitbucket Server documentation for a detailed explanation of what each permission entails.
The authenticated user must have:
to call this resource. In addition, a user may not demote a group's permission level if their own permission level would be reduced as a result.
array<string>
Requiredstring
RequiredThe specified permission was granted to the specified user.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/groups?name={name}&permission={permission}'
Revoke all global permissions for a group.
The authenticated user must have:
to call this resource. In addition, a user may not revoke a group's permissions if their own permission level would be reduced as a result.
string
RequiredAll global permissions were revoked from the group.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/groups?name={name}'
Retrieve a page of groups that have no granted global permissions.
The authenticated user must have ADMIN permission or higher to call this resource.
string
number
number
A page of groups that have not been granted any global permissions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/groups/none' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"values": [
{
"deletable": true,
"name": "group-a"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of users that have been granted at least one global permission.
The authenticated user must have ADMIN permission or higher to call this resource.
string
number
number
A page of users and their highest global permissions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/users' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"values": [
{
"group": {
"name": "group_a"
},
"permission": "ADMIN"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Promote or demote the global permission level of a user. Available global permissions are:
See the Bitbucket Server documentation for a detailed explanation of what each permission entails.
The authenticated user must have:
to call this resource. In addition, a user may not demote their own permission level.
array<string>
Requiredstring
RequiredThe requested permission was granted.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/users?name={name}&permission={permission}'
Revoke all global permissions for a user.
The authenticated user must have:
to call this resource. In addition, a user may not demote their own permission level.
string
RequiredAll global permissions were revoked from the user.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/users?name={name}'
Retrieve a page of users that have no granted global permissions.
The authenticated user must have ADMIN permission or higher to call this resource.
string
number
number
A page of users that have not been granted any global permissions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/users/none' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"values": [
{
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of users.
The authenticated user must have the LICENSED_USER permission to call this resource.
string
number
number
A page of users.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/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
{
"values": [
{
"lastAuthenticationTimestamp": 1368145580548,
"directoryName": "Bitbucket Internal Directory",
"deletable": true,
"mutableDetails": true,
"mutableGroups": true,
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Update a user's details.
The authenticated user must have the ADMIN permission to call this resource.
string
string
string
The updated user.
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/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
10
11
12
13
14
{
"lastAuthenticationTimestamp": 1368145580548,
"directoryName": "Bitbucket Internal Directory",
"deletable": true,
"mutableDetails": true,
"mutableGroups": true,
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
Creates a new user from the assembled query parameters.
The default group can be used to control initial permissions for new users, such as granting users the ability to login or providing read access to certain projects or repositories. If the user is not added to the default group, they may not be able to login after their account is created until explicit permissions are configured.
The authenticated user must have the ADMIN permission to call this resource.
string
Requiredstring
boolean
string
Requiredstring
Requiredboolean
The user was successfully created.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/users?emailAddress={emailAddress}&displayName={displayName}&name={name}'
Deletes the specified user, removing them from the system. This also removes any permissions that may have been granted to the user.
A user may not delete themselves, and a user with ADMIN permissions may not delete a user with SYS_ADMINpermissions.
The authenticated user must have the ADMIN permission to call this resource.
string
RequiredThe deleted user.
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/users?name={name}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"lastAuthenticationTimestamp": 1368145580548,
"directoryName": "Bitbucket Internal Directory",
"deletable": true,
"mutableDetails": true,
"mutableGroups": true,
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
Add a user to one or more groups.
The authenticated user must have the ADMIN permission to call this resource.
array<string>
Requiredstring
The user was added to all the groups
any
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/users/add-groups' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"groups": [
"group_a",
"group_b"
],
"user": "user"
}'
Clears any CAPTCHA challenge that may constrain the user with the supplied username when they authenticate. Additionally any counter or metric that contributed towards the user being issued the CAPTCHA challenge (for instance too many consecutive failed logins) will also be reset.
The authenticated user must have the ADMIN permission to call this resource, and may not clear the CAPTCHA of a user with greater permissions than themselves.
string
RequiredThe CAPTCHA was successfully cleared.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/users/captcha?name={name}'
Update a user's password.
The authenticated user must have the ADMIN permission to call this resource, and may not update the password of a user with greater permissions than themselves.
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/admin/users/credentials' \
--header 'Content-Type: application/json' \
--data '{
"name": "jcitizen",
"password": "my-secret-password",
"passwordConfirm": "my-secret-password"
}'
Validate if a user can be erased.
A username is only valid for erasure if it exists as the username of a deleted user. This endpoint will return an appropriate error response if the supplied username is invalid for erasure.
This endpoint does not perform the actual user erasure, and will not modify the application in any way.
The authenticated user must have the ADMIN permission to call this resource.
string
Requiredthe user is erasable
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/users/erasure?name={name}'
Erases personally identifying user data for a deleted user.
References in the application to the original username will be either removed or updated to a new non-identifying username. Refer to the support guide for details about what data is and isn't erased.
User erasure can only be performed on a deleted user. If the user has not been deleted first then this endpoint will return a bad request and no erasure will be performed.
Erasing user data is irreversible and may lead to a degraded user experience. This method should not be used as part of a standard user deletion and cleanup process.
Plugins can participate in user erasure by defining a <user-erasure-handler>
module. If one or more plugin modules fail, an error summary of the failing modules is returned.
The authenticated user must have the ADMIN permission to call this resource.
string
RequiredThe identifier of the erased user.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/users/erasure?name={name}' \
--header 'Accept: application/json'
1
2
3
{
"newIdentifier": "user-123ab"
}
Retrieves a list of users that are not members of a specified group.
The authenticated user must have the LICENSED_USER permission to call this resource.
string
string
Requirednumber
number
A page of users.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/users/more-members?context={context}' \
--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
{
"values": [
{
"lastAuthenticationTimestamp": 1368145580548,
"directoryName": "Bitbucket Internal Directory",
"deletable": true,
"mutableDetails": true,
"mutableGroups": true,
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieves a list of groups the specified user is not a member of.
The authenticated user must have the LICENSED_USER permission to call this resource.
string
string
Requirednumber
number
A page of groups.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/users/more-non-members?context={context}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"values": [
{
"deletable": true,
"name": "group-a"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Remove a user from a group. This is very similar to groups/remove-user
, but with the context and itemName attributes of the supplied request entity reversed. On the face of it this may appear redundant, but it facilitates a specific UI component in the application.
In the request entity, the context attribute is the user and the itemName is the group.
The authenticated user must have the ADMIN permission to call this resource.
string
string
The user was removed from the group.
any
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/users/remove-group' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"context": "user_a",
"itemName": "group_a"
}'
Rename a user.
The authenticated user must have the ADMIN permission to call this resource.
string
string
The renamed user.
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/users/rename' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "jcitizen",
"newName": "jcitizen-new"
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"lastAuthenticationTimestamp": 1368145580548,
"directoryName": "Bitbucket Internal Directory",
"deletable": true,
"mutableDetails": true,
"mutableGroups": true,
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
Retrieve a page of group names.
The authenticated user must have LICENSED_USER permission or higher to call this resource.
string
number
number
A page of group names.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/groups' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"values": [
"<string>"
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Revoke all permissions for the specified repository for the given groups and users.
The authenticated user must have PROJECT_ADMIN permission for the specified repository or a higher global permission to call this resource.
In addition, a user may not revoke a group's permission if their own permission would be revoked as a result, nor may they revoke their own permission unless they have a global permission that already implies that permission.
string
Requiredstring
Requiredstring
string
All repository permissions were revoked from the users and groups for the specified repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions'
Retrieve a page of groups that have been granted at least one permission for the specified repository.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of groups and their highest permissions for the specified repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"values": [
{
"group": {
"name": "group_a"
},
"permission": "ADMIN"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Promote or demote a group's permission level for the specified repository. Available repository permissions are:
See the Bitbucket Server documentation for a detailed explanation of what each permission entails.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource. In addition, a user may not demote a group's permission level if their own permission level would be reduced as a result.
string
Requiredstring
Requiredarray<string>
Requiredstring
RequiredThe requested permission was granted.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups?name={name}&permission={permission}'
Revoke all permissions for the specified repository for a group.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.
In addition, a user may not revoke a group's permissions if it will reduce their own permission level.
string
Requiredstring
Requiredstring
RequiredAll repository permissions were revoked from the group for the specified repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups?name={name}'
Retrieve a page of groups that have no granted permissions for the specified repository.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of groups that have not been granted any permissions for the specified repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups/none' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"values": [
{
"deletable": true,
"name": "group-a"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Search direct and implied permissions of users and groups. This endpoint returns a superset of the results returned by the /users and /groups endpoints because it allows filtering by project and global permissions too.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project/global permission to call this resource.
string
Requiredstring
Requiredstring
string
string
default response
any
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/search'
Retrieve a page of users that have been granted at least one permission for the specified repository.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of users and their highest permissions for the specified repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/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
{
"values": [
{
"user": {
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
},
"permission": "USER_ADMIN"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Promote or demote a user's permission level for the specified repository. Available repository permissions are:
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource. In addition, a user may not reduce their own permission level unless they have a project or global permission that already implies that permission.
string
Requiredstring
Requiredarray<string>
Requiredstring
RequiredThe requested permission was granted.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users?name={name}&permission={permission}'
Revoke all permissions for the specified repository for a user.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.
In addition, a user may not revoke their own repository permissions if they do not have a higher project or global permission.
string
Requiredstring
Requiredstring
RequiredAll repository permissions were revoked from the user for the specified repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users?name={name}'
Retrieve a page of licensed users that have no granted permissions for the specified repository.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of users that have not been granted any permissions for the specified repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users/none' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"values": [
{
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true,
"displayName": "Jane Citizen"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Rate this page: