privileges Resource

Overview

Use this resource to manage privilege settings for a team account. Team accounts can grant groups account privileges as well as repository access. Groups with account privileges are those with can administer this account (admin rights) or can create repositories in this account (collaborator rights) checked:

Do individual accounts support these calls?

You can make these calls on an individual account but the result is an empty set. This is because individual accounts do not let you set account privileges.

To add members to groups, see group-privileges Endpoint and the privileges Endpoint.

GET a list of privilege groups on a team account

Gets the groups with account privileges defined for a team account. Administer rights automatically include collaborator rights. If you have a group without either option set, it is omitted from the results. The caller must authenticate. The access credentials must come from an account with owner or administrative privileges — either the team account access credentials or a member who can administer the team account. This method takes the following parameters:

Parameter
Required?
Description
accountname Yes The team or individual account name.
group_slug Yes The group's slug.
GET https://api.bitbucket.org/1.0/users/{accountname}/privileges
  Click here to expand...
{
    "2team/administrators": "admin",
    "2team/developers": "collaborator"
}

GET the privileges associated with a group

Gets the privilege associated with the specified groupname. The privilege is can be either collaborator or admin. The caller must authenticate. The access credentials must come from an account with owner or administrative privileges — either the team account access credentials or a member who can administer the team account. This method takes the following parameters:

Parameter
Required?
Description
accountname Yes The team or individual account name.
owner Yes The account that owns the group.
group_slug Yes The group's slug.
GET https://api.bitbucket.org/1.0/users/{accountname}/privileges/{owner}/{group_slug}
  Click here to expand...
{
    "privilege": "collaborator"
}

Updates a group's privileges on a team account

Updates an existing group's privileges for a team account. You can set a group's privileges to admin or collaborator. This call returns the changed group. The caller must authenticate. The access credentials must come from an account with owner or administrative privileges — either the team account access credentials or a member who can administer the team account. This method takes the following parameters:

Parameter
Required?
Description
accountname Yes The team or individual account name.
owner Yes The account that owns the group.
group_slug Yes The group's slug.
privileges Yes Either admin or collaborator.
PUT https://api.bitbucket.org/1.0/users/{accountname}/privileges/{owner}/{group_slug} --data "privileges=admin"
  Click here to expand...
{
    "2team/contractors": "admin"
}

POST a new privilege

Adds a privilege to a group without any. The caller must authenticate. The access credentials must come from an account with owner or administrative privileges — either the team account access credentials or a member who can administer the team account. This method takes the following parameters:

Parameter
Required?
Description
accountname Yes The team or individual account name.
owner Yes The account that owns the group.
group_slug Yes The group's slug.
privileges Yes Either admin or collaborator.
 POST https://api.bitbucket.org/1.0/users/{accountname}/privileges/{owner}/{group_slug} --data "privileges=admin"
  Click here to expand...
{
    "2team/contractors": "admin"
}

DELETE a privilege group

Deletes a privilege. The caller must authenticate. The access credentials must come from an account with owner or administrative privileges — either the team account access credentials or a member who can administer the team account. This method takes the following parameters:

Parameter
Required?
Description
accountname Yes The team or individual account name.
owner Yes The account that owns the group.
group_slug Yes The group's slug.
DELETE https://api.bitbucket.org/1.0/users/{accountname}/privileges/{owner}/{group_slug} 

On success, this call returns  HTTP/1.1 204 NO CONTENT .

Was this helpful?

Thanks for your feedback!

Why was this unhelpful?

Have a question about this article?

See questions about this article

Powered by Confluence and Scroll Viewport