Package se.bjurr.bitbucketcloud.gen.api
Interface TeamsApi
@Path("/teams")
@Generated(value="org.openapitools.codegen.languages.JavaJAXRSSpecServerCodegen",
date="2025-07-17T16:07:08.420911588+02:00[Europe/Stockholm]",
comments="Generator version: 7.14.0")
public interface TeamsApi
Represents a collection of functions to interact with the API endpoints.
-
Method Summary
Modifier and TypeMethodDescriptioncreatePipelineVariableForTeam(String username, @Valid PipelineVariable pipelineVariable) Create an account level variable.voiddeletePipelineVariableForTeam(String username, String variableUuid) Delete a team level variable.getPipelineVariableForTeam(String username, String variableUuid) Retrieve a team level variable.getPipelineVariablesForTeam(String username) Find account level variables.searchAccount(String username, @NotNull String searchQuery, Integer page, Integer pagelen) Returns all the teams that the authenticated user is associated with.teamsUsernameFollowersGet(String username) Returns the list of accounts that are following this team.teamsUsernameFollowingGet(String username) Returns the list of accounts this team is following.teamsUsernameGet(String username) Gets the public information associated with a team.teamsUsernameHooksGet(String username) Returns a paginated list of webhooks installed on this team.teamsUsernameHooksPost(String username) Creates a new webhook on the specified team.voidteamsUsernameHooksUidDelete(String username, String uid) Deletes the specified webhook subscription from the given team account.teamsUsernameHooksUidGet(String username, String uid) Returns the webhook with the specified id installed on the given team account.teamsUsernameHooksUidPut(String username, String uid) Updates the specified webhook subscription.teamsUsernameMembersGet(String username) Returns all members of the specified team.teamsUsernamePermissionsGet(String username, String q, String sort) Returns an object for each team permission a user on the team has.teamsUsernamePermissionsRepositoriesGet(String username, String q, String sort) Returns an object for each repository permission for all of a teamâs repositories.teamsUsernamePermissionsRepositoriesRepoSlugGet(String username, String repoSlug, String q, String sort) Returns an object for each repository permission of a given repository.teamsUsernameProjectsGet(String username) teamsUsernameProjectsPost(String username, @Valid @NotNull Project project) Creates a new project.voidteamsUsernameProjectsProjectKeyDelete(String username, String projectKey) teamsUsernameProjectsProjectKeyGet(String username, String projectKey) teamsUsernameProjectsProjectKeyPut(String username, String projectKey, @Valid @NotNull Project project) Since this endpoint can be used to both update and to create a project, the request body depends on the intent. ### Creation See the POST documentation for the project collection for an example of the request body.teamsUsernameRepositoriesGet(String username) All repositories owned by a user/team.updatePipelineVariableForTeam(String username, String variableUuid, @Valid @NotNull PipelineVariable pipelineVariable) Update a team level variable.
-
Method Details
-
createPipelineVariableForTeam
@POST @Path("/{username}/pipelines_config/variables/") @Consumes("application/json") @Produces("application/json") PipelineVariable createPipelineVariableForTeam(@PathParam("username") String username, @Valid @Valid PipelineVariable pipelineVariable) Create an account level variable.- Parameters:
username- The account.pipelineVariable- The variable to create.- Returns:
- The created variable.
-
deletePipelineVariableForTeam
@DELETE @Path("/{username}/pipelines_config/variables/{variable_uuid}") @Produces("application/json") void deletePipelineVariableForTeam(@PathParam("username") String username, @PathParam("variable_uuid") String variableUuid) Delete a team level variable.- Parameters:
username- The account.variableUuid- The UUID of the variable to delete.
-
getPipelineVariableForTeam
@GET @Path("/{username}/pipelines_config/variables/{variable_uuid}") @Produces("application/json") PipelineVariable getPipelineVariableForTeam(@PathParam("username") String username, @PathParam("variable_uuid") String variableUuid) Retrieve a team level variable.- Parameters:
username- The account.variableUuid- The UUID of the variable to retrieve.- Returns:
- The variable.
-
getPipelineVariablesForTeam
@GET @Path("/{username}/pipelines_config/variables/") @Produces("application/json") PaginatedPipelineVariables getPipelineVariablesForTeam(@PathParam("username") String username) Find account level variables.- Parameters:
username- The account.- Returns:
- The found account level variables.
-
searchAccount
@GET @Path("/{username}/search/code") @Produces("application/json") SearchResultPage searchAccount(@PathParam("username") String username, @QueryParam("search_query") @NotNull @NotNull String searchQuery, @QueryParam("page") @DefaultValue("1") Integer page, @QueryParam("pagelen") @DefaultValue("10") Integer pagelen) - Parameters:
username- The account to search in; either the username or the UUID in curly bracessearchQuery- The search querypage- Which page of the search results to retrievepagelen- How many search results to retrieve per page- Returns:
- Successful search
-
teamsGet
Returns all the teams that the authenticated user is associated with.- Parameters:
role- 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- Returns:
- A paginated list of teams.
-
teamsUsernameFollowersGet
@GET @Path("/{username}/followers") @Produces("application/json") PaginatedUsers teamsUsernameFollowersGet(@PathParam("username") String username) Returns the list of accounts that are following this team.- Parameters:
username- The team's username- Returns:
- A paginated list of user objects.
-
teamsUsernameFollowingGet
@GET @Path("/{username}/following") @Produces("application/json") PaginatedUsers teamsUsernameFollowingGet(@PathParam("username") String username) Returns the list of accounts this team is following.- Parameters:
username- The team's username- Returns:
- A paginated list of user objects.
-
teamsUsernameGet
@GET @Path("/{username}") @Produces("application/json") Team teamsUsernameGet(@PathParam("username") String username) Gets the public information associated with a team. If the team's profile is private, `location`, `website` and `created_on` elements are omitted.- Parameters:
username- The team's username or UUID.- Returns:
- The team object
-
teamsUsernameHooksGet
@GET @Path("/{username}/hooks") @Produces("application/json") PaginatedWebhookSubscriptions teamsUsernameHooksGet(@PathParam("username") String username) Returns a paginated list of webhooks installed on this team.- Parameters:
username-- Returns:
- The paginated list of installed webhooks.
-
teamsUsernameHooksPost
@POST @Path("/{username}/hooks") @Produces("application/json") WebhookSubscription teamsUsernameHooksPost(@PathParam("username") String username) Creates a new webhook on the specified team. Team webhooks are fired for events from all repositories belonging to that team account. Note that only admins can install webhooks on teams.- Parameters:
username-- Returns:
- The newly installed webhook.
-
teamsUsernameHooksUidDelete
@DELETE @Path("/{username}/hooks/{uid}") @Produces("application/json") void teamsUsernameHooksUidDelete(@PathParam("username") String username, @PathParam("uid") String uid) Deletes the specified webhook subscription from the given team account.- Parameters:
username-uid- The installed webhook's id
-
teamsUsernameHooksUidGet
@GET @Path("/{username}/hooks/{uid}") @Produces("application/json") WebhookSubscription teamsUsernameHooksUidGet(@PathParam("username") String username, @PathParam("uid") String uid) Returns the webhook with the specified id installed on the given team account.- Parameters:
username-uid- The installed webhook's id.- Returns:
- The webhook subscription object.
-
teamsUsernameHooksUidPut
@PUT @Path("/{username}/hooks/{uid}") @Produces("application/json") WebhookSubscription teamsUsernameHooksUidPut(@PathParam("username") String username, @PathParam("uid") String uid) Updates the specified webhook subscription. The following properties can be mutated: * `description` * `url` * `active` * `events`- Parameters:
username-uid- The installed webhook's id- Returns:
- The webhook subscription object.
-
teamsUsernameMembersGet
@GET @Path("/{username}/members") @Produces("application/json") User teamsUsernameMembersGet(@PathParam("username") String username) 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 deprecated due to privacy changes. See the [announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/) for details.- Parameters:
username-- Returns:
- All members
-
teamsUsernamePermissionsGet
@GET @Path("/{username}/permissions") @Produces("application/json") PaginatedTeamPermissions teamsUsernamePermissionsGet(@PathParam("username") String username, @QueryParam("q") String q, @QueryParam("sort") String sort) Returns an object for each team permission a user on the team has. 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: ``` $ curl https://api.bitbucket.org/2.0/teams/atlassian_tutorial/permissions { \"pagelen\": 10, \"values\": [ { \"permission\": \"admin\", \"type\": \"team_permission\", \"user\": { \"type\": \"user\", \"username\": \"evzijst\", \"nickname\": \"evzijst\", \"display_name\": \"Erik van Zijst\", \"uuid\": \"{d301aafa-d676-4ee0-88be-962be7417567}\" }, \"team\": { \"username\": \"bitbucket\", \"display_name\": \"Atlassian Bitbucket\", \"uuid\": \"{4cc6108a-a241-4db0-96a5-64347ac04f87}\" } }, { \"permission\": \"collaborator\", \"type\": \"team_permission\", \"user\": { \"type\": \"user\", \"username\": \"seanaty\", \"nickname\": \"seanaty\", \"display_name\": \"Sean Conaty\", \"uuid\": \"{504c3b62-8120-4f0c-a7bc-87800b9d6f70}\" }, \"team\": { \"username\": \"bitbucket\", \"display_name\": \"Atlassian Bitbucket\", \"uuid\": \"{4cc6108a-a241-4db0-96a5-64347ac04f87}\" } } ], \"page\": 1, \"size\": 2 } ``` Results may be further [filtered or sorted](../../../meta/filtering) by team, user, or permission by adding the following query string parameters: * `q=user.username=\"evzijst\"` or `q=permission=\"admin\"` * `sort=team.display_name` Note that the query parameter values need to be URL escaped so that `=` would become `%3D`.- Parameters:
username- 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.q- Query string to narrow down the response as per [filtering and sorting](../../../meta/filtering).sort- Name of a response property sort the result by as per [filtering and sorting](../../../meta/filtering#query-sort).- Returns:
- Repositories owned by a team.
-
teamsUsernamePermissionsRepositoriesGet
@GET @Path("/{username}/permissions/repositories") @Produces("application/json") PaginatedRepositoryPermissions teamsUsernamePermissionsRepositoriesGet(@PathParam("username") String username, @QueryParam("q") String q, @QueryParam("sort") String sort) Returns an object for each repository permission for all of a teamâs repositories. 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 direct and indirect privileges. Only users with admin permission for the team may access this resource. Permissions can be: * `admin` * `write` * `read` Example: ``` $ curl https://api.bitbucket.org/2.0/teams/atlassian_tutorial/permissions/repositories { \"pagelen\": 10, \"values\": [ { \"type\": \"repository_permission\", \"user\": { \"type\": \"user\", \"username\": \"evzijst\", \"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\", \"username\": \"seanaty\", \"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](../../../../meta/filtering) 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`.- Parameters:
username- 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.q- Query string to narrow down the response as per [filtering and sorting](../../../../meta/filtering).sort- Name of a response property sort the result by as per [filtering and sorting](../../../../meta/filtering#query-sort).- Returns:
- List of team's repository permissions.
-
teamsUsernamePermissionsRepositoriesRepoSlugGet
@GET @Path("/{username}/permissions/repositories/{repo_slug}") @Produces("application/json") PaginatedRepositoryPermissions teamsUsernamePermissionsRepositoriesRepoSlugGet(@PathParam("username") String username, @PathParam("repo_slug") String repoSlug, @QueryParam("q") String q, @QueryParam("sort") String sort) Returns an object for each repository permission of a given repository. If the username URL parameter refers to a user account instead of a team account, an object containing the repository permissions of the username's repository 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 direct and indirect privileges. Only users with admin permission for the repository may access this resource. Permissions can be: * `admin` * `write` * `read` Example: ``` $ curl https://api.bitbucket.org/2.0/teams/atlassian_tutorial/permissions/repositories/geordi { \"pagelen\": 10, \"values\": [ { \"type\": \"repository_permission\", \"user\": { \"type\": \"user\", \"username\": \"evzijst\", \"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\", \"username\": \"seanaty\", \"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](../../../../meta/filtering) by user, or permission by adding the following query string parameters: * `q=permission>\"read\"` * `sort=user.display_name` Note that the query parameter values need to be URL escaped so that `=` would become `%3D`.- Parameters:
username- 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.repoSlug- This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.q- Query string to narrow down the response as per [filtering and sorting](../../../../meta/filtering).sort- Name of a response property sort the result by as per [filtering and sorting](../../../../meta/filtering#query-sort).- Returns:
- List of repository's repository permissions.
-
teamsUsernameProjectsGet
@GET @Path("/{username}/projects/") @Produces("application/json") PaginatedProjects teamsUsernameProjectsGet(@PathParam("username") String username) - Parameters:
username- 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.- Returns:
- A paginated list of projects that belong to the specified team.
-
teamsUsernameProjectsPost
@POST @Path("/{username}/projects/") @Consumes("application/json") @Produces("application/json") Project teamsUsernameProjectsPost(@PathParam("username") String username, @Valid @NotNull @Valid @NotNull Project project) Creates a new project. Note that the avatar has to be embedded as either a data-url or a URL to an external image as shown in the examples below: ``` $ body=$(cat << EOF { \"name\": \"Mars Project\", \"key\": \"MARS\", \"description\": \"Software for colonizing mars.\", \"links\": { \"avatar\": { \"href\": \"data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/...\" } }, \"is_private\": false } EOF ) $ curl -H \"Content-Type: application/json\" \\ -X POST \\ -d \"$body\" \\ https://api.bitbucket.org/2.0/teams/teams-in-space/projects/ | jq . { // Serialized project document } ``` or even: ``` $ body=$(cat << EOF { \"name\": \"Mars Project\", \"key\": \"MARS\", \"description\": \"Software for colonizing mars.\", \"links\": { \"avatar\": { \"href\": \"http://i.imgur.com/72tRx4w.gif\" } }, \"is_private\": false } EOF ) $ curl -H \"Content-Type: application/json\" \\ -X POST \\ -d \"$body\" \\ https://api.bitbucket.org/2.0/teams/teams-in-space/projects/ | jq . { // Serialized project document } ```- Parameters:
username- 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.project-- Returns:
- A new project has been created.
-
teamsUsernameProjectsProjectKeyDelete
@DELETE @Path("/{username}/projects/{project_key}") @Produces("application/json") void teamsUsernameProjectsProjectKeyDelete(@PathParam("username") String username, @PathParam("project_key") String projectKey) - Parameters:
username- 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.projectKey- The project in question. This can either be the actual `key` assigned to the project or the `UUID` (surrounded by curly-braces (`{}`)).
-
teamsUsernameProjectsProjectKeyGet
@GET @Path("/{username}/projects/{project_key}") @Produces("application/json") Project teamsUsernameProjectsProjectKeyGet(@PathParam("username") String username, @PathParam("project_key") String projectKey) - Parameters:
username- 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.projectKey- The project in question. This can either be the actual `key` assigned to the project or the `UUID` (surrounded by curly-braces (`{}`)).- Returns:
- The project object.
-
teamsUsernameProjectsProjectKeyPut
@PUT @Path("/{username}/projects/{project_key}") @Consumes("application/json") @Produces("application/json") Project teamsUsernameProjectsProjectKeyPut(@PathParam("username") String username, @PathParam("project_key") String projectKey, @Valid @NotNull @Valid @NotNull Project project) Since this endpoint can be used to both update and to create a project, the request body depends on the intent. ### Creation See the POST documentation for the project collection for an example of the request body. Note: The `key` should not be specified in the body of request (since it is already present in the URL). The `name` is required, everything else is optional. ### Update See the POST documentation for the project collection for an example of the request body. Note: The key is not required in the body (since it is already in the URL). The key may be specified in the body, if the intent is to change the key itself. In such a scenario, the location of the project is changed and is returned in the `Location` header of the response.- Parameters:
username- 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.projectKey- The project in question. This can either be the actual `key` assigned to the project or the `UUID` (surrounded by curly-braces (`{}`)).project-- Returns:
- The existing project is has been updated.
-
teamsUsernameRepositoriesGet
@GET @Path("/{username}/repositories") @Produces("application/json") Error teamsUsernameRepositoriesGet(@PathParam("username") String username) All repositories owned by a user/team. This includes private repositories, but filtered down to the ones that the calling user has access to.- Parameters:
username-- Returns:
- Unexpected error.
-
updatePipelineVariableForTeam
@PUT @Path("/{username}/pipelines_config/variables/{variable_uuid}") @Consumes("application/json") @Produces("application/json") PipelineVariable updatePipelineVariableForTeam(@PathParam("username") String username, @PathParam("variable_uuid") String variableUuid, @Valid @NotNull @Valid @NotNull PipelineVariable pipelineVariable) Update a team level variable.- Parameters:
username- The account.variableUuid- The UUID of the variable.pipelineVariable- The updated variable.- Returns:
- The variable was updated.
-