Addon
Branch restrictions
Branching model
Commit statuses
Commits
Deployments
Downloads
Issue tracker
Pipelines
Projects
Pullrequests
Refs
Reports
Repositories
Snippets
Source
Ssh
Teams
Users
Webhooks
Workspaces
Other operations

Rate this page:

Teams

The teams resource has been deprecated, and the workspaces endpoint should be used instead. The teams resource returns all the teams that the authenticated user is associated with.

List teams a user is part of

Deprecated

GET /2.0/teams

Returns all the teams that the authenticated user is associated with.

This endpoint has been removed. You should use the workspaces endpoint instead. For more information, see this post.

OAuth scopes required
team

Request

Query parameters
role

string

Filters the teams based on the authenticated user's role on each team.

  • member: returns a list of all the teams which the caller is a member of at least one team group or repository owned by the team
  • contributor: returns a list of teams which the caller has write access to at least one repository owned by the team
  • admin: returns a list teams which the caller has team administrator access

Valid values: admin, contributor, member

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/teams' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

A paginated list of teams.

Content typeValue
application/json

Paginated Teams

Get a team

Deprecated

GET /2.0/teams/{username}

Gets the public information associated with a team.

If the team's profile is private, location, website and created_on elements are omitted.

This endpoint has been removed. You should use the workspace endpoint instead. For more information, see this post.

OAuth scopes required
NONE

Request

Path parameters
username Required

string

This can either be the username or the UUID of the account, surrounded by curly-braces, for example: {account UUID}. An account is either a team or user.

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/teams/{username}' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

The team object

Content typeValue
application/json

allOf [allOf [object, Account], Team]

List team followers

Deprecated

GET /2.0/teams/{username}/followers

Returns the list of accounts that are following this team.

This endpoint has been removed. There is no replacement endpoint. For more information, see this post.

OAuth scopes required
NONE

Request

Path parameters
username Required

string

This can either be the username or the UUID of the account, surrounded by curly-braces, for example: {account UUID}. An account is either a team or user.

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/teams/{username}/followers' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

A paginated list of user objects.

Content typeValue
application/json

Paginated Users

List accounts a team is following

Deprecated

GET /2.0/teams/{username}/following

Returns the list of accounts this team is following.

This endpoint has been removed. There is no replacement endpoint. For more information, see this post.

OAuth scopes required
account

Request

Path parameters
username Required

string

This can either be the username or the UUID of the account, surrounded by curly-braces, for example: {account UUID}. An account is either a team or user.

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/teams/{username}/following' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

A paginated list of user objects.

Content typeValue
application/json

Paginated Users

List team members

Deprecated

GET /2.0/teams/{username}/members

Returns all members of the specified team. Any member of any of the team's groups is considered a member of the team. This includes users in groups that may not actually have access to any of the team's repositories.

This operation has been removed due to privacy changes. See the announcement for details. You should use the workspaces endpoint as a replacement.

OAuth scopes required
account

Request

Path parameters
username Required

string

This can either be the username or the UUID of the account, surrounded by curly-braces, for example: {account UUID}. An account is either a team or user.

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/teams/{username}/members' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

All members

Content typeValue
application/json

allOf [allOf [object, Account], User]

List team permissions for a user

Deprecated

GET /2.0/teams/{username}/permissions

Returns an object for each team permission a user on the team has.

This endpoint has been removed. You should use the workspace permissions endpoint instead. For more information, see the announcement.

Permissions returned are effective permissions — if a user is a member of multiple groups with distinct roles, only the highest level is returned.

Permissions can be:

  • admin
  • collaborator

Only users with admin permission for the team may access this resource.

Example:

1
2
$ curl https://api.bitbucket.org/2.0/teams/atlassian_tutorial/permissions

{
  "pagelen": 10,
  "values": [
    {
      "permission": "admin",
      "type": "team_permission",
      "user": {
        "type": "user",
        "nickname": "evzijst",
        "display_name": "Erik van Zijst",
        "uuid": "{d301aafa-d676-4ee0-88be-962be7417567}"
      },
      "team": {
        "display_name": "Atlassian Bitbucket",
        "uuid": "{4cc6108a-a241-4db0-96a5-64347ac04f87}"
      }
    },
    {
      "permission": "collaborator",
      "type": "team_permission",
      "user": {
        "type": "user",
        "nickname": "seanaty",
        "display_name": "Sean Conaty",
        "uuid": "{504c3b62-8120-4f0c-a7bc-87800b9d6f70}"
      },
      "team": {
        "display_name": "Atlassian Bitbucket",
        "uuid": "{4cc6108a-a241-4db0-96a5-64347ac04f87}"
      }
    }
  ],
  "page": 1,
  "size": 2
}

Results may be further filtered or sorted by team, user, or permission by adding the following query string parameters:

  • q=user.uuid="{d301aafa-d676-4ee0-88be-962be7417567}" or q=permission="admin"
  • sort=team.display_name

Note that the query parameter values need to be URL escaped so that = would become %3D.

OAuth scopes required
team

Request

Path parameters
username Required

string

This can either be the username or the UUID of the account, surrounded by curly-braces, for example: {account UUID}. An account is either a team or user.

Query parameters
q

string

Query string to narrow down the response as per filtering and sorting.

sort

string

Name of a response property sort the result by as per filtering and sorting.

Example

1
2
3
4
curl --request GET \
  --url 'https://api.bitbucket.org/2.0/teams/{username}/permissions' \
  --header 'Authorization: Bearer <access_token>' \
  --header 'Accept: application/json'

Responses

Repositories owned by a team.

Content typeValue
application/json

Paginated Team Permissions

List repository permissions for a team

Deprecated

GET /2.0/teams/{username}/permissions/repositories

Returns an object for each repository permission for all of a team’s repositories.

This endpoint has been removed. You should use the workspace repository permissions endpoint instead. For more information, see the announcement.

If the username URL parameter refers to a user account instead of a team account, an object containing the repository permissions of all the username's repositories will be returned.

Permissions returned are effective permissions — the highest level of permission the user has. This does not include public repositories that users are not granted any specific permission in, and does not distinguish between explicit and implicit privileges.

Only users with admin permission for the team may access this resource.

Permissions can be:

  • admin
  • write
  • read

Example:

1
2
$ curl https://api.bitbucket.org/2.0/teams/atlassian_tutorial/permissions/repositories

{
  "pagelen": 10,
  "values": [
    {
      "type": "repository_permission",
      "user": {
        "type": "user",
        "display_name": "Erik van Zijst",
        "uuid": "{d301aafa-d676-4ee0-88be-962be7417567}"
      },
      "repository": {
        "type": "repository",
        "name": "geordi",
        "full_name": "bitbucket/geordi",
        "uuid": "{85d08b4e-571d-44e9-a507-fa476535aa98}"
      },
      "permission": "admin"
    },
    {
      "type": "repository_permission",
      "user": {
        "type": "user",
        "display_name": "Sean Conaty",
        "uuid": "{504c3b62-8120-4f0c-a7bc-87800b9d6f70}"
      },
      "repository": {
        "type": "repository",
        "name": "geordi",
        "full_name": "bitbucket/geordi",
        "uuid": "{85d08b4e-571d-44e9-a507-fa476535aa98}"
      },
      "permission": "write"
    }
  ],
  "page": 1,
  "size": 2
}

Results may be further filtered or sorted by repository, user, or permission by adding the following query string parameters:

  • q=repository.name="geordi" or q=permission>"read"
  • sort=user.display_name

Note that the query parameter values need to be URL escaped so that = would become %3D.

OAuth scopes required
repository
,
team

Request

Path parameters
username Required

string

This can either be the username or the UUID of the account, surrounded by curly-braces, for example: {account UUID}. An account is either a team or user.

Query parameters
q

string

Query string to narrow down the response as per filtering and sorting.

sort

string

Name of a response property sort the result by as per filtering and sorting.

Example