Interface RepositoriesApi


@Path("/repositories") @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 RepositoriesApi
Represents a collection of functions to interact with the API endpoints.
  • Method Details

    • createEnvironment

      @POST @Path("/{workspace}/{repo_slug}/environments/") @Consumes("application/json") @Produces("application/json") DeploymentEnvironment createEnvironment(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull DeploymentEnvironment deploymentEnvironment)
      Create an environment.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      deploymentEnvironment - The environment to create.
      Returns:
      The environment was created.
    • createPipelineForRepository

      @POST @Path("/{workspace}/{repo_slug}/pipelines/") @Consumes("application/json") @Produces("application/json") Pipeline createPipelineForRepository(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull Pipeline pipeline)
      Endpoint to create and initiate a pipeline. There are a couple of different options to initiate a pipeline, where the payload of the request will determine which type of pipeline will be instantiated. # Trigger a Pipeline for a branch One way to trigger pipelines is by specifying the branch for which you want to trigger a pipeline. The specified branch will be used to determine which pipeline definition from the `bitbucket-pipelines.yml` file will be applied to initiate the pipeline. The pipeline will then do a clone of the repository and checkout the latest revision of the specified branch. ### Example ``` $ curl -X POST -is -u username:password \\ -H 'Content-Type: application/json' \\ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\ -d ' { \"target\": { \"ref_type\": \"branch\", \"type\": \"pipeline_ref_target\", \"ref_name\": \"master\" } }' ``` # Trigger a Pipeline for a commit on a branch or tag You can initiate a pipeline for a specific commit and in the context of a specified reference (e.g. a branch, tag or bookmark). The specified reference will be used to determine which pipeline definition from the bitbucket-pipelines.yml file will be applied to initiate the pipeline. The pipeline will clone the repository and then do a checkout the specified reference. The following reference types are supported: * `branch` * `named_branch` * `bookmark` * `tag` ### Example ``` $ curl -X POST -is -u username:password \\ -H 'Content-Type: application/json' \\ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\ -d ' { \"target\": { \"commit\": { \"type\": \"commit\", \"hash\": \"ce5b7431602f7cbba007062eeb55225c6e18e956\" }, \"ref_type\": \"branch\", \"type\": \"pipeline_ref_target\", \"ref_name\": \"master\" } }' ``` # Trigger a specific pipeline definition for a commit You can trigger a specific pipeline that is defined in your `bitbucket-pipelines.yml` file for a specific commit. In addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition. The resulting pipeline will then clone the repository and checkout the specified revision. ### Example ``` $ curl -X POST -is -u username:password \\ -H 'Content-Type: application/json' \\ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\ -d ' { \"target\": { \"commit\": { \"hash\":\"a3c4e02c9a3755eccdc3764e6ea13facdf30f923\", \"type\":\"commit\" }, \"selector\": { \"type\":\"custom\", \"pattern\":\"Deploy to production\" }, \"type\":\"pipeline_commit_target\" } }' ``` # Trigger a specific pipeline definition for a commit on a branch or tag You can trigger a specific pipeline that is defined in your `bitbucket-pipelines.yml` file for a specific commit in the context of a specified reference. In addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition, as well as the reference information. The resulting pipeline will then clone the repository a checkout the specified reference. ### Example ``` $ curl -X POST -is -u username:password \\ -H 'Content-Type: application/json' \\ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \\ -d ' { \"target\": { \"commit\": { \"hash\":\"a3c4e02c9a3755eccdc3764e6ea13facdf30f923\", \"type\":\"commit\" }, \"selector\": { \"type\": \"custom\", \"pattern\": \"Deploy to production\" }, \"type\": \"pipeline_ref_target\", \"ref_name\": \"master\", \"ref_type\": \"branch\" } }' ``` # Trigger a custom pipeline with variables In addition to triggering a custom pipeline that is defined in your `bitbucket-pipelines.yml` file as shown in the examples above, you can specify variables that will be available for your build. In the request, provide a list of variables, specifying the following for each variable: key, value, and whether it should be secured or not (this field is optional and defaults to not secured). ### Example ``` $ curl -X POST -is -u username:password \\ -H 'Content-Type: application/json' \\ https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \\ -d ' { \"target\": { \"type\": \"pipeline_ref_target\", \"ref_type\": \"branch\", \"ref_name\": \"master\", \"selector\": { \"type\": \"custom\", \"pattern\": \"Deploy to production\" } }, \"variables\": [ { \"key\": \"var1key\", \"value\": \"var1value\", \"secured\": true }, { \"key\": \"var2key\", \"value\": \"var2value\" } ] }' ```
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipeline - The pipeline to initiate.
      Returns:
      The initiated pipeline.
    • createRepositoryPipelineKnownHost

      @POST @Path("/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/") @Consumes("application/json") @Produces("application/json") PipelineKnownHost createRepositoryPipelineKnownHost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull PipelineKnownHost pipelineKnownHost)
      Create a repository level known host.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipelineKnownHost - The known host to create.
      Returns:
      The known host was created.
    • createRepositoryPipelineSchedule

      @POST @Path("/{workspace}/{repo_slug}/pipelines_config/schedules/") @Consumes("application/json") @Produces("application/json") PipelineSchedule createRepositoryPipelineSchedule(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull PipelineSchedule pipelineSchedule)
      Create a schedule for the given repository.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipelineSchedule - The schedule to create.
      Returns:
      The created schedule.
    • createRepositoryPipelineVariable

      @POST @Path("/{workspace}/{repo_slug}/pipelines_config/variables/") @Consumes("application/json") @Produces("application/json") PipelineVariable createRepositoryPipelineVariable(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull PipelineVariable pipelineVariable)
      Create a repository level variable.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipelineVariable - The variable to create.
      Returns:
      The variable was created.
    • deleteCommitHostedPropertyValue

      @DELETE @Path("/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}") void deleteCommitHostedPropertyValue(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("commit") String commit, @PathParam("app_key") String appKey, @PathParam("property_name") String propertyName)
      Delete an application property value stored against a commit.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      commit - The commit.
      appKey - The key of the Connect app.
      propertyName - The name of the property.
    • deletePullRequestHostedPropertyValue

      @DELETE @Path("/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}") void deletePullRequestHostedPropertyValue(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pullrequest_id") String pullrequestId, @PathParam("app_key") String appKey, @PathParam("property_name") String propertyName)
      Delete an application property value stored against a pull request.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pullrequestId - The pull request ID.
      appKey - The key of the Connect app.
      propertyName - The name of the property.
    • deleteRepositoryHostedPropertyValue

      @DELETE @Path("/{workspace}/{repo_slug}/properties/{app_key}/{property_name}") void deleteRepositoryHostedPropertyValue(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("app_key") String appKey, @PathParam("property_name") String propertyName)
      Delete an application property value stored against a repository.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      appKey - The key of the Connect app.
      propertyName - The name of the property.
    • deleteRepositoryPipelineKeyPair

      @DELETE @Path("/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair") @Produces("application/json") void deleteRepositoryPipelineKeyPair(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Delete the repository SSH key pair.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
    • deleteRepositoryPipelineKnownHost

      @DELETE @Path("/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}") @Produces("application/json") void deleteRepositoryPipelineKnownHost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("known_host_uuid") String knownHostUuid)
      Delete a repository level known host.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      knownHostUuid - The UUID of the known host to delete.
    • deleteRepositoryPipelineSchedule

      @DELETE @Path("/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}") @Produces("application/json") void deleteRepositoryPipelineSchedule(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("schedule_uuid") String scheduleUuid)
      Delete a schedule.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      scheduleUuid - The uuid of the schedule.
    • deleteRepositoryPipelineVariable

      @DELETE @Path("/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}") @Produces("application/json") void deleteRepositoryPipelineVariable(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("variable_uuid") String variableUuid)
      Delete a repository level variable.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      variableUuid - The UUID of the variable to delete.
    • getCommitHostedPropertyValue

      @GET @Path("/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}") void getCommitHostedPropertyValue(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("commit") String commit, @PathParam("app_key") String appKey, @PathParam("property_name") String propertyName)
      Retrieve an application property value stored against a commit.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      commit - The commit.
      appKey - The key of the Connect app.
      propertyName - The name of the property.
    • getDeploymentForRepository

      @GET @Path("/{workspace}/{repo_slug}/deployments/{deployment_uuid}") @Produces("application/json") Deployment getDeploymentForRepository(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("deployment_uuid") String deploymentUuid)
      Retrieve a deployment
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      deploymentUuid - The deployment UUID.
      Returns:
      The deployment.
    • getDeploymentsForRepository

      @GET @Path("/{workspace}/{repo_slug}/deployments/") @Produces("application/json") PaginatedDeployments getDeploymentsForRepository(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Find deployments
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      Returns:
      The matching deployments.
    • getEnvironmentForRepository

      @GET @Path("/{workspace}/{repo_slug}/environments/{environment_uuid}") @Produces("application/json") DeploymentEnvironment getEnvironmentForRepository(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("environment_uuid") String environmentUuid)
      Retrieve an environment
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      environmentUuid - The environment UUID.
      Returns:
      The environment.
    • getEnvironmentsForRepository

      @GET @Path("/{workspace}/{repo_slug}/environments/") @Produces("application/json") PaginatedEnvironments getEnvironmentsForRepository(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Find environments
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      Returns:
      The matching environments.
    • getPipelineForRepository

      @GET @Path("/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}") @Produces("application/json") Pipeline getPipelineForRepository(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pipeline_uuid") String pipelineUuid)
      Retrieve a specified pipeline
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipelineUuid - The pipeline UUID.
      Returns:
      The pipeline.
    • getPipelineStepForRepository

      @GET @Path("/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}") @Produces("application/json") PipelineStep getPipelineStepForRepository(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pipeline_uuid") String pipelineUuid, @PathParam("step_uuid") String stepUuid)
      Retrieve a given step of a pipeline.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipelineUuid - The UUID of the pipeline.
      stepUuid - The UUID of the step.
      Returns:
      The step.
    • getPipelineStepLogForRepository

      @GET @Path("/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid}/log") @Produces("application/octet-stream") void getPipelineStepLogForRepository(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pipeline_uuid") String pipelineUuid, @PathParam("step_uuid") String stepUuid)
      Retrieve the log file for a given step of a pipeline. This endpoint supports (and encourages!) the use of [HTTP Range requests](https://tools.ietf.org/html/rfc7233) to deal with potentially very large log files.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipelineUuid - The UUID of the pipeline.
      stepUuid - The UUID of the step.
    • getPipelineStepsForRepository

      @GET @Path("/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/") @Produces("application/json") PaginatedPipelineSteps getPipelineStepsForRepository(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pipeline_uuid") String pipelineUuid)
      Find steps for the given pipeline.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipelineUuid - The UUID of the pipeline.
      Returns:
      The steps.
    • getPipelinesForRepository

      @GET @Path("/{workspace}/{repo_slug}/pipelines/") @Produces("application/json") PaginatedPipelines getPipelinesForRepository(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Find pipelines
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      Returns:
      The matching pipelines.
    • getPullRequestHostedPropertyValue

      @GET @Path("/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}") void getPullRequestHostedPropertyValue(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pullrequest_id") String pullrequestId, @PathParam("app_key") String appKey, @PathParam("property_name") String propertyName)
      Retrieve an application property value stored against a pull request.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pullrequestId - The pull request ID.
      appKey - The key of the Connect app.
      propertyName - The name of the property.
    • getPullrequestsForCommit

      @GET @Path("/{workspace}/{repo_slug}/commit/{commit}/pullrequests") @Produces("application/json") PaginatedPullrequests getPullrequestsForCommit(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("commit") String commit, @QueryParam("page") @DefaultValue("1") Integer page, @QueryParam("pagelen") @DefaultValue("30") Integer pagelen)
      Parameters:
      workspace - The account; either the UUID in curly braces, or the account_id
      repoSlug - The repository; either the UUID in curly braces, or the slug
      commit - The SHA1 of the commit
      page - Which page to retrieve
      pagelen - How many pull requests to retrieve per page
      Returns:
      The paginated list of pull requests.
    • getRepositoryHostedPropertyValue

      @GET @Path("/{workspace}/{repo_slug}/properties/{app_key}/{property_name}") void getRepositoryHostedPropertyValue(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("app_key") String appKey, @PathParam("property_name") String propertyName)
      Retrieve an application property value stored against a repository.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      appKey - The key of the Connect app.
      propertyName - The name of the property.
    • getRepositoryPipelineConfig

      @GET @Path("/{workspace}/{repo_slug}/pipelines_config") @Produces("application/json") PipelinesConfig getRepositoryPipelineConfig(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Retrieve the repository pipelines configuration.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      Returns:
      The repository pipelines configuration.
    • getRepositoryPipelineKnownHost

      @GET @Path("/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}") @Produces("application/json") PipelineKnownHost getRepositoryPipelineKnownHost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("known_host_uuid") String knownHostUuid)
      Retrieve a repository level known host.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      knownHostUuid - The UUID of the known host to retrieve.
      Returns:
      The known host.
    • getRepositoryPipelineKnownHosts

      @GET @Path("/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/") @Produces("application/json") PaginatedPipelineKnownHosts getRepositoryPipelineKnownHosts(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Find repository level known hosts.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      Returns:
      The retrieved known hosts.
    • getRepositoryPipelineSchedule

      @GET @Path("/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}") @Produces("application/json") PipelineSchedule getRepositoryPipelineSchedule(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("schedule_uuid") String scheduleUuid)
      Retrieve a schedule by its UUID.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      scheduleUuid - The uuid of the schedule.
      Returns:
      The requested schedule.
    • getRepositoryPipelineScheduleExecutions

      @GET @Path("/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}/executions/") @Produces("application/json") PaginatedPipelineScheduleExecutions getRepositoryPipelineScheduleExecutions(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Retrieve the executions of a given schedule.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      Returns:
      The list of executions of a schedule.
    • getRepositoryPipelineSchedules

      @GET @Path("/{workspace}/{repo_slug}/pipelines_config/schedules/") @Produces("application/json") PaginatedPipelineSchedules getRepositoryPipelineSchedules(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Retrieve the configured schedules for the given repository.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      Returns:
      The list of schedules.
    • getRepositoryPipelineSshKeyPair

      @GET @Path("/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair") @Produces("application/json") PipelineSshKeyPair getRepositoryPipelineSshKeyPair(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Retrieve the repository SSH key pair excluding the SSH private key. The private key is a write only field and will never be exposed in the logs or the REST API.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      Returns:
      The SSH key pair.
    • getRepositoryPipelineVariable

      @GET @Path("/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}") @Produces("application/json") PipelineVariable getRepositoryPipelineVariable(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("variable_uuid") String variableUuid)
      Retrieve a repository level variable.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      variableUuid - The UUID of the variable to retrieve.
      Returns:
      The variable.
    • getRepositoryPipelineVariables

      @GET @Path("/{workspace}/{repo_slug}/pipelines_config/variables/") @Produces("application/json") PaginatedPipelineVariables getRepositoryPipelineVariables(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Find repository level variables.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      Returns:
      The retrieved variables.
    • repositoriesGet

      @GET @Produces("application/json") PaginatedRepositories repositoriesGet(@QueryParam("after") String after)
      Returns a paginated list of all public repositories. This endpoint also supports filtering and sorting of the results. See [filtering and sorting](../meta/filtering) for more details.
      Parameters:
      after - Filter the results to include only repositories create on or after this [ISO-8601](https://en.wikipedia.org/wiki/ISO_8601) timestamp. Example: `YYYY-MM-DDTHH:mm:ss.sssZ`
      Returns:
      All public repositories.
    • repositoriesWorkspaceGet

      @GET @Path("/{workspace}") @Produces("application/json") PaginatedRepositories repositoriesWorkspaceGet(@PathParam("workspace") String workspace, @QueryParam("role") String role)
      Returns a paginated list of all repositories owned by the specified account or UUID. The result can be narrowed down based on the authenticated user's role. E.g. with `?role=contributor`, only those repositories that the authenticated user has write access to are returned (this includes any repo the user is an admin on, as that implies write access). This endpoint also supports filtering and sorting of the results. See [filtering and sorting](../../meta/filtering) for more details.
      Parameters:
      workspace - 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.
      role - Filters the result based on the authenticated user's role on each repository. * **member**: returns repositories to which the user has explicit read access * **contributor**: returns repositories to which the user has explicit write access * **admin**: returns repositories to which the user has explicit administrator access * **owner**: returns all repositories owned by the current user
      Returns:
      The repositories owned by the specified account.
    • repositoriesWorkspaceRepoSlugBranchRestrictionsGet

      @GET @Path("/{workspace}/{repo_slug}/branch-restrictions") @Produces("application/json") PaginatedBranchrestrictions repositoriesWorkspaceRepoSlugBranchRestrictionsGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @QueryParam("kind") String kind, @QueryParam("pattern") String pattern)
      Returns a paginated list of all branch restrictions on the repository.
      Parameters:
      workspace - 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}`.
      kind - Branch restrictions of this type
      pattern - Branch restrictions applied to branches of this pattern
      Returns:
      A paginated list of branch restrictions
    • repositoriesWorkspaceRepoSlugBranchRestrictionsIdDelete

      @DELETE @Path("/{workspace}/{repo_slug}/branch-restrictions/{id}") @Produces("application/json") void repositoriesWorkspaceRepoSlugBranchRestrictionsIdDelete(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("id") String id)
      Deletes an existing branch restriction rule.
      Parameters:
      workspace - 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}`.
      id - The restriction rule's id
    • repositoriesWorkspaceRepoSlugBranchRestrictionsIdGet

      @GET @Path("/{workspace}/{repo_slug}/branch-restrictions/{id}") @Produces("application/json") Branchrestriction repositoriesWorkspaceRepoSlugBranchRestrictionsIdGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("id") String id)
      Returns a specific branch restriction rule.
      Parameters:
      workspace - 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}`.
      id - The restriction rule's id
      Returns:
      The branch restriction rule
    • repositoriesWorkspaceRepoSlugBranchRestrictionsIdPut

      @PUT @Path("/{workspace}/{repo_slug}/branch-restrictions/{id}") @Consumes("application/json") @Produces("application/json") Branchrestriction repositoriesWorkspaceRepoSlugBranchRestrictionsIdPut(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("id") String id, @Valid @NotNull @Valid @NotNull Branchrestriction branchrestriction)
      Updates an existing branch restriction rule. Fields not present in the request body are ignored. See [`POST`](../branch-restrictions#post) for details.
      Parameters:
      workspace - 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}`.
      id - The restriction rule's id
      branchrestriction - The new version of the existing rule
      Returns:
      The updated branch restriction rule
    • repositoriesWorkspaceRepoSlugBranchRestrictionsPost

      @POST @Path("/{workspace}/{repo_slug}/branch-restrictions") @Consumes("application/json") @Produces("application/json") Branchrestriction repositoriesWorkspaceRepoSlugBranchRestrictionsPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull Branchrestriction branchrestriction)
      Creates a new branch restriction rule for a repository. `kind` describes what will be restricted. Allowed values include: `push`, `force`, `delete` and `restrict_merges`. Different kinds of branch restrictions have different requirements: * `push` and `restrict_merges` require `users` and `groups` to be specified. Empty lists are allowed, in which case permission is denied for everybody. * `force` can not be specified in a Mercurial repository. The restriction applies to all branches that match. There are two ways to match a branch. It is configured in `branch_match_kind`: 1. `glob`: Matches a branch against the `pattern`. A `'*'` in `pattern` will expand to match zero or more characters, and every other character matches itself. For example, `'foo*'` will match `'foo'` and `'foobar'`, but not `'barfoo'`. `'*'` will match all branches. 2. `branching_model`: Matches a branch against the repository's branching model. The `branch_type` controls the type of branch to match. Allowed values include: `production`, `development`, `bugfix`, `release`, `feature` and `hotfix`. The combination of `kind` and match must be unique. This means that two `glob` restrictions in a repository cannot have the same `kind` and `pattern`. Additionally, two `branching_model` restrictions in a repository cannot have the same `kind` and `branch_type`. `users` and `groups` are lists of users and groups that are except from the restriction. They can only be configured in `push` and `restrict_merges` restrictions. The `push` restriction stops a user pushing to matching branches unless that user is in `users` or is a member of a group in `groups`. The `restrict_merges` stops a user merging pull requests to matching branches unless that user is in `users` or is a member of a group in `groups`. Adding new users or groups to an existing restriction should be done via `PUT`. Note that branch restrictions with overlapping matchers is allowed, but the resulting behavior may be surprising.
      Parameters:
      workspace - 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}`.
      branchrestriction - The new rule
      Returns:
      A paginated list of branch restrictions
    • repositoriesWorkspaceRepoSlugBranchingModelGet

      @GET @Path("/{workspace}/{repo_slug}/branching-model") @Produces("application/json") BranchingModel repositoriesWorkspaceRepoSlugBranchingModelGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Return the branching model as applied to the repository. This view is read-only. The branching model settings can be changed using the [settings](branching-model/settings#get) API. The returned object: 1. Always has a `development` property. `development.branch` contains the actual repository branch object that is considered to be the `development` branch. `development.branch` will not be present if it does not exist. 2. Might have a `production` property. `production` will not be present when `production` is disabled. `production.branch` contains the actual branch object that is considered to be the `production` branch. `production.branch` will not be present if it does not exist. 3. Always has a `branch_types` array which contains all enabled branch types. Example body: ``` { \"development\": { \"name\": \"master\", \"branch\": { \"type\": \"branch\", \"name\": \"master\", \"target\": { \"hash\": \"16dffcb0de1b22e249db6799532074cf32efe80f\" } }, \"use_mainbranch\": true }, \"production\": { \"name\": \"production\", \"branch\": { \"type\": \"branch\", \"name\": \"production\", \"target\": { \"hash\": \"16dffcb0de1b22e249db6799532074cf32efe80f\" } }, \"use_mainbranch\": false }, \"branch_types\": [ { \"kind\": \"release\", \"prefix\": \"release/\" }, { \"kind\": \"hotfix\", \"prefix\": \"hotfix/\" }, { \"kind\": \"feature\", \"prefix\": \"feature/\" }, { \"kind\": \"bugfix\", \"prefix\": \"bugfix/\" } ], \"type\": \"branching_model\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/.../branching-model\" } } } ```
      Parameters:
      workspace - 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}`.
      Returns:
      The branching model object
    • repositoriesWorkspaceRepoSlugBranchingModelSettingsGet

      @GET @Path("/{workspace}/{repo_slug}/branching-model/settings") @Produces("application/json") BranchingModelSettings repositoriesWorkspaceRepoSlugBranchingModelSettingsGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Return the branching model configuration for a repository. The returned object: 1. Always has a `development` property for the development branch. 2. Always a `production` property for the production branch. The production branch can be disabled. 3. The `branch_types` contains all the branch types. This is the raw configuration for the branching model. A client wishing to see the branching model with its actual current branches may find the [active model API](../branching-model#get) more useful. Example body: ``` { \"development\": { \"is_valid\": true, \"name\": null, \"use_mainbranch\": true }, \"production\": { \"is_valid\": true, \"name\": \"production\", \"use_mainbranch\": false, \"enabled\": false }, \"branch_types\": [ { \"kind\": \"release\", \"enabled\": true, \"prefix\": \"release/\" }, { \"kind\": \"hotfix\", \"enabled\": true, \"prefix\": \"hotfix/\" }, { \"kind\": \"feature\", \"enabled\": true, \"prefix\": \"feature/\" }, { \"kind\": \"bugfix\", \"enabled\": false, \"prefix\": \"bugfix/\" } ], \"type\": \"branching_model_settings\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/.../branching-model/settings\" } } } ```
      Parameters:
      workspace - 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}`.
      Returns:
      The branching model configuration
    • repositoriesWorkspaceRepoSlugBranchingModelSettingsPut

      @PUT @Path("/{workspace}/{repo_slug}/branching-model/settings") @Produces("application/json") BranchingModelSettings repositoriesWorkspaceRepoSlugBranchingModelSettingsPut(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Update the branching model configuration for a repository. The `development` branch can be configured to a specific branch or to track the main branch. When set to a specific branch it must currently exist. Only the passed properties will be updated. The properties not passed will be left unchanged. A request without a `development` property will leave the development branch unchanged. It is possible for the `development` branch to be invalid. This happens when it points at a specific branch that has been deleted. This is indicated in the `is_valid` field for the branch. It is not possible to update the settings for `development` if that would leave the branch in an invalid state. Such a request will be rejected. The `production` branch can be a specific branch, the main branch or disabled. When set to a specific branch it must currently exist. The `enabled` property can be used to enable (`true`) or disable (`false`) it. Only the passed properties will be updated. The properties not passed will be left unchanged. A request without a `production` property will leave the production branch unchanged. It is possible for the `production` branch to be invalid. This happens when it points at a specific branch that has been deleted. This is indicated in the `is_valid` field for the branch. A request that would leave `production` enabled and invalid will be rejected. It is possible to update `production` and make it invalid if it would also be left disabled. The `branch_types` property contains the branch types to be updated. Only the branch types passed will be updated. All updates will be rejected if it would leave the branching model in an invalid state. For branch types this means that: 1. The prefixes for all enabled branch types are valid. For example, it is not possible to use '*' inside a Git prefix. 2. A prefix of an enabled branch type must not be a prefix of another enabled branch type. This is to ensure that a branch can be easily classified by its prefix unambiguously. It is possible to store an invalid prefix if that branch type would be left disabled. Only the passed properties will be updated. The properties not passed will be left unchanged. Each branch type must have a `kind` property to identify it. Example Body: ``` { \"development\": { \"use_mainbranch\": true }, \"production\": { \"enabled\": true, \"use_mainbranch\": false, \"name\": \"production\" }, \"branch_types\": [ { \"kind\": \"bugfix\", \"enabled\": true, \"prefix\": \"bugfix/\" }, { \"kind\": \"feature\", \"enabled\": true, \"prefix\": \"feature/\" }, { \"kind\": \"hotfix\", \"prefix\": \"hotfix/\" }, { \"kind\": \"release\", \"enabled\": false, } ] } ```
      Parameters:
      workspace - 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}`.
      Returns:
      The updated branching model configuration
    • repositoriesWorkspaceRepoSlugCommitNodeApproveDelete

      @DELETE @Path("/{workspace}/{repo_slug}/commit/{node}/approve") @Produces("application/json") void repositoriesWorkspaceRepoSlugCommitNodeApproveDelete(@PathParam("workspace") String workspace, @PathParam("node") String node, @PathParam("repo_slug") String repoSlug)
      Redact the authenticated user's approval of the specified commit. This operation is only available to users that have explicit access to the repository. In contrast, just the fact that a repository is publicly accessible to users does not give them the ability to approve commits.
      Parameters:
      workspace - 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.
      node - The commit's SHA1.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
    • repositoriesWorkspaceRepoSlugCommitNodeApprovePost

      @POST @Path("/{workspace}/{repo_slug}/commit/{node}/approve") @Produces("application/json") Participant repositoriesWorkspaceRepoSlugCommitNodeApprovePost(@PathParam("workspace") String workspace, @PathParam("node") String node, @PathParam("repo_slug") String repoSlug)
      Approve the specified commit as the authenticated user. This operation is only available to users that have explicit access to the repository. In contrast, just the fact that a repository is publicly accessible to users does not give them the ability to approve commits.
      Parameters:
      workspace - 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.
      node - The commit's SHA1.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      The `participant` object recording that the authenticated user approved the commit.
    • repositoriesWorkspaceRepoSlugCommitNodeCommentsCommentIdGet

      @GET @Path("/{workspace}/{repo_slug}/commit/{node}/comments/{comment_id}") @Produces("application/json") CommitComment repositoriesWorkspaceRepoSlugCommitNodeCommentsCommentIdGet(@PathParam("workspace") String workspace, @PathParam("node") String node, @PathParam("comment_id") Integer commentId, @PathParam("repo_slug") String repoSlug)
      Returns the specified commit comment.
      Parameters:
      workspace - 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.
      node - The commit's SHA1.
      commentId - The id of the comment.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      The commit comment.
    • repositoriesWorkspaceRepoSlugCommitNodeCommentsGet

      @GET @Path("/{workspace}/{repo_slug}/commit/{node}/comments") @Produces("application/json") PaginatedCommitComments repositoriesWorkspaceRepoSlugCommitNodeCommentsGet(@PathParam("workspace") String workspace, @PathParam("node") String node, @PathParam("repo_slug") String repoSlug)
      Returns the commit's comments. This includes both global and inline comments. The default sorting is oldest to newest and can be overridden with the `sort` query parameter.
      Parameters:
      workspace - 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.
      node - The commit's SHA1.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      A paginated list of commit comments.
    • repositoriesWorkspaceRepoSlugCommitNodeCommentsPost

      @POST @Path("/{workspace}/{repo_slug}/commit/{node}/comments") @Consumes("application/json") void repositoriesWorkspaceRepoSlugCommitNodeCommentsPost(@PathParam("node") String node, @PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull CommitComment commitComment)
      Creates new comment on the specified commit. To post a reply to an existing comment, include the `parent.id` field: ``` $ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/commit/db9ba1e031d07a02603eae0e559a7adc010257fc/comments/ \\ -X POST -u evzijst \\ -H 'Content-Type: application/json' \\ -d '{\"content\": {\"raw\": \"One more thing!\"}, \"parent\": {\"id\": 5728901}}' ```
      Parameters:
      node - The commit's SHA1.
      workspace - This can either be the username or the UUID of the user, surrounded by curly-braces, for example: `{user UUID}`.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      commitComment - The specified comment.
    • repositoriesWorkspaceRepoSlugCommitNodeGet

      @GET @Path("/{workspace}/{repo_slug}/commit/{node}") @Produces("application/json") Commit repositoriesWorkspaceRepoSlugCommitNodeGet(@PathParam("workspace") String workspace, @PathParam("node") String node, @PathParam("repo_slug") String repoSlug)
      Returns the specified commit.
      Parameters:
      workspace - 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.
      node - The commit's SHA1.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      The commit object
    • repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyGet

      @GET @Path("/{workspace}/{repo_slug}/commit/{node}/statuses/build/{key}") @Produces("application/json") Commitstatus repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyGet(@PathParam("workspace") String workspace, @PathParam("node") String node, @PathParam("key") String key, @PathParam("repo_slug") String repoSlug)
      Returns the specified build status for a commit.
      Parameters:
      workspace - 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.
      node - The commit's SHA1.
      key - The build status' unique key
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      The build status object with the specified key.
    • repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyPut

      @PUT @Path("/{workspace}/{repo_slug}/commit/{node}/statuses/build/{key}") @Consumes("application/json") @Produces("application/json") Commitstatus repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildKeyPut(@PathParam("workspace") String workspace, @PathParam("node") String node, @PathParam("key") String key, @PathParam("repo_slug") String repoSlug, @Valid @Valid Commitstatus commitstatus)
      Used to update the current status of a build status object on the specific commit. This operation can also be used to change other properties of the build status: * `state` * `name` * `description` * `url` * `refname` The `key` cannot be changed.
      Parameters:
      workspace - 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.
      node - The commit's SHA1.
      key - The build status' unique key
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      commitstatus - The updated build status object
      Returns:
      The updated build status object.
    • repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildPost

      @POST @Path("/{workspace}/{repo_slug}/commit/{node}/statuses/build") @Consumes("application/json") @Produces("application/json") Commitstatus repositoriesWorkspaceRepoSlugCommitNodeStatusesBuildPost(@PathParam("workspace") String workspace, @PathParam("node") String node, @PathParam("repo_slug") String repoSlug, @Valid @Valid Commitstatus commitstatus)
      Creates a new build status against the specified commit. If the specified key already exists, the existing status object will be overwritten. When creating a new commit status, you can use a URI template for the URL. Templates are URLs that contain variable names that Bitbucket will evaluate at runtime whenever the URL is displayed anywhere similar to parameter substitution in [Bitbucket Connect](https://developer.atlassian.com/bitbucket/concepts/context-parameters.html). For example, one could use `https://foo.com/builds/{repository.full_name}` which Bitbucket will turn into `https://foo.com/builds/foo/bar` at render time. The context variables available are `repository` and `commit`.
      Parameters:
      workspace - 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.
      node - The commit's SHA1.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      commitstatus - The new commit status object.
      Returns:
      The newly created build status object.
    • repositoriesWorkspaceRepoSlugCommitNodeStatusesGet

      @GET @Path("/{workspace}/{repo_slug}/commit/{node}/statuses") @Produces("application/json") PaginatedCommitstatuses repositoriesWorkspaceRepoSlugCommitNodeStatusesGet(@PathParam("workspace") String workspace, @PathParam("node") String node, @PathParam("repo_slug") String repoSlug)
      Returns all statuses (e.g. build results) for a specific commit.
      Parameters:
      workspace - 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.
      node - The commit's SHA1.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      A paginated list of all commit statuses for this commit.
    • repositoriesWorkspaceRepoSlugCommitsGet

      @GET @Path("/{workspace}/{repo_slug}/commits") @Produces("application/json") Error repositoriesWorkspaceRepoSlugCommitsGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      These are the repository's commits. They are paginated and returned in reverse chronological order, similar to the output of `git log` and `hg log`. Like these tools, the DAG can be filtered. ## GET /repositories/{workspace}/{repo_slug}/commits/ Returns all commits in the repo in topological order (newest commit first). All branches and tags are included (similar to `git log --all` and `hg log`). ## GET /repositories/{workspace}/{repo_slug}/commits/master Returns all commits on rev `master` (similar to `git log master`, `hg log master`). ## GET /repositories/{workspace}/{repo_slug}/commits/dev?exclude=master Returns all commits on ref `dev`, except those that are reachable on `master` (similar to `git log dev ^master`). ## GET /repositories/{workspace}/{repo_slug}/commits/?exclude=master Returns all commits in the repo that are not on master (similar to `git log --all ^master`). ## GET /repositories/{workspace}/{repo_slug}/commits/?include=foo&include=bar&exclude=fu&exclude=fubar Returns all commits that are on refs `foo` or `bar`, but not on `fu` or `fubar` (similar to `git log foo bar ^fu ^fubar`). An optional `path` parameter can be specified that will limit the results to commits that affect that path. `path` can either be a file or a directory. If a directory is specified, commits are returned that have modified any file in the directory tree rooted by `path`. It is important to note that if the `path` parameter is specified, the commits returned by this endpoint may no longer be a DAG, parent commits that do not modify the path will be omitted from the response. ## GET /repositories/{workspace}/{repo_slug}/commits/?path=README.md&include=foo&include=bar&exclude=master Returns all commits that are on refs `foo` or `bar`, but not on `master` that changed the file README.md. ## GET /repositories/{workspace}/{repo_slug}/commits/?path=src/&include=foo&include=bar&exclude=master Returns all commits that are on refs `foo` or `bar`, but not on `master` that changed to a file in any file in the directory src or its children. Because the response could include a very large number of commits, it is paginated. Follow the 'next' link in the response to navigate to the next page of commits. As with other paginated resources, do not construct your own links. When the include and exclude parameters are more than can fit in a query string, clients can use a `x-www-form-urlencoded` POST instead.
      Parameters:
      workspace - 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}`.
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugCommitsPost

      @POST @Path("/{workspace}/{repo_slug}/commits") @Produces("application/json") Error repositoriesWorkspaceRepoSlugCommitsPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Identical to `GET /repositories/{workspace}/{repo_slug}/commits`, except that POST allows clients to place the include and exclude parameters in the request body to avoid URL length issues. **Note that this resource does NOT support new commit creation.**
      Parameters:
      workspace - 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}`.
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugCommitsRevisionGet

      @GET @Path("/{workspace}/{repo_slug}/commits/{revision}") @Produces("application/json") Error repositoriesWorkspaceRepoSlugCommitsRevisionGet(@PathParam("workspace") String workspace, @PathParam("revision") String revision, @PathParam("repo_slug") String repoSlug)
      These are the repository's commits. They are paginated and returned in reverse chronological order, similar to the output of `git log` and `hg log`. Like these tools, the DAG can be filtered. ## GET /repositories/{workspace}/{repo_slug}/commits/ Returns all commits in the repo in topological order (newest commit first). All branches and tags are included (similar to `git log --all` and `hg log`). ## GET /repositories/{workspace}/{repo_slug}/commits/master Returns all commits on rev `master` (similar to `git log master`, `hg log master`). ## GET /repositories/{workspace}/{repo_slug}/commits/dev?exclude=master Returns all commits on ref `dev`, except those that are reachable on `master` (similar to `git log dev ^master`). ## GET /repositories/{workspace}/{repo_slug}/commits/?exclude=master Returns all commits in the repo that are not on master (similar to `git log --all ^master`). ## GET /repositories/{workspace}/{repo_slug}/commits/?include=foo&include=bar&exclude=fu&exclude=fubar Returns all commits that are on refs `foo` or `bar`, but not on `fu` or `fubar` (similar to `git log foo bar ^fu ^fubar`). An optional `path` parameter can be specified that will limit the results to commits that affect that path. `path` can either be a file or a directory. If a directory is specified, commits are returned that have modified any file in the directory tree rooted by `path`. It is important to note that if the `path` parameter is specified, the commits returned by this endpoint may no longer be a DAG, parent commits that do not modify the path will be omitted from the response. ## GET /repositories/{workspace}/{repo_slug}/commits/?path=README.md&include=foo&include=bar&exclude=master Returns all commits that are on refs `foo` or `bar`, but not on `master` that changed the file README.md. ## GET /repositories/{workspace}/{repo_slug}/commits/?path=src/&include=foo&include=bar&exclude=master Returns all commits that are on refs `foo` or `bar`, but not on `master` that changed to a file in any file in the directory src or its children. Because the response could include a very large number of commits, it is paginated. Follow the 'next' link in the response to navigate to the next page of commits. As with other paginated resources, do not construct your own links. When the include and exclude parameters are more than can fit in a query string, clients can use a `x-www-form-urlencoded` POST instead.
      Parameters:
      workspace - 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.
      revision -
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugCommitsRevisionPost

      @POST @Path("/{workspace}/{repo_slug}/commits/{revision}") @Produces("application/json") Error repositoriesWorkspaceRepoSlugCommitsRevisionPost(@PathParam("workspace") String workspace, @PathParam("revision") String revision, @PathParam("repo_slug") String repoSlug)
      Identical to `GET /repositories/{workspace}/{repo_slug}/commits`, except that POST allows clients to place the include and exclude parameters in the request body to avoid URL length issues. **Note that this resource does NOT support new commit creation.**
      Parameters:
      workspace - 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.
      revision -
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugComponentsComponentIdGet

      @GET @Path("/{workspace}/{repo_slug}/components/{component_id}") @Produces("application/json") Component repositoriesWorkspaceRepoSlugComponentsComponentIdGet(@PathParam("workspace") String workspace, @PathParam("component_id") Integer componentId, @PathParam("repo_slug") String repoSlug)
      Returns the specified issue tracker component object.
      Parameters:
      workspace - 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.
      componentId - The component's id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      The specified component object.
    • repositoriesWorkspaceRepoSlugComponentsGet

      @GET @Path("/{workspace}/{repo_slug}/components") @Produces("application/json") PaginatedComponents repositoriesWorkspaceRepoSlugComponentsGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Returns the components that have been defined in the issue tracker. This resource is only available on repositories that have the issue tracker enabled.
      Parameters:
      workspace - 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}`.
      Returns:
      The components that have been defined in the issue tracker.
    • repositoriesWorkspaceRepoSlugDefaultReviewersGet

      @GET @Path("/{workspace}/{repo_slug}/default-reviewers") void repositoriesWorkspaceRepoSlugDefaultReviewersGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Returns the repository's default reviewers. These are the users that are automatically added as reviewers on every new pull request that is created.
      Parameters:
      workspace - 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}`.
    • repositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernameDelete

      @DELETE @Path("/{workspace}/{repo_slug}/default-reviewers/{target_username}") @Produces("application/json") Error repositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernameDelete(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("target_username") String targetUsername)
      Removes a default reviewer from the repository.
      Parameters:
      workspace - 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}`.
      targetUsername - This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: `{account UUID}`.
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernameGet

      @GET @Path("/{workspace}/{repo_slug}/default-reviewers/{target_username}") @Produces("application/json") Error repositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernameGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("target_username") String targetUsername)
      Returns the specified reviewer. This can be used to test whether a user is among the repository's default reviewers list. A 404 indicates that that specified user is not a default reviewer.
      Parameters:
      workspace - 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}`.
      targetUsername - This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: `{account UUID}`.
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernamePut

      @PUT @Path("/{workspace}/{repo_slug}/default-reviewers/{target_username}") @Produces("application/json") Error repositoriesWorkspaceRepoSlugDefaultReviewersTargetUsernamePut(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("target_username") String targetUsername)
      Adds the specified user to the repository's list of default reviewers. This method is idempotent. Adding a user a second time has no effect.
      Parameters:
      workspace - 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}`.
      targetUsername - This can either be the username or the UUID of the default reviewer, surrounded by curly-braces, for example: `{account UUID}`.
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugDelete

      @DELETE @Path("/{workspace}/{repo_slug}") @Produces("application/json") void repositoriesWorkspaceRepoSlugDelete(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @QueryParam("redirect_to") String redirectTo)
      Deletes the repository. This is an irreversible operation. This does not affect its forks.
      Parameters:
      workspace - 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}`.
      redirectTo - If a repository has been moved to a new location, use this parameter to show users a friendly message in the Bitbucket UI that the repository has moved to a new location. However, a GET to this endpoint will still return a 404.
    • repositoriesWorkspaceRepoSlugDeployKeysGet

      @GET @Path("/{workspace}/{repo_slug}/deploy-keys") @Produces("application/json") PaginatedDeployKeys repositoriesWorkspaceRepoSlugDeployKeysGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Returns all deploy-keys belonging to a repository. Example: ``` $ curl -H \"Authorization \" \\ https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys Output: { \"pagelen\": 10, \"values\": [ { \"id\": 123, \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\", \"label\": \"mykey\", \"type\": \"deploy_key\", \"created_on\": \"2018-08-15T23:50:59.993890+00:00\", \"repository\": { \"full_name\": \"mleu/test\", \"name\": \"test\", \"type\": \"repository\", \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\" }, \"links\":{ \"self\":{ \"href\": \"https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/123\" } } \"last_used\": null, \"comment\": \"mleu@C02W454JHTD8\" } ], \"page\": 1, \"size\": 1 } ```
      Parameters:
      workspace - 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}`.
      Returns:
      Deploy keys matching the repository
    • repositoriesWorkspaceRepoSlugDeployKeysKeyIdDelete

      @DELETE @Path("/{workspace}/{repo_slug}/deploy-keys/{key_id}") @Produces("application/json") void repositoriesWorkspaceRepoSlugDeployKeysKeyIdDelete(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("key_id") String keyId)
      This deletes a deploy key from a repository. Example: ``` $ curl -XDELETE \\ -H \"Authorization \" \\ https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234 ```
      Parameters:
      workspace - 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}`.
      keyId - The key ID matching the deploy key.
    • repositoriesWorkspaceRepoSlugDeployKeysKeyIdGet

      @GET @Path("/{workspace}/{repo_slug}/deploy-keys/{key_id}") @Produces("application/json") DeployKey repositoriesWorkspaceRepoSlugDeployKeysKeyIdGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("key_id") String keyId)
      Returns the deploy key belonging to a specific key. Example: ``` $ curl -H \"Authorization \" \\ https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-key/1234 Output: { \"comment\": \"mleu@C02W454JHTD8\", \"last_used\": null, \"links\": { \"self\": { \"href\": https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-key/1234\" } }, \"repository\": { \"full_name\": \"mleu/test\", \"name\": \"test\", \"type\": \"repository\", \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\" }, \"label\": \"mykey\", \"created_on\": \"2018-08-15T23:50:59.993890+00:00\", \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\", \"id\": 1234, \"type\": \"deploy_key\" } ```
      Parameters:
      workspace - 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}`.
      keyId - The key ID matching the deploy key.
      Returns:
      Deploy key matching the key ID
    • repositoriesWorkspaceRepoSlugDeployKeysKeyIdPut

      @PUT @Path("/{workspace}/{repo_slug}/deploy-keys/{key_id}") @Produces("application/json") DeployKey repositoriesWorkspaceRepoSlugDeployKeysKeyIdPut(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("key_id") String keyId)
      Create a new deploy key in a repository. The same key needs to be passed in but the comment and label can change. Example: ``` $ curl -XPUT \\ -H \"Authorization \" \\ -H \"Content-type: application/json\" \\ https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234 -d \\ '{ \"label\": \"newlabel\", \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 newcomment\", }' Output: { \"comment\": \"newcomment\", \"last_used\": null, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/1234\" } }, \"repository\": { \"full_name\": \"mleu/test\", \"name\": \"test\", \"type\": \"repository\", \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\" }, \"label\": \"newlabel\", \"created_on\": \"2018-08-15T23:50:59.993890+00:00\", \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\", \"id\": 1234, \"type\": \"deploy_key\" } ```
      Parameters:
      workspace - 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}`.
      keyId - The key ID matching the deploy key.
      Returns:
      The newly updated deploy key.
    • repositoriesWorkspaceRepoSlugDeployKeysPost

      @POST @Path("/{workspace}/{repo_slug}/deploy-keys") @Produces("application/json") DeployKey repositoriesWorkspaceRepoSlugDeployKeysPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Create a new deploy key in a repository. Example: ``` $ curl -XPOST \\ -H \"Authorization \" \\ -H \"Content-type: application/json\" \\ https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys -d \\ '{ \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5 mleu@C02W454JHTD8\", \"label\": \"mydeploykey\" }' Output: { \"id\": 123, \"key\": \"ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDAK/b1cHHDr/TEV1JGQl+WjCwStKG6Bhrv0rFpEsYlyTBm1fzN0VOJJYn4ZOPCPJwqse6fGbXntEs+BbXiptR+++HycVgl65TMR0b5ul5AgwrVdZdT7qjCOCgaSV74/9xlHDK8oqgGnfA7ZoBBU+qpVyaloSjBdJfLtPY/xqj4yHnXKYzrtn/uFc4Kp9Tb7PUg9Io3qohSTGJGVHnsVblq/rToJG7L5xIo0OxK0SJSQ5vuId93ZuFZrCNMXj8JDHZeSEtjJzpRCBEXHxpOPhAcbm4MzULgkFHhAVgp4JbkrT99/wpvZ7r9AdkTg7HGqL3rlaDrEcWfL7Lu6TnhBdq5\", \"label\": \"mydeploykey\", \"type\": \"deploy_key\", \"created_on\": \"2018-08-15T23:50:59.993890+00:00\", \"repository\": { \"full_name\": \"mleu/test\", \"name\": \"test\", \"type\": \"repository\", \"uuid\": \"{85d08b4e-571d-44e9-a507-fa476535aa98}\" }, \"links\":{ \"self\":{ \"href\": \"https://api.bitbucket.org/2.0/repositories/mleu/test/deploy-keys/123\" } } \"last_used\": null, \"comment\": \"mleu@C02W454JHTD8\" } ```
      Parameters:
      workspace - 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}`.
      Returns:
      The deploy key that was created
    • repositoriesWorkspaceRepoSlugDiffSpecGet

      @GET @Path("/{workspace}/{repo_slug}/diff/{spec}") @Produces({"text/plain","application/json"}) String repositoriesWorkspaceRepoSlugDiffSpecGet(@PathParam("workspace") String workspace, @PathParam("spec") String spec, @PathParam("repo_slug") String repoSlug, @QueryParam("context") Integer context, @QueryParam("path") String path, @QueryParam("ignore_whitespace") Boolean ignoreWhitespace, @QueryParam("binary") Boolean binary)
      Produces a raw, git-style diff for either a single commit (diffed against its first parent), or a revspec of 2 commits (e.g. `3a8b42..9ff173` where the first commit represents the source and the second commit the destination). In case of the latter (diffing a revspec), a 3-way diff, or merge diff, is computed. This shows the changes introduced by the left branch (`3a8b42` in our example) as compared againt the right branch (`9ff173`). This is equivalent to merging the left branch into the right branch and then computing the diff of the merge commit against its first parent (the right branch). This follows the same behavior as pull requests that also show this style of 3-way, or merge diff. While similar to patches, diffs: * Don't have a commit header (username, commit message, etc) * Support the optional `path=foo/bar.py` query param to filter the diff to just that one file diff The raw diff is returned as-is, in whatever encoding the files in the repository use. It is not decoded into unicode. As such, the content-type is `text/plain`.
      Parameters:
      workspace -
      spec -
      repoSlug -
      context - Generate diffs with <n> lines of context instead of the usual three
      path - Limit the diff to a particular file (this parameter can be repeated for multiple paths)
      ignoreWhitespace - Generate diffs that ignore whitespace
      binary - Generate diffs that include binary files,true if omitted.
      Returns:
      The raw diff
    • repositoriesWorkspaceRepoSlugDiffstatSpecGet

      @GET @Path("/{workspace}/{repo_slug}/diffstat/{spec}") @Produces("application/json") PaginatedDiffstats repositoriesWorkspaceRepoSlugDiffstatSpecGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("spec") String spec, @QueryParam("ignore_whitespace") Boolean ignoreWhitespace)
      Returns the diff stat for the specified commit. Diff stat responses contain a record for every path modified by the commit and lists the number of lines added and removed for each file. Example: ``` curl https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/diffstat/d222fa2..e174964 { \"pagelen\": 500, \"values\": [ { \"type\": \"diffstat\", \"status\": \"modified\", \"lines_removed\": 1, \"lines_added\": 2, \"old\": { \"path\": \"setup.py\", \"type\": \"commit_file\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/src/e1749643d655d7c7014001a6c0f58abaf42ad850/setup.py\" } } }, \"new\": { \"path\": \"setup.py\", \"type\": \"commit_file\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/bitbucket/geordi/src/d222fa235229c55dad20b190b0b571adf737d5a6/setup.py\" } } } } ], \"page\": 1, \"size\": 1 } ```
      Parameters:
      workspace - 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}`.
      spec - A commit SHA (e.g. `3a8b42`) or a commit range using double dot notation (e.g. `3a8b42..9ff173`).
      ignoreWhitespace - Generate diffs that ignore whitespace
      Returns:
      The diff stats
    • repositoriesWorkspaceRepoSlugDownloadsFilenameDelete

      @DELETE @Path("/{workspace}/{repo_slug}/downloads/{filename}") @Produces("application/json") Error repositoriesWorkspaceRepoSlugDownloadsFilenameDelete(@PathParam("workspace") String workspace, @PathParam("filename") String filename, @PathParam("repo_slug") String repoSlug)
      Deletes the specified download artifact from the repository.
      Parameters:
      workspace -
      filename -
      repoSlug -
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugDownloadsFilenameGet

      @GET @Path("/{workspace}/{repo_slug}/downloads/{filename}") @Produces("application/json") Error repositoriesWorkspaceRepoSlugDownloadsFilenameGet(@PathParam("workspace") String workspace, @PathParam("filename") String filename, @PathParam("repo_slug") String repoSlug)
      Return a redirect to the contents of a download artifact. This endpoint returns the actual file contents and not the artifact's metadata. $ curl -s -L https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads/hello.txt Hello World
      Parameters:
      workspace -
      filename -
      repoSlug -
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugDownloadsGet

      @GET @Path("/{workspace}/{repo_slug}/downloads") @Produces("application/json") Error repositoriesWorkspaceRepoSlugDownloadsGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Returns a list of download links associated with the repository.
      Parameters:
      workspace -
      repoSlug -
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugDownloadsPost

      @POST @Path("/{workspace}/{repo_slug}/downloads") @Produces("application/json") Error repositoriesWorkspaceRepoSlugDownloadsPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Upload new download artifacts. To upload files, perform a `multipart/form-data` POST containing one or more `files` fields: $ echo Hello World > hello.txt $ curl -s -u evzijst -X POST https://api.bitbucket.org/2.0/repositories/evzijst/git-tests/downloads -F files=@hello.txt When a file is uploaded with the same name as an existing artifact, then the existing file will be replaced.
      Parameters:
      workspace -
      repoSlug -
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugFilehistoryNodePathGet

      @GET @Path("/{workspace}/{repo_slug}/filehistory/{node}/{path}") @Produces("application/json") PaginatedFiles repositoriesWorkspaceRepoSlugFilehistoryNodePathGet(@PathParam("workspace") String workspace, @PathParam("node") String node, @PathParam("path") String path, @PathParam("repo_slug") String repoSlug, @QueryParam("renames") String renames, @QueryParam("q") String q, @QueryParam("sort") String sort)
      Returns a paginated list of commits that modified the specified file. Commits are returned in reverse chronological order. This is roughly equivalent to the following commands: $ git log --follow --date-order $ hg log --follow By default, Bitbucket will follow renames and the path name in the returned entries reflects that. This can be turned off using the `?renames=false` query parameter. Results are returned in descending chronological order by default, and like most endpoints you can [filter and sort](../../../../../../meta/filtering) the response to only provide exactly the data you want. For example, if you wanted to find commits made before 2011-05-18 against a file named `README.rst`, but you only wanted the path and date, your query would look like this: ``` $ curl 'https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/filehistory/master/README.rst'\\ '?fields=values.next,values.path,values.commit.date&q=commit.date<=2011-05-18' { \"values\": [ { \"commit\": { \"date\": \"2011-05-17T07:32:09+00:00\" }, \"path\": \"README.rst\" }, { \"commit\": { \"date\": \"2011-05-16T06:33:28+00:00\" }, \"path\": \"README.txt\" }, { \"commit\": { \"date\": \"2011-05-16T06:15:39+00:00\" }, \"path\": \"README.txt\" } ] } ``` In the response you can see that the file was renamed to `README.rst` by the commit made on 2011-05-16, and was previously named `README.txt`.
      Parameters:
      workspace -
      node -
      path -
      repoSlug -
      renames - When `true`, Bitbucket will follow the history of the file across renames (this is the default behavior). This can be turned off by specifying `false`.
      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:
      A paginated list of commits that modified the specified file
    • repositoriesWorkspaceRepoSlugForksGet

      @GET @Path("/{workspace}/{repo_slug}/forks") @Produces("application/json") PaginatedRepositories repositoriesWorkspaceRepoSlugForksGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Returns a paginated list of all the forks of the specified repository.
      Parameters:
      workspace - 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}`.
      Returns:
      All forks.
    • repositoriesWorkspaceRepoSlugForksPost

      @POST @Path("/{workspace}/{repo_slug}/forks") @Consumes("application/json") @Produces("application/json") Repository repositoriesWorkspaceRepoSlugForksPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @Valid Repository repository)
      Creates a new fork of the specified repository. By default, forks are created under the authenticated user's account with the same name and slug of the original repository. ``` $ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/forks { \"scm\": \"git\", \"full_name\": \"jdoe/dogslow\", \"parent\": { \"full_name\": \"evzijst/dogslow\", ... }, ... } ``` If you already have a repo with that name, then a 400 is returned and you'll need to specify a custom name for the new fork: ``` $ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/forks \\ -H 'Content-Type: application/json' -d '{ \"name\": \"dogslow_fork\" }' ``` When you specify a value for `name`, it will also affect the `slug`. The `slug` is reflected in the repository URL of the new fork. It is derived from `name` by substituting non-ASCII characters, removes whitespace, and changes characters to lower case. For example, `My repo` would turn into `my_repo`. ## Forking a repository into a team account To create a fork into a team account, specify the new owner's account explicitly as part of the request body. This prevents forked repositories from being owned by the authenticated user submitting the request: ``` $ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/atlassian/bbql/forks \\ -H 'Content-Type: application/json' -d '{ \"name\": \"bbql_fork\", \"owner\": { \"username\": \"atlassian\" } }' ``` To fork a repository into the same team, also specify a new `name`. You need contributor access to create new forks within a team account. ## Change the properties of a new fork By default the fork inherits most of its properties from the parent. However, since the optional POST body document follows the normal `repository` JSON schema and you can override the new fork's properties. Properties that can be overridden include: * description * fork_policy * language * mainbranch * is_private (note that a private repo's fork_policy might prohibit the creation of public forks, in which `is_private=False` would fail) * has_issues (to initialize or disable the new repo's issue tracker -- note that the actual contents of the parent repository's issue tracker are not copied during forking) * has_wiki (to initialize or disable the new repo's wiki -- note that the actual contents of the parent repository's wiki are not copied during forking) * project (only teams have projects and when forking into a private project, the fork's `is_private` must be `true`) Properties that cannot be modified include: * scm * parent * full_name
      Parameters:
      workspace - 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}`.
      repository - A repository object. This can be left blank.
      Returns:
      The newly created fork.
    • repositoriesWorkspaceRepoSlugGet

      @GET @Path("/{workspace}/{repo_slug}") @Produces("application/json") Repository repositoriesWorkspaceRepoSlugGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Returns the object describing this repository.
      Parameters:
      workspace - 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}`.
      Returns:
      The repository object.
    • repositoriesWorkspaceRepoSlugHooksGet

      @GET @Path("/{workspace}/{repo_slug}/hooks") @Produces("application/json") PaginatedWebhookSubscriptions repositoriesWorkspaceRepoSlugHooksGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Returns a paginated list of webhooks installed on this repository.
      Parameters:
      workspace -
      repoSlug -
      Returns:
      The paginated list of installed webhooks.
    • repositoriesWorkspaceRepoSlugHooksPost

      @POST @Path("/{workspace}/{repo_slug}/hooks") @Produces("application/json") WebhookSubscription repositoriesWorkspaceRepoSlugHooksPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Creates a new webhook on the specified repository. Example: ``` $ curl -X POST -u credentials -H 'Content-Type: application/json' https://api.bitbucket.org/2.0/repositories/username/slug/hooks -d ' { \"description\": \"Webhook Description\", \"url\": \"https://example.com/\", \"active\": true, \"events\": [ \"repo:push\", \"issue:created\", \"issue:updated\" ] }' ``` Note that this call requires the webhook scope, as well as any scope that applies to the events that the webhook subscribes to. In the example above that means: `webhook`, `repository` and `issue`. Also note that the `url` must properly resolve and cannot be an internal, non-routed address.
      Parameters:
      workspace -
      repoSlug -
      Returns:
      If the webhook was registered successfully.
    • repositoriesWorkspaceRepoSlugHooksUidDelete

      @DELETE @Path("/{workspace}/{repo_slug}/hooks/{uid}") @Produces("application/json") void repositoriesWorkspaceRepoSlugHooksUidDelete(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("uid") String uid)
      Deletes the specified webhook subscription from the given repository.
      Parameters:
      workspace -
      repoSlug -
      uid - The installed webhook's id
    • repositoriesWorkspaceRepoSlugHooksUidGet

      @GET @Path("/{workspace}/{repo_slug}/hooks/{uid}") @Produces("application/json") WebhookSubscription repositoriesWorkspaceRepoSlugHooksUidGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("uid") String uid)
      Returns the webhook with the specified id installed on the specified repository.
      Parameters:
      workspace -
      repoSlug -
      uid - The installed webhook's id.
      Returns:
      The webhook subscription object.
    • repositoriesWorkspaceRepoSlugHooksUidPut

      @PUT @Path("/{workspace}/{repo_slug}/hooks/{uid}") @Produces("application/json") WebhookSubscription repositoriesWorkspaceRepoSlugHooksUidPut(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("uid") String uid)
      Updates the specified webhook subscription. The following properties can be mutated: * `description` * `url` * `active` * `events`
      Parameters:
      workspace -
      repoSlug -
      uid - The installed webhook's id
      Returns:
      The webhook subscription object.
    • repositoriesWorkspaceRepoSlugIssuesExportPost

      @POST @Path("/{workspace}/{repo_slug}/issues/export") @Produces("application/json") void repositoriesWorkspaceRepoSlugIssuesExportPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      A POST request to this endpoint initiates a new background celery task that archives the repo's issues. For example, you can run: curl -u -X POST http://api.bitbucket.org/2.0/repositories/// issues/export When the job has been accepted, it will return a 202 (Accepted) along with a unique url to this job in the 'Location' response header. This url is the endpoint for where the user can obtain their zip files.\"
      Parameters:
      workspace - 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}`.
    • repositoriesWorkspaceRepoSlugIssuesExportRepoNameIssuesTaskIdZipGet

      @GET @Path("/{workspace}/{repo_slug}/issues/export/{repo_name}-issues-{task_id}.zip") @Produces("application/json") IssueJobStatus repositoriesWorkspaceRepoSlugIssuesExportRepoNameIssuesTaskIdZipGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("repo_name") String repoName, @PathParam("task_id") String taskId)
      This endpoint is used to poll for the progress of an issue export job and return the zip file after the job is complete. As long as the job is running, this will return a 200 response with in the response body a description of the current status. After the job has been scheduled, but before it starts executing, this endpoint's response is: { \"type\": \"issue_job_status\", \"status\": \"ACCEPTED\", \"phase\": \"Initializing\", \"total\": 0, \"count\": 0, \"pct\": 0 } Then once it starts running, it becomes: { \"type\": \"issue_job_status\", \"status\": \"STARTED\", \"phase\": \"Attachments\", \"total\": 15, \"count\": 11, \"pct\": 73 } Once the job has successfully completed, it returns a stream of the zip file.
      Parameters:
      workspace - 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}`.
      repoName - The name of the repo
      taskId - The ID of the export task
      Returns:
      Export job accepted
    • repositoriesWorkspaceRepoSlugIssuesGet

      @GET @Path("/{workspace}/{repo_slug}/issues") @Produces("application/json") PaginatedIssues repositoriesWorkspaceRepoSlugIssuesGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Returns the issues in the issue tracker.
      Parameters:
      workspace - 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}`.
      Returns:
      A paginated list of the issues matching any filter criteria that were provided.
    • repositoriesWorkspaceRepoSlugIssuesImportGet

      @GET @Path("/{workspace}/{repo_slug}/issues/import") @Produces("application/json") IssueJobStatus repositoriesWorkspaceRepoSlugIssuesImportGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      When using GET, this endpoint reports the status of the current import task. Request example: ``` $ curl -u -X GET https://api.bitbucket.org/2.0/repositories///issues/import ``` After the job has been scheduled, but before it starts executing, this endpoint's response is: ``` < HTTP/1.1 202 Accepted { \"type\": \"issue_job_status\", \"status\": \"PENDING\", \"phase\": \"Attachments\", \"total\": 15, \"count\": 0, \"percent\": 0 } ``` Once it starts running, it is a 202 response with status STARTED and progress filled. After it is finished, it becomes a 200 response with status SUCCESS or FAILURE.
      Parameters:
      workspace - 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}`.
      Returns:
      Import job complete with either FAILURE or SUCCESS status
    • repositoriesWorkspaceRepoSlugIssuesImportPost

      @POST @Path("/{workspace}/{repo_slug}/issues/import") @Produces("application/json") IssueJobStatus repositoriesWorkspaceRepoSlugIssuesImportPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      A POST request to this endpoint will import the zip file given by the archive parameter into the repository. All existing issues will be deleted and replaced by the contents of the imported zip file. Imports are done through a multipart/form-data POST. There is one valid and required form field, with the name \"archive,\" which needs to be a file field: ``` $ curl -u -X POST -F archive=@/path/to/file.zip https://api.bitbucket.org/2.0/repositories///issues/import ``` When the import job is accepted, here is example output: ``` < HTTP/1.1 202 Accepted { \"type\": \"issue_job_status\", \"status\": \"ACCEPTED\", \"phase\": \"Attachments\", \"total\": 15, \"count\": 0, \"percent\": 0 } ```
      Parameters:
      workspace - 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}`.
      Returns:
      Import job accepted
    • repositoriesWorkspaceRepoSlugIssuesIssueIdAttachmentsGet

      @GET @Path("/{workspace}/{repo_slug}/issues/{issue_id}/attachments") @Produces("application/json") PaginatedIssueAttachments repositoriesWorkspaceRepoSlugIssuesIssueIdAttachmentsGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("issue_id") Integer issueId)
      Returns all attachments for this issue. This returns the files' meta data. This does not return the files' actual contents. The files are always ordered by their upload date.
      Parameters:
      workspace -
      repoSlug -
      issueId - The issue's id
      Returns:
      A paginated list of all attachments for this issue.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdAttachmentsPathDelete

      @DELETE @Path("/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}") @Produces("application/json") void repositoriesWorkspaceRepoSlugIssuesIssueIdAttachmentsPathDelete(@PathParam("workspace") String workspace, @PathParam("path") String path, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Deletes an attachment.
      Parameters:
      workspace -
      path -
      issueId -
      repoSlug -
    • repositoriesWorkspaceRepoSlugIssuesIssueIdAttachmentsPathGet

      @GET @Path("/{workspace}/{repo_slug}/issues/{issue_id}/attachments/{path}") @Produces("application/json") void repositoriesWorkspaceRepoSlugIssuesIssueIdAttachmentsPathGet(@PathParam("workspace") String workspace, @PathParam("path") String path, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Returns the contents of the specified file attachment. Note that this endpoint does not return a JSON response, but instead returns a redirect pointing to the actual file that in turn will return the raw contents. The redirect URL contains a one-time token that has a limited lifetime. As a result, the link should not be persisted, stored, or shared.
      Parameters:
      workspace -
      path -
      issueId -
      repoSlug -
    • repositoriesWorkspaceRepoSlugIssuesIssueIdAttachmentsPost

      @POST @Path("/{workspace}/{repo_slug}/issues/{issue_id}/attachments") @Produces("application/json") void repositoriesWorkspaceRepoSlugIssuesIssueIdAttachmentsPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("issue_id") Integer issueId)
      Upload new issue attachments. To upload files, perform a `multipart/form-data` POST containing one or more file fields. When a file is uploaded with the same name as an existing attachment, then the existing file will be replaced.
      Parameters:
      workspace -
      repoSlug -
      issueId - The issue's id
    • repositoriesWorkspaceRepoSlugIssuesIssueIdChangesChangeIdGet

      @GET @Path("/{workspace}/{repo_slug}/issues/{issue_id}/changes/{change_id}") @Produces("application/json") IssueChange repositoriesWorkspaceRepoSlugIssuesIssueIdChangesChangeIdGet(@PathParam("workspace") String workspace, @PathParam("change_id") String changeId, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Returns the specified issue change object. This resource is only available on repositories that have the issue tracker enabled.
      Parameters:
      workspace - 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.
      changeId - The issue change id
      issueId - The issue id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      The specified issue change object.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdChangesGet

      @GET @Path("/{workspace}/{repo_slug}/issues/{issue_id}/changes") @Produces("application/json") PaginatedLogEntries repositoriesWorkspaceRepoSlugIssuesIssueIdChangesGet(@PathParam("workspace") String workspace, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug, @QueryParam("q") String q, @QueryParam("sort") String sort)
      Returns the list of all changes that have been made to the specified issue. Changes are returned in chronological order with the oldest change first. Each time an issue is edited in the UI or through the API, an immutable change record is created under the `/issues/123/changes` endpoint. It also has a comment associated with the change. Note that this operation is changing significantly, due to privacy changes. See the [announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#changes-to-the-issue-changes-api) for details. ``` $ curl -s https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/issues/1/changes - | jq . { \"pagelen\": 20, \"values\": [ { \"changes\": { \"priority\": { \"new\": \"trivial\", \"old\": \"major\" }, \"assignee\": { \"new\": \"\", \"old\": \"evzijst\" }, \"assignee_account_id\": { \"new\": \"\", \"old\": \"557058:c0b72ad0-1cb5-4018-9cdc-0cde8492c443\" }, \"kind\": { \"new\": \"enhancement\", \"old\": \"bug\" } }, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/issues/1/changes/2\" }, \"html\": { \"href\": \"https://bitbucket.org/evzijst/dogslow/issues/1#comment-2\" } }, \"issue\": { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/issues/1\" } }, \"type\": \"issue\", \"id\": 1, \"repository\": { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/evzijst/dogslow\" }, \"html\": { \"href\": \"https://bitbucket.org/evzijst/dogslow\" }, \"avatar\": { \"href\": \"https://bitbucket.org/evzijst/dogslow/avatar/32/\" } }, \"type\": \"repository\", \"name\": \"dogslow\", \"full_name\": \"evzijst/dogslow\", \"uuid\": \"{988b17c6-1a47-4e70-84ee-854d5f012bf6}\" }, \"title\": \"Updated title\" }, \"created_on\": \"2018-03-03T00:35:28.353630+00:00\", \"user\": { \"username\": \"evzijst\", \"nickname\": \"evzijst\", \"display_name\": \"evzijst\", \"type\": \"user\", \"uuid\": \"{aaa7972b-38af-4fb1-802d-6e3854c95778}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/evzijst\" }, \"html\": { \"href\": \"https://bitbucket.org/evzijst/\" }, \"avatar\": { \"href\": \"https://bitbucket.org/account/evzijst/avatar/32/\" } } }, \"message\": { \"raw\": \"Removed assignee, changed kind and priority.\", \"markup\": \"markdown\", \"html\": \"

      Removed assignee, changed kind and priority.\", \"type\": \"rendered\" }, \"type\": \"issue_change\", \"id\": 2 } ], \"page\": 1 } ``` Changes support [filtering and sorting](../../../meta/filtering) that can be used to search for specific changes. For instance, to see when an issue transitioned to \"resolved\": ``` $ curl -s https://api.bitbucket.org/2.0/repositories/site/master/issues/1/changes \\ -G --data-urlencode='q=changes.state.new = \"resolved\"' ``` This resource is only available on repositories that have the issue tracker enabled. N.B. The `changes.assignee` and `changes.assignee_account_id` fields are not a `user` object. Instead, they contain the raw `username` and `account_id` of the user. This is to protect the integrity of the audit log even after a user account gets deleted. The `changes.assignee` field is deprecated will disappear in the future. Use `changes.assignee_account_id` instead.

      Parameters:
      workspace - 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.
      issueId - The issue id
      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. See [filtering and sorting](../../../meta/filtering) for details.
      sort - Name of a response property to sort results. See [filtering and sorting](../../../meta/filtering#query-sort) for details.
      Returns:
      Returns all the issue changes that were made on the specified issue.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdChangesPost

      @POST @Path("/{workspace}/{repo_slug}/issues/{issue_id}/changes") @Consumes("application/json") @Produces("application/json") IssueChange repositoriesWorkspaceRepoSlugIssuesIssueIdChangesPost(@PathParam("workspace") String workspace, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull IssueChange issueChange)
      Makes a change to the specified issue. For example, to change an issue's state and assignee, create a new change object that modifies these fields: ``` curl https://api.bitbucket.org/2.0/site/master/issues/1234/changes \\ -s -u evzijst -X POST -H \"Content-Type: application/json\" \\ -d '{ \"changes\": { \"assignee_account_id\": { \"new\": \"557058:c0b72ad0-1cb5-4018-9cdc-0cde8492c443\" }, \"state\": { \"new\": 'resolved\" } } \"message\": { \"raw\": \"This is now resolved.\" } }' ``` The above example also includes a custom comment to go alongside the change. This comment will also be visible on the issue page in the UI. The fields of the `changes` object are strings, not objects. This allows for immutable change log records, even after user accounts, milestones, or other objects recorded in a change entry, get renamed or deleted. The `assignee_account_id` field stores the account id. When POSTing a new change and changing the assignee, the client should therefore use the user's account_id in the `changes.assignee_account_id.new` field. This call requires authentication. Private repositories or private issue trackers require the caller to authenticate with an account that has appropriate authorization.
      Parameters:
      workspace - 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.
      issueId - The issue id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      issueChange - The new issue state change. The only required elements are `changes.[].new`. All other elements can be omitted from the body.
      Returns:
      The newly created issue change.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdCommentsCommentIdDelete

      @DELETE @Path("/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}") @Consumes("application/json") void repositoriesWorkspaceRepoSlugIssuesIssueIdCommentsCommentIdDelete(@PathParam("comment_id") String commentId, @PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("issue_id") String issueId, @Valid @NotNull @Valid @NotNull IssueComment issueComment)
      Deletes the specified comment.
      Parameters:
      commentId -
      workspace - This can either be the username or the UUID of the user, surrounded by curly-braces, for example: `{user UUID}`.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      issueId - The ID of the issue that is being queried.
      issueComment - The updated comment.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdCommentsCommentIdGet

      @GET @Path("/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}") @Produces("application/json") IssueComment repositoriesWorkspaceRepoSlugIssuesIssueIdCommentsCommentIdGet(@PathParam("comment_id") String commentId, @PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("issue_id") String issueId)
      Returns the specified issue comment object.
      Parameters:
      commentId -
      workspace - This can either be the username or the UUID of the user, surrounded by curly-braces, for example: `{user UUID}`.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      issueId - The ID of the issue that is being queried.
      Returns:
      The issue comment.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdCommentsCommentIdPut

      @PUT @Path("/{workspace}/{repo_slug}/issues/{issue_id}/comments/{comment_id}") @Consumes("application/json") @Produces("application/json") IssueComment repositoriesWorkspaceRepoSlugIssuesIssueIdCommentsCommentIdPut(@PathParam("comment_id") String commentId, @PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("issue_id") String issueId, @Valid @NotNull @Valid @NotNull IssueComment issueComment)
      Updates the content of the specified issue comment. Note that only the `content.raw` field can be modified. ``` $ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/issues/42/comments/5728901 \\ -X PUT -u evzijst \\ -H 'Content-Type: application/json' \\ -d '{\"content\": {\"raw\": \"Lorem ipsum.\"}' ```
      Parameters:
      commentId -
      workspace - This can either be the username or the UUID of the user, surrounded by curly-braces, for example: `{user UUID}`.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      issueId - The ID of the issue that is being queried.
      issueComment - The updated comment.
      Returns:
      The updated issue comment.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdCommentsGet

      @GET @Path("/{workspace}/{repo_slug}/issues/{issue_id}/comments") @Produces("application/json") PaginatedIssueComments repositoriesWorkspaceRepoSlugIssuesIssueIdCommentsGet(@PathParam("issue_id") String issueId, @PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @QueryParam("q") String q)
      Returns a paginated list of all comments that were made on the specified issue. The default sorting is oldest to newest and can be overridden with the `sort` query parameter. This endpoint also supports filtering and sorting of the results. See [filtering and sorting](../../../../../../meta/filtering) for more details.
      Parameters:
      issueId -
      workspace - This can either be the username or the UUID of the user, surrounded by curly-braces, for example: `{user UUID}`.
      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).
      Returns:
      A paginated list of issue comments.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdCommentsPost

      @POST @Path("/{workspace}/{repo_slug}/issues/{issue_id}/comments") @Consumes("application/json") @Produces("application/json") void repositoriesWorkspaceRepoSlugIssuesIssueIdCommentsPost(@PathParam("issue_id") String issueId, @PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull IssueComment issueComment)
      Creates a new issue comment. ``` $ curl https://api.bitbucket.org/2.0/repositories/atlassian/prlinks/issues/42/comments/ \\ -X POST -u evzijst \\ -H 'Content-Type: application/json' \\ -d '{\"content\": {\"raw\": \"Lorem ipsum.\"}}' ```
      Parameters:
      issueId -
      workspace - This can either be the username or the UUID of the user, surrounded by curly-braces, for example: `{user UUID}`.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      issueComment - The new issue comment object.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdDelete

      @DELETE @Path("/{workspace}/{repo_slug}/issues/{issue_id}") @Produces("application/json") Issue repositoriesWorkspaceRepoSlugIssuesIssueIdDelete(@PathParam("workspace") String workspace, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Deletes the specified issue. This requires write access to the repository.
      Parameters:
      workspace - 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.
      issueId - The issue id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      The issue object.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdGet

      @GET @Path("/{workspace}/{repo_slug}/issues/{issue_id}") @Produces("application/json") Issue repositoriesWorkspaceRepoSlugIssuesIssueIdGet(@PathParam("workspace") String workspace, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Returns the specified issue.
      Parameters:
      workspace - 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.
      issueId - The issue id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      The issue object.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdPut

      @PUT @Path("/{workspace}/{repo_slug}/issues/{issue_id}") @Produces("application/json") Issue repositoriesWorkspaceRepoSlugIssuesIssueIdPut(@PathParam("workspace") String workspace, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Modifies the issue. ``` $ curl https://api.bitbucket.org/2.0/repostories/evzijst/dogslow/issues/123 \\ -u evzijst -s -X PUT -H 'Content-Type: application/json' \\ -d '{ \"title\": \"Updated title\", \"assignee\": { \"username\": \"evzijst\" }, \"priority\": \"minor\", \"version\": { \"name\": \"1.0\" }, \"component\": null }' ``` This example changes the `title`, `assignee`, `priority` and the `version`. It also removes the value of the `component` from the issue by setting the field to `null`. Any field not present keeps its existing value. Each time an issue is edited in the UI or through the API, an immutable change record is created under the `/issues/123/changes` endpoint. It also has a comment associated with the change.
      Parameters:
      workspace - 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.
      issueId - The issue id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      The updated issue object.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdVoteDelete

      @DELETE @Path("/{workspace}/{repo_slug}/issues/{issue_id}/vote") @Produces("application/json") Error repositoriesWorkspaceRepoSlugIssuesIssueIdVoteDelete(@PathParam("workspace") String workspace, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Retract your vote.
      Parameters:
      workspace - 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.
      issueId - The issue id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdVoteGet

      @GET @Path("/{workspace}/{repo_slug}/issues/{issue_id}/vote") @Produces("application/json") Error repositoriesWorkspaceRepoSlugIssuesIssueIdVoteGet(@PathParam("workspace") String workspace, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Check whether the authenticated user has voted for this issue. A 204 status code indicates that the user has voted, while a 404 implies they haven't.
      Parameters:
      workspace - 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.
      issueId - The issue id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      If the authenticated user has not voted for this issue.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdVotePut

      @PUT @Path("/{workspace}/{repo_slug}/issues/{issue_id}/vote") @Produces("application/json") Error repositoriesWorkspaceRepoSlugIssuesIssueIdVotePut(@PathParam("workspace") String workspace, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Vote for this issue. To cast your vote, do an empty PUT. The 204 status code indicates that the operation was successful.
      Parameters:
      workspace - 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.
      issueId - The issue id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      Indicating the authenticated user has cast their vote successfully.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdWatchDelete

      @DELETE @Path("/{workspace}/{repo_slug}/issues/{issue_id}/watch") @Produces("application/json") Error repositoriesWorkspaceRepoSlugIssuesIssueIdWatchDelete(@PathParam("workspace") String workspace, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Stop watching this issue.
      Parameters:
      workspace - 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.
      issueId - The issue id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      Indicates that the authenticated user successfully stopped watching this issue.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdWatchGet

      @GET @Path("/{workspace}/{repo_slug}/issues/{issue_id}/watch") @Produces("application/json") Error repositoriesWorkspaceRepoSlugIssuesIssueIdWatchGet(@PathParam("workspace") String workspace, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Indicated whether or not the authenticated user is watching this issue.
      Parameters:
      workspace - 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.
      issueId - The issue id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      If the authenticated user is watching this issue.
    • repositoriesWorkspaceRepoSlugIssuesIssueIdWatchPut

      @PUT @Path("/{workspace}/{repo_slug}/issues/{issue_id}/watch") @Produces("application/json") Error repositoriesWorkspaceRepoSlugIssuesIssueIdWatchPut(@PathParam("workspace") String workspace, @PathParam("issue_id") String issueId, @PathParam("repo_slug") String repoSlug)
      Start watching this issue. To start watching this issue, do an empty PUT. The 204 status code indicates that the operation was successful.
      Parameters:
      workspace - 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.
      issueId - The issue id
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      Indicates that the authenticated user successfully started watching this issue.
    • repositoriesWorkspaceRepoSlugIssuesPost

      @POST @Path("/{workspace}/{repo_slug}/issues") @Consumes("application/json") @Produces("application/json") Issue repositoriesWorkspaceRepoSlugIssuesPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull Issue issue)
      Creates a new issue. This call requires authentication. Private repositories or private issue trackers require the caller to authenticate with an account that has appropriate authorization. The authenticated user is used for the issue's `reporter` field.
      Parameters:
      workspace - 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}`.
      issue - The new issue. The only required element is `title`. All other elements can be omitted from the body.
      Returns:
      The newly created issue.
    • repositoriesWorkspaceRepoSlugMilestonesGet

      @GET @Path("/{workspace}/{repo_slug}/milestones") @Produces("application/json") PaginatedMilestones repositoriesWorkspaceRepoSlugMilestonesGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Returns the milestones that have been defined in the issue tracker. This resource is only available on repositories that have the issue tracker enabled.
      Parameters:
      workspace - 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}`.
      Returns:
      The milestones that have been defined in the issue tracker.
    • repositoriesWorkspaceRepoSlugMilestonesMilestoneIdGet

      @GET @Path("/{workspace}/{repo_slug}/milestones/{milestone_id}") @Produces("application/json") Milestone repositoriesWorkspaceRepoSlugMilestonesMilestoneIdGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("milestone_id") Integer milestoneId)
      Returns the specified issue tracker milestone object.
      Parameters:
      workspace - 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}`.
      milestoneId - The milestone's id
      Returns:
      The specified milestone object.
    • repositoriesWorkspaceRepoSlugPatchSpecGet

      @GET @Path("/{workspace}/{repo_slug}/patch/{spec}") @Produces("application/json") void repositoriesWorkspaceRepoSlugPatchSpecGet(@PathParam("workspace") String workspace, @PathParam("spec") String spec, @PathParam("repo_slug") String repoSlug)
      Produces a raw patch for a single commit (diffed against its first parent), or a patch-series for a revspec of 2 commits (e.g. `3a8b42..9ff173` where the first commit represents the source and the second commit the destination). In case of the latter (diffing a revspec), a patch series is returned for the commits on the source branch (`3a8b42` and its ancestors in our example). For Mercurial, a single patch is returned that combines the changes of all commits on the source branch. While similar to diffs, patches: * Have a commit header (username, commit message, etc) * Do not support the `path=foo/bar.py` query parameter The raw patch is returned as-is, in whatever encoding the files in the repository use. It is not decoded into unicode. As such, the content-type is `text/plain`.
      Parameters:
      workspace -
      spec -
      repoSlug -
    • repositoriesWorkspaceRepoSlugPost

      @POST @Path("/{workspace}/{repo_slug}") @Consumes("application/json") @Produces("application/json") Repository repositoriesWorkspaceRepoSlugPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @Valid Repository repository)
      Creates a new repository. Note: In order to set the project for the newly created repository, pass in either the project key or the project UUID as part of the request body as shown in the examples below: ``` $ curl -X POST -H \"Content-Type: application/json\" -d '{ \"scm\": \"git\", \"project\": { \"key\": \"MARS\" } }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding ``` or ``` $ curl -X POST -H \"Content-Type: application/json\" -d '{ \"scm\": \"git\", \"project\": { \"key\": \"{ba516952-992a-4c2d-acbd-17d502922f96}\" } }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding ``` The project must only be assigned for repositories belonging to a team. If the repository owner is a team and the project is not provided, the repository is automatically assigned to the oldest project in the team. Note: In the examples above, the username `teamsinspace`, and/or the repository name `hablanding` can be replaced by UUIDs.
      Parameters:
      workspace - 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}`.
      repository - The repository that is to be created. Note that most object elements are optional. Elements \"owner\" and \"full_name\" are ignored as the URL implies them.
      Returns:
      The newly created repository.
    • repositoriesWorkspaceRepoSlugPullrequestsActivityGet

      @GET @Path("/{workspace}/{repo_slug}/pullrequests/activity") @Produces("application/json") void repositoriesWorkspaceRepoSlugPullrequestsActivityGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pull_request_id") String pullRequestId)
      Returns a paginated list of the pull request's activity log. This includes comments that were made by the reviewers, updates and approvals.
      Parameters:
      workspace - 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}`.
      pullRequestId - The id of the pull request.
    • repositoriesWorkspaceRepoSlugPullrequestsGet

      @GET @Path("/{workspace}/{repo_slug}/pullrequests") @Produces("application/json") PaginatedPullrequests repositoriesWorkspaceRepoSlugPullrequestsGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @QueryParam("state") String state)
      Returns all pull requests on the specified repository. By default only open pull requests are returned. This can be controlled using the `state` query parameter. To retrieve pull requests that are in one of multiple states, repeat the `state` parameter for each individual state. This endpoint also supports filtering and sorting of the results. See [filtering and sorting](../../../../meta/filtering) for more details.
      Parameters:
      workspace - 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}`.
      state - Only return pull requests that are in this state. This parameter can be repeated.
      Returns:
      All pull requests on the specified repository.
    • repositoriesWorkspaceRepoSlugPullrequestsPost

      @POST @Path("/{workspace}/{repo_slug}/pullrequests") @Consumes("application/json") @Produces("application/json") Pullrequest repositoriesWorkspaceRepoSlugPullrequestsPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @Valid Pullrequest pullrequest)
      Creates a new pull request where the destination repository is this repository and the author is the authenticated user. The minimum required fields to create a pull request are `title` and `source`, specified by a branch name. ``` curl https://api.bitbucket.org/2.0/repositories/my-username/my-repository/pullrequests \\ -u my-username:my-password \\ --request POST \\ --header 'Content-Type: application/json' \\ --data '{ \"title\": \"My Title\", \"source\": { \"branch\": { \"name\": \"staging\" } } }' ``` If the pull request's `destination` is not specified, it will default to the `repository.mainbranch`. To open a pull request to a different branch, say from a feature branch to a staging branch, specify a `destination` (same format as the `source`): ``` { \"title\": \"My Title\", \"source\": { \"branch\": { \"name\": \"my-feature-branch\" } }, \"destination\": { \"branch\": { \"name\": \"staging\" } } } ``` Reviewers can be specified by adding an array of user objects as the `reviewers` property. ``` { \"title\": \"My Title\", \"source\": { \"branch\": { \"name\": \"my-feature-branch\" } }, \"reviewers\": [ { \"uuid\": \"{504c3b62-8120-4f0c-a7bc-87800b9d6f70}\" } ] } ``` Other fields: * `description` - a string * `close_source_branch` - boolean that specifies if the source branch should be closed upon merging
      Parameters:
      workspace - 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}`.
      pullrequest - The new pull request. The request URL you POST to becomes the destination repository URL. For this reason, you must specify an explicit source repository in the request object if you want to pull from a different repository (fork). Since not all elements are required or even mutable, you only need to include the elements you want to initialize, such as the source branch and the title.
      Returns:
      The newly created pull request.
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdActivityGet

      @GET @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/activity") @Produces("application/json") PaginatedActivities repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdActivityGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pull_request_id") String pullRequestId)
      Returns a paginated list of the pull request's activity log. This includes comments that were made by the reviewers, updates and approvals.
      Parameters:
      workspace - 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}`.
      pullRequestId - The id of the pull request.
      Returns:
      The pull request activity log
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApproveDelete

      @DELETE @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve") @Produces("application/json") void repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApproveDelete(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("repo_slug") String repoSlug)
      Redact the authenticated user's approval of the specified pull request.
      Parameters:
      workspace -
      pullRequestId -
      repoSlug -
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApprovePost

      @POST @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/approve") @Produces("application/json") Participant repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdApprovePost(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("repo_slug") String repoSlug)
      Approve the specified pull request as the authenticated user.
      Parameters:
      workspace -
      pullRequestId -
      repoSlug -
      Returns:
      The `participant` object recording that the authenticated user approved the pull request.
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdDelete

      @DELETE @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}") @Produces("application/json") void repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdDelete(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("comment_id") String commentId, @PathParam("repo_slug") String repoSlug)
      Deletes a specific pull request comment.
      Parameters:
      workspace -
      pullRequestId -
      commentId -
      repoSlug -
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdGet

      @GET @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}") @Produces("application/json") PaginatedPullrequestComments repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdGet(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("comment_id") String commentId, @PathParam("repo_slug") String repoSlug)
      Returns a specific pull request comment.
      Parameters:
      workspace -
      pullRequestId -
      commentId -
      repoSlug -
      Returns:
      The comment.
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdPut

      @PUT @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments/{comment_id}") @Consumes("application/json") @Produces("application/json") Comment repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsCommentIdPut(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("comment_id") String commentId, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull Comment comment)
      Updates a specific pull request comment.
      Parameters:
      workspace -
      pullRequestId -
      commentId -
      repoSlug -
      comment - The contents of the updated comment.
      Returns:
      The updated comment.
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsGet

      @GET @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments") @Produces("application/json") PaginatedPullrequestComments repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pull_request_id") String pullRequestId)
      Returns a paginated list of the pull request's comments. This includes both global, inline comments and replies. The default sorting is oldest to newest and can be overridden with the `sort` query parameter. This endpoint also supports filtering and sorting of the results. See [filtering and sorting](../../../../../../meta/filtering) for more details.
      Parameters:
      workspace - 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}`.
      pullRequestId - The id of the pull request.
      Returns:
      A paginated list of comments made on the given pull request, in reverse chronological order.
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsPost

      @POST @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/comments") @Consumes("application/json") @Produces("application/json") Comment repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommentsPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pull_request_id") String pullRequestId, @Valid @NotNull @Valid @NotNull Comment comment)
      Creates a new pull request comment. Returns the newly created pull request comment.
      Parameters:
      workspace - 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}`.
      pullRequestId - The id of the pull request.
      comment - The comment object.
      Returns:
      The newly created comment.
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommitsGet

      @GET @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/commits") @Produces("application/json") PaginatedPullrequestsCommits repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdCommitsGet(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("repo_slug") String repoSlug)
      Returns a paginated list of the pull request's commits. These are the commits that are being merged into the destination branch when the pull requests gets accepted.
      Parameters:
      workspace -
      pullRequestId -
      repoSlug -
      Returns:
      Ok.
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDeclinePost

      @POST @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/decline") @Produces("application/json") Pullrequest repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDeclinePost(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("repo_slug") String repoSlug)
      Declines the pull request.
      Parameters:
      workspace -
      pullRequestId -
      repoSlug -
      Returns:
      The pull request object.
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDiffGet

      @GET @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diff") void repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDiffGet(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("repo_slug") String repoSlug)
      Redirects to the [repository diff](../../diff/%7Bspec%7D) with the revspec that corresponds to the pull request.
      Parameters:
      workspace -
      pullRequestId -
      repoSlug -
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDiffstatGet

      @GET @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/diffstat") void repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdDiffstatGet(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("repo_slug") String repoSlug)
      Redirects to the [repository diffstat](../../diffstat/%7Bspec%7D) with the revspec that corresponds to the pull request.
      Parameters:
      workspace -
      pullRequestId -
      repoSlug -
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdGet

      @GET @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}") @Produces("application/json") Pullrequest repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pull_request_id") String pullRequestId)
      Returns the specified pull request.
      Parameters:
      workspace - 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}`.
      pullRequestId - The id of the pull request.
      Returns:
      The pull request object
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergePost

      @POST @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/merge") @Consumes("application/json") @Produces("application/json") Pullrequest repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdMergePost(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("repo_slug") String repoSlug, @Valid @Valid PullrequestMergeParameters pullrequestMergeParameters)
      Merges the pull request.
      Parameters:
      workspace -
      pullRequestId -
      repoSlug -
      pullrequestMergeParameters -
      Returns:
      The pull request object.
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPatchGet

      @GET @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/patch") @Produces("application/json") Error repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPatchGet(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("repo_slug") String repoSlug)
      Parameters:
      workspace -
      pullRequestId -
      repoSlug -
      Returns:
      Unexpected error.
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPut

      @PUT @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}") @Consumes("application/json") @Produces("application/json") Pullrequest repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdPut(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pull_request_id") String pullRequestId, @Valid @Valid Pullrequest pullrequest)
      Mutates the specified pull request. This can be used to change the pull request's branches or description. Only open pull requests can be mutated.
      Parameters:
      workspace - 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}`.
      pullRequestId - The id of the pull request.
      pullrequest - The pull request that is to be updated.
      Returns:
      The updated pull request
    • repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet

      @GET @Path("/{workspace}/{repo_slug}/pullrequests/{pull_request_id}/statuses") @Produces("application/json") PaginatedCommitstatuses repositoriesWorkspaceRepoSlugPullrequestsPullRequestIdStatusesGet(@PathParam("workspace") String workspace, @PathParam("pull_request_id") String pullRequestId, @PathParam("repo_slug") String repoSlug)
      Returns all statuses (e.g. build results) for the given pull request.
      Parameters:
      workspace - 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.
      pullRequestId - The id of the pull request.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      A paginated list of all commit statuses for this pull request.
    • repositoriesWorkspaceRepoSlugPut

      @PUT @Path("/{workspace}/{repo_slug}") @Consumes("application/json") @Produces("application/json") Repository repositoriesWorkspaceRepoSlugPut(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @Valid Repository repository)
      Since this endpoint can be used to both update and to create a repository, the request body depends on the intent. ### Creation See the POST documentation for the repository endpoint for an example of the request body. ### Update Note: Changing the `name` of the repository will cause the location to be changed. This is because the URL of the repo is derived from the name (a process called slugification). In such a scenario, it is possible for the request to fail if the newly created slug conflicts with an existing repository's slug. But if there is no conflict, the new location will be returned in the `Location` header of the response.
      Parameters:
      workspace - 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}`.
      repository - The repository that is to be updated. Note that the elements \"owner\" and \"full_name\" are ignored since the URL implies them.
      Returns:
      The existing repository has been updated
    • repositoriesWorkspaceRepoSlugRefsBranchesGet

      @GET @Path("/{workspace}/{repo_slug}/refs/branches") @Produces("application/json") PaginatedBranches repositoriesWorkspaceRepoSlugRefsBranchesGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @QueryParam("q") String q, @QueryParam("sort") String sort)
      Returns a list of all open branches within the specified repository. Results will be in the order the source control manager returns them. ``` $ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches | jq . { \"pagelen\": 10, \"values\": [ { \"heads\": [ { \"hash\": \"f1a0933ce59e809f190602655e22ae6ec107c397\", \"type\": \"commit\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/f1a0933ce59e809f190602655e22ae6ec107c397\" } } } ], \"type\": \"named_branch\", \"name\": \"default\", \"links\": { \"commits\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commits/default\" }, \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches/default\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/branch/default\" } }, \"target\": { \"hash\": \"f1a0933ce59e809f190602655e22ae6ec107c397\", \"repository\": { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial\" }, \"avatar\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/avatar/32/\" } }, \"type\": \"repository\", \"name\": \"mercurial\", \"full_name\": \"seanfarley/mercurial\", \"uuid\": \"{73dcbd61-e506-4fc1-9ecd-31be2b6d6031}\" }, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397\" }, \"comments\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/comments\" }, \"patch\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/patch/f1a0933ce59e809f190602655e22ae6ec107c397\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/f1a0933ce59e809f190602655e22ae6ec107c397\" }, \"diff\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/diff/f1a0933ce59e809f190602655e22ae6ec107c397\" }, \"approve\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/approve\" }, \"statuses\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/statuses\" } }, \"author\": { \"raw\": \"Martin von Zweigbergk <martinvonz@google.com>\", \"type\": \"author\", \"user\": { \"username\": \"martinvonz\", \"nickname\": \"martinvonz\", \"display_name\": \"Martin von Zweigbergk\", \"type\": \"user\", \"uuid\": \"{fdb0e657-3ade-4fad-a136-95f1ffe4a5ac}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/martinvonz\" }, \"html\": { \"href\": \"https://bitbucket.org/martinvonz/\" }, \"avatar\": { \"href\": \"https://bitbucket.org/account/martinvonz/avatar/32/\" } } } }, \"parents\": [ { \"hash\": \"5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\", \"type\": \"commit\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\" } } } ], \"date\": \"2018-02-01T18:44:49+00:00\", \"message\": \"config: replace a for-else by any()\", \"type\": \"commit\" } }, { \"heads\": [ { \"hash\": \"1d60ad093792706e1dc7a52b20942593f2c19655\", \"type\": \"commit\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/1d60ad093792706e1dc7a52b20942593f2c19655\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/1d60ad093792706e1dc7a52b20942593f2c19655\" } } } ], \"type\": \"named_branch\", \"name\": \"stable\", \"links\": { \"commits\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commits/stable\" }, \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches/stable\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/branch/stable\" } }, \"target\": { \"hash\": \"1d60ad093792706e1dc7a52b20942593f2c19655\", \"repository\": { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial\" }, \"avatar\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/avatar/32/\" } }, \"type\": \"repository\", \"name\": \"mercurial\", \"full_name\": \"seanfarley/mercurial\", \"uuid\": \"{73dcbd61-e506-4fc1-9ecd-31be2b6d6031}\" }, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/1d60ad093792706e1dc7a52b20942593f2c19655\" }, \"comments\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/1d60ad093792706e1dc7a52b20942593f2c19655/comments\" }, \"patch\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/patch/1d60ad093792706e1dc7a52b20942593f2c19655\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/1d60ad093792706e1dc7a52b20942593f2c19655\" }, \"diff\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/diff/1d60ad093792706e1dc7a52b20942593f2c19655\" }, \"approve\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/1d60ad093792706e1dc7a52b20942593f2c19655/approve\" }, \"statuses\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/1d60ad093792706e1dc7a52b20942593f2c19655/statuses\" } }, \"author\": { \"raw\": \"Augie Fackler <raf@durin42.com>\", \"type\": \"author\", \"user\": { \"username\": \"durin42\", \"nickname\": \"durin42\", \"display_name\": \"Augie Fackler\", \"type\": \"user\", \"uuid\": \"{e07dc61f-bb05-4218-b43a-d991f26be65a}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/durin42\" }, \"html\": { \"href\": \"https://bitbucket.org/durin42/\" }, \"avatar\": { \"href\": \"https://bitbucket.org/account/durin42/avatar/32/\" } } } }, \"parents\": [ { \"hash\": \"56a0da11bde519d79168e890df4bcf0da62f0a7b\", \"type\": \"commit\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/56a0da11bde519d79168e890df4bcf0da62f0a7b\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/56a0da11bde519d79168e890df4bcf0da62f0a7b\" } } } ], \"date\": \"2018-02-01T19:13:41+00:00\", \"message\": \"Added signature for changeset d334afc585e2\", \"type\": \"commit\" } } ], \"page\": 1, \"size\": 2 } ``` Branches support [filtering and sorting](../../../../../meta/filtering) that can be used to search for specific branches. For instance, to find all branches that have \"stab\" in their name: ``` curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches -G --data-urlencode 'q=name ~ \"stab\"' ``` By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running \"$ hg branches\" or \"$ git branch --list\". Note that this follows simple lexical ordering of the ref names. This can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are sorted [\"v10\", \"v11\", \"v9\"] instead of [\"v9\", \"v10\", \"v11\"]. Sorting can be changed using the ?q= query parameter. When using ?q=name to explicitly sort on ref name, Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings.
      Parameters:
      workspace - This can either be the username or the UUID of the user, surrounded by curly-braces, for example: `{user UUID}`.
      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 - Field by which the results should be sorted as per [filtering and sorting](../../../../../../meta/filtering). The `name` field is handled specially for branches in that, if specified as the sort field, it uses a natural sort order instead of the default lexicographical sort order. For example, it will return ['branch1', 'branch2', 'branch10'] instead of ['branch1', 'branch10', 'branch2'].
      Returns:
      A paginated list of branches matching any filter criteria that were provided.
    • repositoriesWorkspaceRepoSlugRefsBranchesNameDelete

      @DELETE @Path("/{workspace}/{repo_slug}/refs/branches/{name}") @Produces("application/json") void repositoriesWorkspaceRepoSlugRefsBranchesNameDelete(@PathParam("workspace") String workspace, @PathParam("name") String name, @PathParam("repo_slug") String repoSlug)
      Delete a branch in the specified repository. The main branch is not allowed to be deleted and will return a 400 response. For Git, the branch name should not include any prefixes (e.g. refs/heads). For Mercurial, this closes all open heads on the branch, sets the author of the commit to the authenticated caller, and changes the date to the datetime of the call.
      Parameters:
      workspace - 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.
      name - The name of the branch.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
    • repositoriesWorkspaceRepoSlugRefsBranchesNameGet

      @GET @Path("/{workspace}/{repo_slug}/refs/branches/{name}") @Produces("application/json") Branch repositoriesWorkspaceRepoSlugRefsBranchesNameGet(@PathParam("workspace") String workspace, @PathParam("name") String name, @PathParam("repo_slug") String repoSlug)
      Returns a branch object within the specified repository. ``` $ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches/default | jq . { \"heads\": [ { \"hash\": \"f1a0933ce59e809f190602655e22ae6ec107c397\", \"type\": \"commit\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/f1a0933ce59e809f190602655e22ae6ec107c397\" } } } ], \"type\": \"named_branch\", \"name\": \"default\", \"links\": { \"commits\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commits/default\" }, \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/refs/branches/default\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/branch/default\" } }, \"target\": { \"hash\": \"f1a0933ce59e809f190602655e22ae6ec107c397\", \"repository\": { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial\" }, \"avatar\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/avatar/32/\" } }, \"type\": \"repository\", \"name\": \"mercurial\", \"full_name\": \"seanfarley/mercurial\", \"uuid\": \"{73dcbd61-e506-4fc1-9ecd-31be2b6d6031}\" }, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397\" }, \"comments\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/comments\" }, \"patch\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/patch/f1a0933ce59e809f190602655e22ae6ec107c397\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/f1a0933ce59e809f190602655e22ae6ec107c397\" }, \"diff\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/diff/f1a0933ce59e809f190602655e22ae6ec107c397\" }, \"approve\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/approve\" }, \"statuses\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/f1a0933ce59e809f190602655e22ae6ec107c397/statuses\" } }, \"author\": { \"raw\": \"Martin von Zweigbergk <martinvonz@google.com>\", \"type\": \"author\", \"user\": { \"username\": \"martinvonz\", \"nickname\": \"martinvonz\", \"display_name\": \"Martin von Zweigbergk\", \"type\": \"user\", \"uuid\": \"{fdb0e657-3ade-4fad-a136-95f1ffe4a5ac}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/martinvonz\" }, \"html\": { \"href\": \"https://bitbucket.org/martinvonz/\" }, \"avatar\": { \"href\": \"https://bitbucket.org/account/martinvonz/avatar/32/\" } } } }, \"parents\": [ { \"hash\": \"5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\", \"type\": \"commit\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/mercurial/commit/5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/mercurial/commits/5523aabb85c30ebc2b8e29aadcaf5e13fa92b375\" } } } ], \"date\": \"2018-02-01T18:44:49+00:00\", \"message\": \"config: replace a for-else by any()\", \"type\": \"commit\" } } ``` This call requires authentication. Private repositories require the caller to authenticate with an account that has appropriate authorization. For Git, the branch name should not include any prefixes (e.g. refs/heads). For Mercurial, the response will include an additional field that lists the open heads.
      Parameters:
      workspace - 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.
      name - The name of the branch.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      The branch object.
    • repositoriesWorkspaceRepoSlugRefsBranchesPost

      @POST @Path("/{workspace}/{repo_slug}/refs/branches") @Produces("application/json") Branch repositoriesWorkspaceRepoSlugRefsBranchesPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Creates a new branch in the specified repository. The payload of the POST should consist of a JSON document that contains the name of the tag and the target hash. ``` curl https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/branches \\ -s -u seanfarley -X POST -H \"Content-Type: application/json\" \\ -d '{ \"name\" : \"smf/create-feature\", \"target\" : { \"hash\" : \"default\", } }' ``` This call requires authentication. Private repositories require the caller to authenticate with an account that has appropriate authorization. For Git, the branch name should not include any prefixes (e.g. refs/heads). This endpoint does support using short hash prefixes for the commit hash, but it may return a 400 response if the provided prefix is ambiguous. Using a full commit hash is the preferred approach. For Mercurial, the authenticated user making this call is the author of the new branch commit and the date is current datetime of the call.
      Parameters:
      workspace - 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}`.
      Returns:
      The newly created branch object.
    • repositoriesWorkspaceRepoSlugRefsGet

      @GET @Path("/{workspace}/{repo_slug}/refs") @Produces("application/json") PaginatedRefs repositoriesWorkspaceRepoSlugRefsGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @QueryParam("q") String q, @QueryParam("sort") String sort)
      Returns the branches and tags in the repository. By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running \"$ git show-ref\". Note that this follows simple lexical ordering of the ref names. This can be undesirable as it does apply any natural sorting semantics, meaning for instance that refs are sorted [\"branch1\", \"branch10\", \"branch2\", \"v10\", \"v11\", \"v9\"] instead of [\"branch1\", \"branch2\", \"branch10\", \"v9\", \"v10\", \"v11\"]. Sorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name, Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings.
      Parameters:
      workspace - This can either be the username or the UUID of the user, surrounded by curly-braces, for example: `{user UUID}`.
      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 - Field by which the results should be sorted as per [filtering and sorting](../../../../../../meta/filtering). The `name` field is handled specially for refs in that, if specified as the sort field, it uses a natural sort order instead of the default lexicographical sort order. For example, it will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2'].
      Returns:
      A paginated list of refs matching any filter criteria that were provided.
    • repositoriesWorkspaceRepoSlugRefsTagsGet

      @GET @Path("/{workspace}/{repo_slug}/refs/tags") @Produces("application/json") PaginatedTags repositoriesWorkspaceRepoSlugRefsTagsGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @QueryParam("q") String q, @QueryParam("sort") String sort)
      Returns the tags in the repository. By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running \"$ hg tags\" or \"$ git tag --list\". Note that this follows simple lexical ordering of the ref names. This can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are sorted [\"v10\", \"v11\", \"v9\"] instead of [\"v9\", \"v10\", \"v11\"]. Sorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name, Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings.
      Parameters:
      workspace - This can either be the username or the UUID of the user, surrounded by curly-braces, for example: `{user UUID}`.
      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 - Field by which the results should be sorted as per [filtering and sorting](../../../../../../meta/filtering). The `name` field is handled specially for tags in that, if specified as the sort field, it uses a natural sort order instead of the default lexicographical sort order. For example, it will return ['1.1', '1.2', '1.10'] instead of ['1.1', '1.10', '1.2'].
      Returns:
      A paginated list of tags matching any filter criteria that were provided.
    • repositoriesWorkspaceRepoSlugRefsTagsNameDelete

      @DELETE @Path("/{workspace}/{repo_slug}/refs/tags/{name}") @Produces("application/json") void repositoriesWorkspaceRepoSlugRefsTagsNameDelete(@PathParam("workspace") String workspace, @PathParam("name") String name, @PathParam("repo_slug") String repoSlug)
      Delete a tag in the specified repository. For Git, the tag name should not include any prefixes (e.g. refs/tags). For Mercurial, this adds a commit to the main branch that removes the specified tag.
      Parameters:
      workspace - 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.
      name - The name of the tag.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
    • repositoriesWorkspaceRepoSlugRefsTagsNameGet

      @GET @Path("/{workspace}/{repo_slug}/refs/tags/{name}") @Produces("application/json") Tag repositoriesWorkspaceRepoSlugRefsTagsNameGet(@PathParam("workspace") String workspace, @PathParam("name") String name, @PathParam("repo_slug") String repoSlug)
      Returns the specified tag. ``` $ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8 -G | jq . { \"name\": \"3.8\", \"links\": { \"commits\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commits/3.8\" }, \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/hg/commits/tag/3.8\" } }, \"tagger\": { \"raw\": \"Matt Mackall <mpm@selenic.com>\", \"type\": \"author\", \"user\": { \"username\": \"mpmselenic\", \"nickname\": \"mpmselenic\", \"display_name\": \"Matt Mackall\", \"type\": \"user\", \"uuid\": \"{a4934530-db4c-419c-a478-9ab4964c2ee7}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/mpmselenic\" }, \"html\": { \"href\": \"https://bitbucket.org/mpmselenic/\" }, \"avatar\": { \"href\": \"https://bitbucket.org/account/mpmselenic/avatar/32/\" } } } }, \"date\": \"2016-05-01T18:52:25+00:00\", \"message\": \"Added tag 3.8 for changeset f85de28eae32\", \"type\": \"tag\", \"target\": { \"hash\": \"f85de28eae32e7d3064b1a1321309071bbaaa069\", \"repository\": { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/hg\" }, \"avatar\": { \"href\": \"https://bitbucket.org/seanfarley/hg/avatar/32/\" } }, \"type\": \"repository\", \"name\": \"hg\", \"full_name\": \"seanfarley/hg\", \"uuid\": \"{c75687fb-e99d-4579-9087-190dbd406d30}\" }, \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069\" }, \"comments\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/comments\" }, \"patch\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/patch/f85de28eae32e7d3064b1a1321309071bbaaa069\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/hg/commits/f85de28eae32e7d3064b1a1321309071bbaaa069\" }, \"diff\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/diff/f85de28eae32e7d3064b1a1321309071bbaaa069\" }, \"approve\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/approve\" }, \"statuses\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/statuses\" } }, \"author\": { \"raw\": \"Sean Farley <sean@farley.io>\", \"type\": \"author\", \"user\": { \"username\": \"seanfarley\", \"nickname\": \"seanfarley\", \"display_name\": \"Sean Farley\", \"type\": \"user\", \"uuid\": \"{a295f8a8-5876-4d43-89b5-3ad8c6c3c51d}\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/users/seanfarley\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/\" }, \"avatar\": { \"href\": \"https://bitbucket.org/account/seanfarley/avatar/32/\" } } } }, \"parents\": [ { \"hash\": \"9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2\", \"type\": \"commit\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2\" }, \"html\": { \"href\": \"https://bitbucket.org/seanfarley/hg/commits/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2\" } } } ], \"date\": \"2016-05-01T04:21:17+00:00\", \"message\": \"debian: alphabetize build deps\", \"type\": \"commit\" } } ```
      Parameters:
      workspace - 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.
      name - The name of the tag.
      repoSlug - This can either be the repository slug or the UUID of the repository, surrounded by curly-braces, for example: `{repository UUID}`.
      Returns:
      The tag object.
    • repositoriesWorkspaceRepoSlugRefsTagsPost

      @POST @Path("/{workspace}/{repo_slug}/refs/tags") @Consumes("application/json") @Produces("application/json") Tag repositoriesWorkspaceRepoSlugRefsTagsPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull Tag tag)
      Creates a new tag in the specified repository. The payload of the POST should consist of a JSON document that contains the name of the tag and the target hash. ``` curl https://api.bitbucket.org/2.0/repositories/jdoe/myrepo/refs/tags \\ -s -u jdoe -X POST -H \"Content-Type: application/json\" \\ -d '{ \"name\" : \"new-tag-name\", \"target\" : { \"hash\" : \"a1b2c3d4e5f6\", } }' ``` This endpoint does support using short hash prefixes for the commit hash, but it may return a 400 response if the provided prefix is ambiguous. Using a full commit hash is the preferred approach.
      Parameters:
      workspace - 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}`.
      tag -
      Returns:
      The newly created tag.
    • repositoriesWorkspaceRepoSlugSrcGet

      @GET @Path("/{workspace}/{repo_slug}/src") @Produces("application/json") PaginatedTreeentries repositoriesWorkspaceRepoSlugSrcGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @QueryParam("format") String format)
      This endpoint redirects the client to the directory listing of the root directory on the main branch. This is equivalent to directly hitting [/2.0/repositories/{workspace}/{repo_slug}/src/{node}/{path}](src/%7Bnode%7D/%7Bpath%7D) without having to know the name or SHA1 of the repo's main branch. To create new commits, [POST to this endpoint](#post)
      Parameters:
      workspace -
      repoSlug -
      format - Instead of returning the file's contents, return the (json) meta data for it.
      Returns:
      If the path matches a file, then the raw contents of the file are returned (unless the `format=meta` query parameter was provided, in which case a json document containing the file's meta data is returned). If the path matches a directory, then a paginated list of file and directory entries is returned (if the `format=meta` query parameter was provided, then the json document containing the directory's meta data is returned).
    • repositoriesWorkspaceRepoSlugSrcNodePathGet

      @GET @Path("/{workspace}/{repo_slug}/src/{node}/{path}") @Produces("application/json") PaginatedTreeentries repositoriesWorkspaceRepoSlugSrcNodePathGet(@PathParam("workspace") String workspace, @PathParam("node") String node, @PathParam("path") String path, @PathParam("repo_slug") String repoSlug, @QueryParam("format") String format, @QueryParam("q") String q, @QueryParam("sort") String sort, @QueryParam("max_depth") Integer maxDepth)
      This endpoints is used to retrieve the contents of a single file, or the contents of a directory at a specified revision. ## Raw file contents When `path` points to a file, this endpoint returns the raw contents. The response's Content-Type is derived from the filename extension (not from the contents). The file contents are not processed and no character encoding/recoding is performed and as a result no character encoding is included as part of the Content-Type. The `Content-Disposition` header will be \"attachment\" to prevent browsers from running executable files. If the file is managed by LFS, then a 301 redirect pointing to Atlassian's media services platform is returned. The response includes an ETag that is based on the contents of the file and its attributes. This means that an empty `__init__.py` always returns the same ETag, regardless on the directory it lives in, or the commit it is on. ## File meta data When the request for a file path includes the query parameter `?format=meta`, instead of returning the file's raw contents, Bitbucket instead returns the JSON object describing the file's properties: ```javascript $ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef/tests/__init__.py?format=meta { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py\" }, \"meta\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py?format=meta\" } }, \"path\": \"tests/__init__.py\", \"commit\": { \"type\": \"commit\", \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\" } } }, \"attributes\": [], \"type\": \"commit_file\", \"size\": 0 } ``` File objects contain an `attributes` element that contains a list of possible modifiers. Currently defined values are: * `link` -- indicates that the entry is a symbolic link. The contents of the file represent the path the link points to. * `executable` -- indicates that the file has the executable bit set. * `subrepository` -- indicates that the entry points to a submodule or subrepo. The contents of the file is the SHA1 of the repository pointed to. * `binary` -- indicates whether Bitbucket thinks the file is binary. This endpoint can provide an alternative to how a HEAD request can be used to check for the existence of a file, or a file's size without incurring the overhead of receiving its full contents. ## Directory listings When `path` points to a directory instead of a file, the response is a paginated list of directory and file objects in the same order as the underlying SCM system would return them. For example: ```javascript $ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef/tests { \"pagelen\": 10, \"values\": [ { \"path\": \"tests/test_project\", \"type\": \"commit_directory\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/\" }, \"meta\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/?format=meta\" } }, \"commit\": { \"type\": \"commit\", \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\" } } } }, { \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py\" }, \"meta\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/__init__.py?format=meta\" } }, \"path\": \"tests/__init__.py\", \"commit\": { \"type\": \"commit\", \"hash\": \"eefd5ef5d3df01aed629f650959d6706d54cd335\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/commit/eefd5ef5d3df01aed629f650959d6706d54cd335\" }, \"html\": { \"href\": \"https://bitbucket.org/atlassian/bbql/commits/eefd5ef5d3df01aed629f650959d6706d54cd335\" } } }, \"attributes\": [], \"type\": \"commit_file\", \"size\": 0 } ], \"page\": 1, \"size\": 2 } ``` When listing the contents of the repo's root directory, the use of a trailing slash at the end of the URL is required. The response by default is not recursive, meaning that only the direct contents of a path are returned. The response does not recurse down into subdirectories. In order to \"walk\" the entire directory tree, the client can either parse each response and follow the `self` links of each `commit_directory` object, or can specify a `max_depth` to recurse to. The max_depth parameter will do a breadth-first search to return the contents of the subdirectories up to the depth specified. Breadth-first search was chosen as it leads to the least amount of file system operations for git. If the `max_depth` parameter is specified to be too large, the call will time out and return a 555. Each returned object is either a `commit_file`, or a `commit_directory`, both of which contain a `path` element. This path is the absolute path from the root of the repository. Each object also contains a `commit` object which embeds the commit the file is on. Note that this is merely the commit that was used in the URL. It is *not* the commit that last modified the file. Directory objects have 2 representations. Their `self` link returns the paginated contents of the directory. The `meta` link on the other hand returns the actual `directory` object itself, e.g.: ```javascript { \"path\": \"tests/test_project\", \"type\": \"commit_directory\", \"links\": { \"self\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/\" }, \"meta\": { \"href\": \"https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src/eefd5ef5d3df01aed629f650959d6706d54cd335/tests/test_project/?format=meta\" } }, \"commit\": { ... } } ``` ## Querying, filtering and sorting Like most API endpoints, this API supports the Bitbucket querying/filtering syntax and so you could filter a directory listing to only include entries that match certain criteria. For instance, to list all binary files over 1kb use the expression: `size > 1024 and attributes = \"binary\"` which after urlencoding yields the query string: `?q=size%3E1024+and+attributes%3D%22binary%22` To change the ordering of the response, use the `?sort` parameter: `.../src/eefd5ef/?sort=-size` See [filtering and sorting](../../../../../../meta/filtering) for more details.
      Parameters:
      workspace -
      node -
      path -
      repoSlug -
      format - If 'meta' is provided, returns the (json) meta data for the contents of the file. If 'rendered' is provided, returns the contents of a non-binary file in HTML-formatted rendered markup. Since Git and Mercurial do not generally track what text encoding scheme is used, this endpoint attempts to detect the most appropriate character encoding. While usually correct, determining the character encoding can be ambiguous which in exceptional cases can lead to misinterpretation of the characters. As such, the raw element in the response object should not be treated as equivalent to the file's actual contents.
      q - Optional filter expression as per [filtering and sorting](../../../../../../meta/filtering).
      sort - Optional sorting parameter as per [filtering and sorting](../../../../../../meta/filtering#query-sort).
      maxDepth - If provided, returns the contents of the repository and its subdirectories recursively until the specified max_depth of nested directories. When omitted, this defaults to 1.
      Returns:
      If the path matches a file, then the raw contents of the file are returned. If the `format=meta` query parameter is provided, a json document containing the file's meta data is returned. If the `format=rendered` query parameter is provided, the contents of the file in HTML-formated rendered markup is returned. If the path matches a directory, then a paginated list of file and directory entries is returned (if the `format=meta` query parameter was provided, then the json document containing the directory's meta data is returned.)
    • repositoriesWorkspaceRepoSlugSrcPost

      @POST @Path("/{workspace}/{repo_slug}/src") @Produces("application/json") void repositoriesWorkspaceRepoSlugSrcPost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @QueryParam("message") String message, @QueryParam("author") String author, @QueryParam("parents") String parents, @QueryParam("files") String files, @QueryParam("files") String files2, @QueryParam("branch") String branch)
      This endpoint is used to create new commits in the repository by uploading files. To add a new file to a repository: ``` $ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \\ -F /repo/path/to/image.png=@image.png ``` This will create a new commit on top of the main branch, inheriting the contents of the main branch, but adding (or overwriting) the `image.png` file to the repository in the `/repo/path/to` directory. To create a commit that deletes files, use the `files` parameter: ``` $ curl https://api.bitbucket.org/2.0/repositories/username/slug/src \\ -F files=/file/to/delete/1.txt \\ -F files=/file/to/delete/2.txt ``` You can add/modify/delete multiple files in a request. Rename/move a file by deleting the old path and adding the content at the new path. This endpoint accepts `multipart/form-data` (as in the examples above), as well as `application/x-www-form-urlencoded`. ## multipart/form-data A `multipart/form-data` post contains a series of \"form fields\" that identify both the individual files that are being uploaded, as well as additional, optional meta data. Files are uploaded in file form fields (those that have a `Content-Disposition` parameter) whose field names point to the remote path in the repository where the file should be stored. Path field names are always interpreted to be absolute from the root of the repository, regardless whether the client uses a leading slash (as the above `curl` example did). File contents are treated as bytes and are not decoded as text. The commit message, as well as other non-file meta data for the request, is sent along as normal form field elements. Meta data fields share the same namespace as the file objects. For `multipart/form-data` bodies that should not lead to any ambiguity, as the `Content-Disposition` header will contain the `filename` parameter to distinguish between a file named \"message\" and the commit message field. ## application/x-www-form-urlencoded It is also possible to upload new files using a simple `application/x-www-form-urlencoded` POST. This can be convenient when uploading pure text files: ``` $ curl https://api.bitbucket.org/2.0/repositories/atlassian/bbql/src \\ --data-urlencode \"/path/to/me.txt=Lorem ipsum.\" \\ --data-urlencode \"message=Initial commit\" \\ --data-urlencode \"author=Erik van Zijst <erik.van.zijst@gmail.com>\" ``` There could be a field name clash if a client were to upload a file named \"message\", as this filename clashes with the meta data property for the commit message. To avoid this and to upload files whose names clash with the meta data properties, use a leading slash for the files, e.g. `curl --data-urlencode \"/message=file contents\"`. When an explicit slash is omitted for a file whose path matches that of a meta data parameter, then it is interpreted as meta data, not as a file. ## Executables and links While this API aims to facilitate the most common use cases, it is possible to perform some more advanced operations like creating a new symlink in the repository, or creating an executable file. Files can be supplied with a `x-attributes` value in the `Content-Disposition` header. For example, to upload an executable file, as well as create a symlink from `README.txt` to `README`: ``` --===============1438169132528273974== Content-Type: text/plain; charset=\"us-ascii\" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-ID: \"bin/shutdown.sh\" Content-Disposition: attachment; filename=\"shutdown.sh\"; x-attributes:\"executable\" #!/bin/sh halt --===============1438169132528273974== Content-Type: text/plain; charset=\"us-ascii\" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-ID: \"/README.txt\" Content-Disposition: attachment; filename=\"README.txt\"; x-attributes:\"link\" README --===============1438169132528273974==-- ``` Links are files that contain the target path and have `x-attributes:\"link\"` set. When overwriting links with files, or vice versa, the newly uploaded file determines both the new contents, as well as the attributes. That means uploading a file without specifying `x-attributes=\"link\"` will create a regular file, even if the parent commit hosted a symlink at the same path. The same applies to executables. When modifying an existing executable file, the form-data file element must include `x-attributes=\"executable\"` in order to preserve the executable status of the file. Note that this API does not support the creation or manipulation of subrepos / submodules.
      Parameters:
      workspace -
      repoSlug -
      message - The commit message. When omitted, Bitbucket uses a canned string.
      author - The raw string to be used as the new commit's author. This string follows the format `Erik van Zijst <evzijst@atlassian.com>`. When omitted, Bitbucket uses the authenticated user's full/display name and primary email address. Commits cannot be created anonymously.
      parents - A comma-separated list of SHA1s of the commits that should be the parents of the newly created commit. When omitted, the new commit will inherit from and become a child of the main branch's tip/HEAD commit. When more than one SHA1 is provided, the first SHA1 identifies the commit from which the content will be inherited. When more than 2 parents are provided on a Mercurial repo, a 400 is returned as Mercurial does not support octopus merges.
      files - Optional field that declares the files that the request is manipulating. When adding a new file to a repo, or when overwriting an existing file, the client can just upload the full contents of the file in a normal form field and the use of this `files` meta data field is redundant. However, when the `files` field contains a file path that does not have a corresponding, identically-named form field, then Bitbucket interprets that as the client wanting to replace the named file with the null set and the file is deleted instead. Paths in the repo that are referenced in neither files nor an individual file field, remain unchanged and carry over from the parent to the new commit. This API does not support renaming as an explicit feature. To rename a file, simply delete it and recreate it under the new name in the same commit.
      files2 - The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new HEAD/tip. When a branch name is provided that already exists in the repo, then the commit will be created on top of that branch. In this case, if a parent SHA1 was also provided, then it is asserted that the parent is the branch's tip/HEAD at the time the request is made. When this is not the case, a 409 is returned. This API cannot be used to create new anonymous heads in Mercurial repos. When a new branch name is specified (that does not already exist in the repo), and no parent SHA1s are provided, then the new commit will inherit from the current main branch's tip/HEAD commit, but not advance the main branch. The new commit will be the new branch. When the request also specifies a parent SHA1, then the new commit and branch are created directly on top of the parent commit, regardless of the state of the main branch. When a branch name is not specified, but a parent SHA1 is provided, then Bitbucket asserts that it represents the main branch's current HEAD/tip, or a 409 is returned. When a branch name is not specified and the repo is empty, the new commit will become the repo's root commit and will be on the main branch. When a branch name is specified and the repo is empty, the new commit will become the repo's root commit and also define the repo's main branch going forward. This API cannot be used to create additional root commits in non-empty repos. The branch field cannot be repeated. As a side effect, this API can be used to create a new branch without modifying any files, by specifying a new branch name in this field, together with parents, but omitting the files fields, while not sending any files. This will create a new commit and branch with the same contents as the first parent. The diff of this commit against its first parent will be empty.
      branch - The name of the branch that the new commit should be created on. When omitted, the commit will be created on top of the main branch and will become the main branch's new head. When a branch name is provided that already exists in the repo, then the commit will be created on top of that branch. In this case, *if* a parent SHA1 was also provided, then it is asserted that the parent is the branch's tip/HEAD at the time the request is made. When this is not the case, a 409 is returned. This API cannot be used to create new anonymous heads in Mercurial repositories. When a new branch name is specified (that does not already exist in the repo), and no parent SHA1s are provided, then the new commit will inherit from the current main branch's tip/HEAD commit, but not advance the main branch. The new commit will be the new branch. When the request *also* specifies a parent SHA1, then the new commit and branch are created directly on top of the parent commit, regardless of the state of the main branch. When a branch name is not specified, but a parent SHA1 is provided, then Bitbucket asserts that it represents the main branch's current HEAD/tip, or a 409 is returned. When a branch name is not specified and the repo is empty, the new commit will become the repo's root commit and will be on the main branch. When a branch name is specified and the repo is empty, the new commit will become the repo's root commit and also define the repo's main branch going forward. This API cannot be used to create additional root commits in non-empty repos. The branch field cannot be repeated. As a side effect, this API can be used to create a new branch without modifying any files, by specifying a new branch name in this field, together with `parents`, but omitting the `files` fields, while not sending any files. This will create a new commit and branch with the same contents as the first parent. The diff of this commit against its first parent will be empty.
    • repositoriesWorkspaceRepoSlugVersionsGet

      @GET @Path("/{workspace}/{repo_slug}/versions") @Produces("application/json") PaginatedVersions repositoriesWorkspaceRepoSlugVersionsGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Returns the versions that have been defined in the issue tracker. This resource is only available on repositories that have the issue tracker enabled.
      Parameters:
      workspace - 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}`.
      Returns:
      The versions that have been defined in the issue tracker.
    • repositoriesWorkspaceRepoSlugVersionsVersionIdGet

      @GET @Path("/{workspace}/{repo_slug}/versions/{version_id}") @Produces("application/json") Version repositoriesWorkspaceRepoSlugVersionsVersionIdGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("version_id") Integer versionId)
      Returns the specified issue tracker version object.
      Parameters:
      workspace - 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}`.
      versionId - The version's id
      Returns:
      The specified version object.
    • repositoriesWorkspaceRepoSlugWatchersGet

      @GET @Path("/{workspace}/{repo_slug}/watchers") void repositoriesWorkspaceRepoSlugWatchersGet(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug)
      Returns a paginated list of all the watchers on the specified repository.
      Parameters:
      workspace - 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}`.
    • stopPipeline

      @POST @Path("/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/stopPipeline") @Produces("application/json") void stopPipeline(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pipeline_uuid") String pipelineUuid)
      Signal the stop of a pipeline and all of its steps that not have completed yet.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipelineUuid - The UUID of the pipeline.
    • updateCommitHostedPropertyValue

      @PUT @Path("/{workspace}/{repo_slug}/commit/{commit}/properties/{app_key}/{property_name}") void updateCommitHostedPropertyValue(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("commit") String commit, @PathParam("app_key") String appKey, @PathParam("property_name") String propertyName)
      Update an application property value stored against a commit.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      commit - The commit.
      appKey - The key of the Connect app.
      propertyName - The name of the property.
    • updateEnvironmentForRepository

      @POST @Path("/{workspace}/{repo_slug}/environments/{environment_uuid}/changes/") @Produces("application/json") void updateEnvironmentForRepository(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("environment_uuid") String environmentUuid)
      Update an environment
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      environmentUuid - The environment UUID.
    • updatePullRequestHostedPropertyValue

      @PUT @Path("/{workspace}/{repo_slug}/pullrequests/{pullrequest_id}/properties/{app_key}/{property_name}") void updatePullRequestHostedPropertyValue(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("pullrequest_id") String pullrequestId, @PathParam("app_key") String appKey, @PathParam("property_name") String propertyName)
      Update an application property value stored against a pull request.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pullrequestId - The pull request ID.
      appKey - The key of the Connect app.
      propertyName - The name of the property.
    • updateRepositoryBuildNumber

      @PUT @Path("/{workspace}/{repo_slug}/pipelines_config/build_number") @Consumes("application/json") @Produces("application/json") PipelineBuildNumber updateRepositoryBuildNumber(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull PipelineBuildNumber pipelineBuildNumber)
      Update the next build number that should be assigned to a pipeline. The next build number that will be configured has to be strictly higher than the current latest build number for this repository.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipelineBuildNumber - The build number to update.
      Returns:
      The build number has been configured.
    • updateRepositoryHostedPropertyValue

      @PUT @Path("/{workspace}/{repo_slug}/properties/{app_key}/{property_name}") void updateRepositoryHostedPropertyValue(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("app_key") String appKey, @PathParam("property_name") String propertyName)
      Update an application property value stored against a repository.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      appKey - The key of the Connect app.
      propertyName - The name of the property.
    • updateRepositoryPipelineConfig

      @PUT @Path("/{workspace}/{repo_slug}/pipelines_config") @Consumes("application/json") @Produces("application/json") PipelinesConfig updateRepositoryPipelineConfig(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull PipelinesConfig pipelinesConfig)
      Update the pipelines configuration for a repository.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipelinesConfig - The updated repository pipelines configuration.
      Returns:
      The repository pipelines configuration was updated.
    • updateRepositoryPipelineKeyPair

      @PUT @Path("/{workspace}/{repo_slug}/pipelines_config/ssh/key_pair") @Consumes("application/json") @Produces("application/json") PipelineSshKeyPair updateRepositoryPipelineKeyPair(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @Valid @NotNull @Valid @NotNull PipelineSshKeyPair pipelineSshKeyPair)
      Create or update the repository SSH key pair. The private key will be set as a default SSH identity in your build container.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      pipelineSshKeyPair - The created or updated SSH key pair.
      Returns:
      The SSH key pair was created or updated.
    • updateRepositoryPipelineKnownHost

      @PUT @Path("/{workspace}/{repo_slug}/pipelines_config/ssh/known_hosts/{known_host_uuid}") @Consumes("application/json") @Produces("application/json") PipelineKnownHost updateRepositoryPipelineKnownHost(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("known_host_uuid") String knownHostUuid, @Valid @NotNull @Valid @NotNull PipelineKnownHost pipelineKnownHost)
      Update a repository level known host.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      knownHostUuid - The UUID of the known host to update.
      pipelineKnownHost - The updated known host.
      Returns:
      The known host was updated.
    • updateRepositoryPipelineSchedule

      @PUT @Path("/{workspace}/{repo_slug}/pipelines_config/schedules/{schedule_uuid}") @Consumes("application/json") @Produces("application/json") PipelineSchedule updateRepositoryPipelineSchedule(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("schedule_uuid") String scheduleUuid, @Valid @NotNull @Valid @NotNull PipelineSchedule pipelineSchedule)
      Update a schedule.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      scheduleUuid - The uuid of the schedule.
      pipelineSchedule - The schedule to update.
      Returns:
      The schedule is updated.
    • updateRepositoryPipelineVariable

      @PUT @Path("/{workspace}/{repo_slug}/pipelines_config/variables/{variable_uuid}") @Consumes("application/json") @Produces("application/json") PipelineVariable updateRepositoryPipelineVariable(@PathParam("workspace") String workspace, @PathParam("repo_slug") String repoSlug, @PathParam("variable_uuid") String variableUuid, @Valid @NotNull @Valid @NotNull PipelineVariable pipelineVariable)
      Update a repository level variable.
      Parameters:
      workspace - The account.
      repoSlug - The repository.
      variableUuid - The UUID of the variable to update.
      pipelineVariable - The updated variable
      Returns:
      The variable was updated.