• Audit
  • Policies
  • Branch-utils
  • Git
  • Sync
  • Required-builds
  • Build-status
  • Comment-likes
  • Jira
  • Mirroring
  • Branch-permissions
  • Access-tokens
  • Insights
  • Ssh
  • Api
Server
Bitbucket Data Center / / Modules

Branch-permissions

Postman Collection
OpenAPI
GET

Get branch-permissions latest projects {projectKey} repos {repositorySlug} restrictions

Search for restrictions using the supplied parameters.

The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Query parameters

matcherType

string

matcherId

string

type

string

start

number

limit

number

Responses

A response containing a page of restrictions.

application/json

object
GET/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 { "values": [ { "users": [ { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "accessKeys": [ { "key": { "algorithmType": "<string>", "bitLength": 2154, "id": 1, "text": "sh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "permission": "USER_ADMIN", "project": { "avatar": "<string>", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT" }, "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } } ], "groups": [ "group_a", "group_b" ], "matcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "id": 1, "type": "pull-request-only", "scope": { "resourceId": 2, "type": "GLOBAL" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post branch-permissions latest projects {projectKey} repos {repositorySlug} restrictions

Allows creating multiple restrictions at once.

Request

Path parameters

projectKey

string

Required
repositorySlug

string

Required

Request bodyapplication/vnd.atl.bitbucket.bulk+json

The request containing a list of the details of the restrictions to create.

array<RestRestrictionRequest>

accessKeyIds

array<integer>

accessKeys

array<RestSshAccessKey>

groupNames

array<string>

groups

array<string>

matcher

object

type

string

userSlugs

array<string>

users

array<RestApplicationUser>

Responses

Response contains the ref restriction that was just created.

application/json

RestRefRestriction
POST/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 { "users": [ { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "accessKeys": [ { "key": { "algorithmType": "<string>", "bitLength": 2154, "id": 1, "text": "sh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "permission": "USER_ADMIN", "project": { "avatar": "<string>", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT" }, "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } } ], "groups": [ "group_a", "group_b" ], "matcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "id": 1, "type": "pull-request-only", "scope": { "resourceId": 2, "type": "GLOBAL" } }
GET

Get branch-permissions latest projects {projectKey} repos {repositorySlug} restrictions {id}

Returns a restriction as specified by a restriction id.

The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required
repositorySlug

string

Required

Responses

A response containing the restriction.

application/json

RestRefRestriction
GET/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 { "users": [ { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "accessKeys": [ { "key": { "algorithmType": "<string>", "bitLength": 2154, "id": 1, "text": "sh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "permission": "USER_ADMIN", "project": { "avatar": "<string>", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT" }, "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } } ], "groups": [ "group_a", "group_b" ], "matcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "id": 1, "type": "pull-request-only", "scope": { "resourceId": 2, "type": "GLOBAL" } }
DEL

Delete branch-permissions latest projects {projectKey} repos {repositorySlug} restrictions {id}

Deletes a restriction as specified by a restriction id.

The authenticated user must have REPO_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required
repositorySlug

string

Required

Responses

An empty response indicating that the operation was successful

DEL/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}'
GET

Get branch-permissions latest projects {projectKey} restrictions

Search for restrictions using the supplied parameters.

The authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

Request

Path parameters

projectKey

string

Required

Query parameters

matcherType

string

matcherId

string

type

string

start

number

limit

number

Responses

A response containing a page of restrictions.

application/json

object
GET/branch-permissions/latest/projects/{projectKey}/restrictions
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/restrictions' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 { "values": [ { "users": [ { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "accessKeys": [ { "key": { "algorithmType": "<string>", "bitLength": 2154, "id": 1, "text": "sh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "permission": "USER_ADMIN", "project": { "avatar": "<string>", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT" }, "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } } ], "groups": [ "group_a", "group_b" ], "matcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "id": 1, "type": "pull-request-only", "scope": { "resourceId": 2, "type": "GLOBAL" } } ], "size": 1, "isLastPage": true, "nextPageStart": 2154, "start": 2154, "limit": 25 }
POST

Post branch-permissions latest projects {projectKey} restrictions

Allows creating multiple restrictions at once.

Request

Path parameters

projectKey

string

Required

Request bodyapplication/vnd.atl.bitbucket.bulk+json

The request containing a list of the details of the restrictions to create.

array<RestRestrictionRequest>

accessKeyIds

array<integer>

accessKeys

array<RestSshAccessKey>

groupNames

array<string>

groups

array<string>

matcher

object

type

string

userSlugs

array<string>

users

array<RestApplicationUser>

Responses

Response contains the ref restriction that was just created.

application/json

RestRefRestriction
POST/branch-permissions/latest/projects/{projectKey}/restrictions
1 2 3 curl --request POST \ --url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/restrictions' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 { "users": [ { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "accessKeys": [ { "key": { "algorithmType": "<string>", "bitLength": 2154, "id": 1, "text": "sh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "permission": "USER_ADMIN", "project": { "avatar": "<string>", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT" }, "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } } ], "groups": [ "group_a", "group_b" ], "matcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "id": 1, "type": "pull-request-only", "scope": { "resourceId": 2, "type": "GLOBAL" } }
GET

Get branch-permissions latest projects {projectKey} restrictions {id}

Returns a restriction as specified by a restriction id.

The authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required

Responses

A response containing the restriction.

application/json

RestRefRestriction
GET/branch-permissions/latest/projects/{projectKey}/restrictions/{id}
1 2 3 curl --request GET \ --url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/restrictions/{id}' \ --header 'Accept: application/json'
200Response
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 { "users": [ { "slug": "jcitizen", "emailAddress": "jane@example.com", "displayName": "Jane Citizen", "name": "jcitizen", "id": 101, "type": "NORMAL", "active": true } ], "accessKeys": [ { "key": { "algorithmType": "<string>", "bitLength": 2154, "id": 1, "text": "sh-rsa AAAAB3... me@127.0.0.1", "label": "me@127.0.0.1" }, "permission": "USER_ADMIN", "project": { "avatar": "<string>", "name": "My Cool Project", "key": "PRJ", "public": true, "id": 2154, "type": "NORMAL", "description": "The description for my cool project", "namespace": "<string>", "scope": "PROJECT" }, "repository": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "origin": { "scmId": "git", "hierarchyId": "e3c939f9ef4a7fae272e", "statusMessage": "Available", "partition": 2154, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" }, "archived": true, "forkable": true, "defaultBranch": "main", "relatedLinks": {}, "slug": "my-repo", "name": "My repo", "public": true, "id": 2154, "state": "AVAILABLE", "description": "My repo description", "scope": "REPOSITORY" } } ], "groups": [ "group_a", "group_b" ], "matcher": { "displayId": "main", "id": "refs/heads/main", "type": { "name": "Branch", "id": "ANY_REF" } }, "id": 1, "type": "pull-request-only", "scope": { "resourceId": 2, "type": "GLOBAL" } }
DEL

Delete branch-permissions latest projects {projectKey} restrictions {id}

Deletes a restriction as specified by a restriction id.

The authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.

Request

Path parameters

projectKey

string

Required
id

string

Required

Responses

An empty response indicating that the operation was successful

DEL/branch-permissions/latest/projects/{projectKey}/restrictions/{id}
1 2 curl --request DELETE \ --url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/restrictions/{id}'

Rate this page: