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.
string
Requiredstring
Requiredstring
string
string
number
number
A response containing a page of restrictions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions' \
--header 'Accept: application/json'
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
}
Allows creating multiple restrictions at once.
string
Requiredstring
RequiredThe request containing a list of the details of the restrictions to create.
array<RestRestrictionRequest>
array<integer>
array<RestSshAccessKey>
array<string>
array<string>
object
string
array<string>
array<RestApplicationUser>
Response contains the ref restriction that was just created.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions' \
--header 'Accept: application/json'
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"
}
}
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.
string
Requiredstring
Requiredstring
RequiredA response containing the restriction.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}' \
--header 'Accept: application/json'
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"
}
}
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.
string
Requiredstring
Requiredstring
RequiredAn empty response indicating that the operation was successful
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/repos/{repositorySlug}/restrictions/{id}'
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.
string
Requiredstring
string
string
number
number
A response containing a page of restrictions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/restrictions' \
--header 'Accept: application/json'
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
}
Allows creating multiple restrictions at once.
string
RequiredThe request containing a list of the details of the restrictions to create.
array<RestRestrictionRequest>
array<integer>
array<RestSshAccessKey>
array<string>
array<string>
object
string
array<string>
array<RestApplicationUser>
Response contains the ref restriction that was just created.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/restrictions' \
--header 'Accept: application/json'
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"
}
}
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.
string
Requiredstring
RequiredA response containing the restriction.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/restrictions/{id}' \
--header 'Accept: application/json'
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"
}
}
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.
string
Requiredstring
RequiredAn empty response indicating that the operation was successful
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/restrictions/{id}'
Rate this page: