Applies a label to this repository.
POST /rest/api/latest/projects/{key}/repos/{slug}/labels
The label name
The applied label
Downloads an archive (zip/tar) of this repository's content at a given ref.
GET /rest/api/latest/projects/{key}/repos/{slug}/archive
Optionalparams: ArchiveParamsOptional: at, format ('zip' default, 'tar', 'tar.gz', 'tgz'),
filename, path (one or many, to archive a subset), prefix
The archive's raw bytes; wrap with Buffer.from(...) in Node.js to write it to disk
Fetches this repository's auto-decline settings (automatic declining of inactive pull requests).
GET /rest/api/latest/projects/{key}/repos/{slug}/settings/auto-decline
The effective auto-decline settings
Fetches this repository's pull request auto-merge settings.
GET /rest/api/latest/projects/{key}/repos/{slug}/settings/auto-merge
The effective auto-merge settings
Fetches branches for this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/branches
Optionalparams: BranchesParamsOptional filters: limit, start, filterText, orderBy, details, base, boostMatches
An array of branches
Fetches a single ref restriction by id.
GET /rest/branch-permissions/latest/projects/{key}/repos/{slug}/restrictions/{id}
The restriction's numeric id
The restriction
Fetches the ref restrictions (branch permissions) configured on this repository.
GET /rest/branch-permissions/latest/projects/{key}/repos/{slug}/restrictions
Optionalparams: RefRestrictionsParamsOptional filters: limit, start, matcherType, matcherId, type
A paged response of restrictions
Browses the contents of a directory or file in this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/browse/{srcPath}
OptionalsrcPath: stringPath to browse (e.g., 'src' or 'src/index.ts'). Omit to browse the root.
Optionalparams: BrowseParamsOptional: at (branch/tag/commit), type, blame, noContent, limit, start
The browse response with path info and children
Fetches commits for this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/commits
Optionalparams: CommitsParamsOptional filters: limit, start, until, since, path, merges, followRenames, ignoreMissing
An array of commits
Fetches the file changes between two refs or commits.
GET /rest/api/latest/projects/{key}/repos/{slug}/compare/changes
Optionalparams: CompareParamsfrom, to, optional fromRepo (cross-fork), limit, start
A paged response of file changes
Fetches the commits reachable from from but not from to.
GET /rest/api/latest/projects/{key}/repos/{slug}/compare/commits
Optionalparams: CompareParamsfrom, to, optional fromRepo (cross-fork), limit, start
A paged response of commits
Fetches the diff between two refs or commits.
GET /rest/api/latest/projects/{key}/repos/{slug}/compare/diff{path}
The path param (the file to diff) is optional: when omitted, the diff
for the whole comparison is returned.
Optionalparams: CompareDiffParamsOptional: path, from, to, fromRepo, contextLines, srcPath, whitespace
The diff object
Fetches this repository's CONTRIBUTING guidelines rendered by Bitbucket.
GET /rest/api/latest/projects/{key}/repos/{slug}/contributing
Optionalparams: MarkupFileParamsOptional: at, markup, htmlEscape, includeHeadingId, hardwrap
The rendered CONTRIBUTING file
Atlassian does not publish a response schema for this endpoint; the shape is typed defensively — see BitbucketMarkupFile.
Creates a new branch in this repository.
POST /rest/api/latest/projects/{key}/repos/{slug}/branches
name and startPoint (commit SHA or ref), plus an optional message
The created branch
Creates a ref restriction (branch permission) on this repository.
POST /rest/branch-permissions/latest/projects/{key}/repos/{slug}/restrictions
type, matcher, and optional userSlugs/groupNames/accessKeyIds exemptions
The created restriction
Creates a default reviewer condition on this repository.
POST /rest/default-reviewers/latest/projects/{key}/repos/{slug}/condition
sourceMatcher, targetMatcher, reviewers/reviewerGroups, requiredApprovals
The created condition
Creates a default task on this repository.
POST /rest/default-tasks/latest/projects/{key}/repos/{slug}/tasks
description, plus optional sourceMatcher/targetMatcher
The created task
Creates a pull request in this repository.
POST /rest/api/latest/projects/{key}/repos/{slug}/pull-requests
title, fromRef, toRef, plus optional description, reviewers, draft
The created pull request
Creates a required-builds merge check condition on this repository.
POST /rest/required-builds/latest/projects/{key}/repos/{slug}/condition
buildParentKeys and refMatcher, plus optional exemptRefMatcher,
requiredForPullRequest, requiredForMergeQueue
The created condition
Creates a reviewer group on this repository.
POST /rest/api/latest/projects/{key}/repos/{slug}/settings/reviewer-groups
name, plus optional description and users
The created reviewer group
Creates a new tag in this repository.
POST /rest/git/latest/projects/{key}/repos/{slug}/tags
name and startPoint (commit SHA or ref); include message for an annotated tag
The created tag
Creates a webhook on this repository.
POST /rest/api/latest/projects/{key}/repos/{slug}/webhooks
name, events, and url, plus optional active, sslVerificationRequired,
configuration, and credentials
The created webhook
Fetches the default branch of this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/branches/default
The default branch object
Fetches the default reviewer conditions configured on this repository.
GET /rest/default-reviewers/latest/projects/{key}/repos/{slug}/conditions
An array of conditions (not paged)
Fetches the default tasks configured on this repository.
GET /rest/default-tasks/latest/projects/{key}/repos/{slug}/tasks
Optionalparams: DefaultTasksParamsOptional limit, start, and markup ('true' to render HTML)
A paged response of default tasks
Deletes this repository.
DELETE /rest/api/latest/projects/{key}/repos/{slug}
Deletes all default tasks from this repository.
DELETE /rest/default-tasks/latest/projects/{key}/repos/{slug}/tasks
Deletes this repository's auto-decline settings, falling back to the project-level (or instance-level) setting.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/settings/auto-decline
Deletes this repository's pull request auto-merge settings, falling back to the project-level (or instance-level) setting.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/settings/auto-merge
Deletes a branch from this repository.
DELETE /rest/branch-utils/latest/projects/{key}/repos/{slug}/branches
name of the branch to delete, plus an optional dryRun flag
Deletes a ref restriction from this repository.
DELETE /rest/branch-permissions/latest/projects/{key}/repos/{slug}/restrictions/{id}
The restriction's numeric id
Deletes a default reviewer condition from this repository.
DELETE /rest/default-reviewers/latest/projects/{key}/repos/{slug}/condition/{id}
The condition's numeric id
Deletes a default task from this repository.
DELETE /rest/default-tasks/latest/projects/{key}/repos/{slug}/tasks/{taskId}
The task's numeric id
Deletes a required-builds merge check condition from this repository.
DELETE /rest/required-builds/latest/projects/{key}/repos/{slug}/condition/{id}
The condition's numeric id
Deletes a reviewer group from this repository.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/settings/reviewer-groups/{id}
The reviewer group's numeric id
Deletes a tag from this repository.
DELETE /rest/git/latest/projects/{key}/repos/{slug}/tags/{name}
Short name of the tag to delete (e.g., 'v1.0.0')
Deletes a webhook from this repository.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/webhooks/{webhookId}
The webhook's numeric id
Disables a repository hook on this repository.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/settings/hooks/{hookKey}/enabled
The hook's module key
The updated hook state
Creates or updates a file in this repository.
PUT /rest/api/latest/projects/{key}/repos/{slug}/browse/{path}
Path to the file (e.g., 'src/index.ts')
File content, commit message, branch, and source commit ID
The commit created by this edit
Enables a repository hook on this repository.
PUT /rest/api/latest/projects/{key}/repos/{slug}/settings/hooks/{hookKey}/enabled
The hook's module key
The updated hook state
Lists the paths of all files in this repository (recursively) at a given ref.
GET /rest/api/latest/projects/{key}/repos/{slug}/files[/{path}]
Optionalpath: stringDirectory to list; omit to list from the repository root
Optionalparams: FilesParamsOptional limit, start, and at (branch/tag/commit)
A paged response of file paths
Forks this repository.
POST /rest/api/latest/projects/{key}/repos/{slug}
Optionaldata: ForkRepositoryDataOptional overrides: target name, project, or defaultBranch. Omit to fork
with the same name into the same project.
The newly created fork
Fetches the forks of this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/forks
Optionalparams: PaginationParamsOptional pagination: limit, start
A paged response of forked repositories
Fetches the repository details.
GET /rest/api/latest/projects/{key}/repos/{slug}
The repository object
Fetches groups with explicit permissions on this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/permissions/groups
Optionalparams: RepositoryGroupsParamsOptional filters: limit, start, filter
A paged response of group–permission pairs
Fetches a single repository hook by its module key.
GET /rest/api/latest/projects/{key}/repos/{slug}/settings/hooks/{hookKey}
The hook's module key
The hook and its state at this repository's scope
Fetches the repository hooks available on this repository and their state.
GET /rest/api/latest/projects/{key}/repos/{slug}/settings/hooks
Optionalparams: HooksParamsOptional filters: limit, start, type
A paged response of hooks
Fetches the settings stored for a repository hook on this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/settings/hooks/{hookKey}/settings
The hook's module key
The hook's settings (shape defined by the hook itself)
Fetches the labels applied to this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/labels
A paged response of labels
Fetches the files last modified in this repository along with the commit that last touched each.
GET /rest/api/latest/projects/{key}/repos/{slug}/last-modified
Optionalparams: LastModifiedParamsOptional filters: limit, start, at
An array of last-modified entries
Fetches this repository's LICENSE rendered by Bitbucket.
GET /rest/api/latest/projects/{key}/repos/{slug}/license
Optionalparams: MarkupFileParamsOptional: at, markup, htmlEscape, includeHeadingId, hardwrap
The rendered LICENSE
Atlassian does not publish a response schema for this endpoint; the shape is typed defensively — see BitbucketMarkupFile.
Fetches pull requests for this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/pull-requests
Optionalparams: PullRequestsParamsOptional filters: limit, start, state, direction, at, order
A paged response of pull requests
Fetches the raw content of a file in this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/raw/{path}
Path to the file (e.g., 'src/index.ts')
Optionalparams: RawFileParamsOptional: at (branch, tag, or commit SHA)
The raw file content as a string
Fetches this repository's README rendered by Bitbucket.
GET /rest/api/latest/projects/{key}/repos/{slug}/readme
Optionalparams: MarkupFileParamsOptional: at, markup, htmlEscape, includeHeadingId, hardwrap
The rendered README
Atlassian does not publish a response schema for this endpoint; the shape is typed defensively — see BitbucketMarkupFile.
Fetches this repository's ref change activity log (pushes, branch/tag creations and deletions, etc.).
GET /rest/api/latest/projects/{key}/repos/{slug}/ref-change-activities
Optionalparams: RefChangeActivitiesParamsOptional limit, start, and ref (e.g. 'refs/heads/main')
A paged response of ref change activities
Revokes all of a group's permissions on this repository.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/permissions/groups?name={name}
The group's name
Removes a label from this repository.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/labels/{labelName}
The label name
Revokes all of a user's permissions on this repository.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/permissions/users?name={name}
The user's username/slug
Fetches the required-builds merge check conditions configured on this repository.
GET /rest/required-builds/latest/projects/{key}/repos/{slug}/conditions
Optionalparams: PaginationParamsOptional limit and start
A paged response of conditions
Fetches a single reviewer group by id.
GET /rest/api/latest/projects/{key}/repos/{slug}/settings/reviewer-groups/{id}
The reviewer group's numeric id
The reviewer group
Fetches the reviewer groups configured on this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/settings/reviewer-groups
Optionalparams: PaginationParamsOptional limit and start
A paged response of reviewer groups
Fetches the members of a reviewer group who are licensed and hold
REPO_READ permission on this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/settings/reviewer-groups/{id}/users
The reviewer group's numeric id
An array of users (not paged)
Searches direct and implied permissions of users and groups on this repository. Returns a superset of the results returned by RepositoryResource.users and RepositoryResource.groups.
GET /rest/api/latest/projects/{key}/repos/{slug}/permissions/search
Optionalparams: PermissionSearchParamsOptional filters: permission (one or many), filterText, type
A paged response of permitted users/groups
Atlassian does not publish a response schema for this endpoint; the entry shape is typed defensively — see PermittedEntity.
Sets the default branch of this repository.
PUT /rest/api/latest/projects/{key}/repos/{slug}/default-branch
The full ref ID to set as default (e.g., { id: 'refs/heads/main' })
Grants or changes a group's permission level on this repository.
PUT /rest/api/latest/projects/{key}/repos/{slug}/permissions/groups?name={name}&permission={permission}
The group's name
'REPO_READ', 'REPO_WRITE', or 'REPO_ADMIN'
Enables or disables fork synchronization for this repository.
POST /rest/sync/latest/projects/{key}/repos/{slug}
enabled
The new synchronization status, or undefined when sync was disabled
Fetches the pull-request settings for this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/settings/pull-requests
The repository pull-request settings object
Grants or changes a user's permission level on this repository.
PUT /rest/api/latest/projects/{key}/repos/{slug}/permissions/users?name={name}&permission={permission}
The user's username/slug
'REPO_READ', 'REPO_WRITE', or 'REPO_ADMIN'
Fetches the size of this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/sizes
The repository size object
Manually synchronizes a ref of this fork with upstream, resolving a
diverged or orphaned state with the given action.
POST /rest/sync/latest/projects/{key}/repos/{slug}/synchronize
refId and action ('MERGE', 'REBASE', or 'DISCARD'),
plus optional context.commitMessage for merges
The ref if it could not be synchronized cleanly, or undefined on success
Fetches the fork synchronization status of this repository.
GET /rest/sync/latest/projects/{key}/repos/{slug}
Optionalat: stringOptional ref id to restrict the status to (e.g. 'refs/heads/main')
The synchronization status
Fetches tags for this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/tags
Optionalparams: TagsParamsOptional filters: limit, start, filterText, orderBy
A paged response of tags
Fetches tags associated with a list of commits.
POST /rest/api/latest/projects/{key}/repos/{slug}/tags
Array of commit SHAs to look up tags for
Optionaloptions: { apiPath?: string }Optional overrides (e.g. apiPath to target a different API version)
A paged response of tags
Tests connectivity to a webhook target, either an existing webhook (webhookId) or a
candidate URL (url) before creating one.
POST /rest/api/latest/projects/{key}/repos/{slug}/webhooks/test
webhookId or url (query), sslVerificationRequired (query), and optional
username/password Basic auth credentials (body)
The result of the connectivity test
Allows the resource to be awaited directly, resolving with the repository info. Delegates to RepositoryResource.get.
Optionalonfulfilled: ((value: BitbucketRepository) => TResult1 | PromiseLike<TResult1>) | nullOptionalonrejected: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | nullRemoves the authenticated user as a watcher of this repository.
DELETE /rest/api/latest/projects/{key}/repos/{slug}/watch
Updates this repository's name, description, visibility, or moves it to another project.
PUT /rest/api/latest/projects/{key}/repos/{slug}
Fields to change; only supplied fields are updated
The updated repository
Creates or updates this repository's auto-decline settings.
PUT /rest/api/latest/projects/{key}/repos/{slug}/settings/auto-decline
enabled and/or inactivityWeeks (1, 2, 4, 8, or 12)
The updated settings
Creates or updates this repository's pull request auto-merge settings.
PUT /rest/api/latest/projects/{key}/repos/{slug}/settings/auto-merge
enabled
The updated settings
Updates a default reviewer condition on this repository.
PUT /rest/default-reviewers/latest/projects/{key}/repos/{slug}/condition/{id}
The condition's numeric id
The full replacement condition definition
The updated condition
Updates a default task on this repository.
PUT /rest/default-tasks/latest/projects/{key}/repos/{slug}/tasks/{taskId}
The task's numeric id
The full replacement task definition
The updated task
Replaces the settings stored for a repository hook on this repository.
PUT /rest/api/latest/projects/{key}/repos/{slug}/settings/hooks/{hookKey}/settings
The hook's module key
The full replacement settings object
The stored settings
Updates a required-builds merge check condition on this repository.
PUT /rest/required-builds/latest/projects/{key}/repos/{slug}/condition/{id}
The condition's numeric id
The full replacement condition definition
The updated condition
Updates a reviewer group on this repository.
PUT /rest/api/latest/projects/{key}/repos/{slug}/settings/reviewer-groups/{id}
The reviewer group's numeric id
The full replacement group definition
The updated reviewer group
Updates the pull-request settings for this repository.
POST /rest/api/latest/projects/{key}/repos/{slug}/settings/pull-requests
Fields to change; only supplied fields are updated
The updated repository pull-request settings object
Updates a webhook on this repository.
PUT /rest/api/latest/projects/{key}/repos/{slug}/webhooks/{webhookId}
The webhook's numeric id
The full replacement webhook definition
The updated webhook
Fetches users with explicit permissions on this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/permissions/users
Optionalparams: RepositoryUsersParamsOptional filters: limit, start, filter
A paged response of user–permission pairs
Adds the authenticated user as a watcher of this repository.
POST /rest/api/latest/projects/{key}/repos/{slug}/watch
Fetches webhooks configured on this repository.
GET /rest/api/latest/projects/{key}/repos/{slug}/webhooks/search
Optionalparams: WebhooksParamsOptional filters: limit, start, event
A paged response of webhooks
Represents a Bitbucket repository resource with chainable async methods.
Implements
PromiseLike<BitbucketRepository>so it can be awaited directly to fetch repository info, while also exposing sub-resource methods.Example