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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
{
"values": [
{
"id": 1,
"type": "pull-request-only",
"matcher": {
"id": "refs/heads/main",
"type": {
"name": "Branch",
"id": "ANY_REF"
},
"displayId": "main"
},
"groups": [
"group_a",
"group_b"
],
"users": [
{
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
}
],
"scope": {
"type": "GLOBAL",
"resourceId": 2
},
"accessKeys": [
{
"key": {
"id": 1,
"bitLength": 2154,
"algorithmType": "<string>",
"label": "me@127.0.0.1",
"text": "sh-rsa AAAAB3... me@127.0.0.1"
},
"permission": "USER_ADMIN",
"repository": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
}
}
]
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Create a restriction for the supplied branch or set of branches to be applied on all repositories in the given project.
A restriction means preventing writes on the specified branch(es) by all except a set of users and/or groups, or preventing specific operations such as branch deletion.
For example, you can restrict write access on 'master' to just the 'senior-developer' group, or prevent anyone from deleting that branch.
The request matcher and type must conform to the following.
See the Branch REST API for more information.
See the Branch REST API for more information.
Type: Set and be one of
The authenticated user must have PROJECT_ADMIN permission or higher to call this resource. Only authenticated users may call this resource.
string
RequiredThe request containing the details of the restriction to create.
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
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
curl --request POST \
--url 'http://{baseurl}/rest/branch-permissions/latest/projects/{projectKey}/restrictions' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"accessKeyIds": [
1,
2,
3
],
"accessKeys": [
{
"key": {
"bitLength": 2154,
"algorithmType": "<string>",
"text": "sh-rsa AAAAB3... me@127.0.0.1"
},
"permission": "USER_ADMIN",
"repository": {
"name": "My repo",
"scmId": "git",
"slug": "my-repo",
"links": {}
},
"project": {
"key": "PRJ",
"avatar": "<string>",
"avatarUrl": "<string>",
"links": {}
}
}
],
"groupNames": [
"bitbucket-developers"
],
"groups": [
"group_a",
"group_b"
],
"matcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"type": "pull-request-only",
"userSlugs": [
"bman",
"tstark",
"hulk"
],
"users": [
{
"name": "jcitizen",
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"links": {},
"active": true,
"avatarUrl": "<string>"
}
]
}'
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
98
99
100
101
102
103
104
105
106
107
108
109
110
{
"id": 1,
"type": "pull-request-only",
"matcher": {
"id": "refs/heads/main",
"type": {
"name": "Branch",
"id": "ANY_REF"
},
"displayId": "main"
},
"groups": [
"group_a",
"group_b"
],
"users": [
{
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
}
],
"scope": {
"type": "GLOBAL",
"resourceId": 2
},
"accessKeys": [
{
"key": {
"id": 1,
"bitLength": 2154,
"algorithmType": "<string>",
"label": "me@127.0.0.1",
"text": "sh-rsa AAAAB3... me@127.0.0.1"
},
"permission": "USER_ADMIN",
"repository": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
}
}
]
}
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
{
"id": 1,
"type": "pull-request-only",
"matcher": {
"id": "refs/heads/main",
"type": {
"name": "Branch",
"id": "ANY_REF"
},
"displayId": "main"
},
"groups": [
"group_a",
"group_b"
],
"users": [
{
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
}
],
"scope": {
"type": "GLOBAL",
"resourceId": 2
},
"accessKeys": [
{
"key": {
"id": 1,
"bitLength": 2154,
"algorithmType": "<string>",
"label": "me@127.0.0.1",
"text": "sh-rsa AAAAB3... me@127.0.0.1"
},
"permission": "USER_ADMIN",
"repository": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
}
}
]
}
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}'
Retrieve the avatar for the project matching the supplied moduleKey.
string
Requiredstring
The avatar of the project matching the supplied moduleKey.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/hooks/{hookKey}/avatar' \
--header 'Accept: application/json'
Retrieve a page of projects.
Only projects for which the authenticated user has the PROJECT_VIEW permission will be returned.
string
string
number
number
A page of projects.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"values": [
{
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Create a new project.
To include a custom avatar for the project, the project definition should contain an additional attribute with the key avatar
and the value a data URI containing Base64-encoded image data. The URI should be in the following format:
data:(content type, e.g. image/png);base64,(data)If the data is not Base64-encoded, or if a character set is defined in the URI, or the URI is otherwise invalid, project creation will fail.
The authenticated user must have PROJECT_CREATE permission to call this resource.
The project.
string
string
string
object
The newly created project.
1
2
3
4
5
6
7
8
9
10
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"key": "PRJ",
"avatar": "<string>",
"avatarUrl": "<string>",
"links": {}
}'
1
2
3
4
5
6
7
8
9
10
11
{
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
}
Retrieve the project matching the supplied projectKey.
The authenticated user must have PROJECT_VIEW permission for the specified project to call this resource.
string
RequiredThe project matching the supplied projectKey.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
{
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
}
Update the project matching the projectKey supplied in the resource path.
To include a custom avatar for the updated project, the project definition should contain an additional attribute with the key avatar
and the value a data URI containing Base64-encoded image data. The URI should be in the following format:
data:(content type, e.g. image/png);base64,(data)
If the data is not Base64-encoded, or if a character set is defined in the URI, or the URI is otherwise invalid, project creation will fail.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
RequiredProject parameters to update.
string
string
string
object
The updated project. The project's key was not updated.
1
2
3
4
5
6
7
8
9
10
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"key": "PRJ",
"avatar": "<string>",
"avatarUrl": "<string>",
"links": {}
}'
1
2
3
4
5
6
7
8
9
10
11
{
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
}
Delete the project matching the supplied projectKey.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
RequiredThe project matching the supplied projectKey was deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}'
Retrieve the avatar for the project matching the supplied projectKey.
The authenticated user must have PROJECT_VIEW permission for the specified project to call this resource.
string
Requiredstring
The avatar of the project matching the supplied projectKey.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/avatar.png' \
--header 'Accept: application/json'
Update the avatar for the project matching the supplied projectKey.
This resource accepts POST multipart form data, containing a single image in a form-field named 'avatar'.
There are configurable server limits on both the dimensions (1024x1024 pixels by default) and uploaded file size (1MB by default). Several different image formats are supported, but PNG and JPEG are preferred due to the file size limit.
This resource has Cross-Site Request Forgery (XSRF) protection. To allow the request to pass the XSRF check the caller needs to send an X-Atlassian-Token
HTTP header with the value no-check
.
An example curl request to upload an image name 'avatar.png' would be: curl -X POST -u username:password -H "X-Atlassian-Token: no-check" http://example.com/rest/api/1.0/projects/STASH/avatar.png -F avatar=@avatar.png
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
RequiredThe mutlipart form data containing the file.
string
The avatar was uploaded successfully.
any
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/avatar.png' \
--header 'Accept: application/json'
Return a page of hook scripts configured for the specified project.
This endpoint requires PROJECT_ADMIN permission.
string
Requirednumber
number
A page of hook scripts.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/hook-scripts' \
--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
{
"values": [
{
"script": {
"name": "<string>",
"id": 2154,
"type": "POST",
"version": 2154,
"createdDate": "<string>",
"pluginKey": "<string>",
"description": "<string>",
"updatedDate": "<string>"
},
"scope": {
"type": "GLOBAL",
"resourceId": 2
},
"triggerIds": [
"<string>"
]
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Creates/updates the hook script configuration for the provided hook script and project.
This endpoint requires PROJECT_ADMIN permission.
string
Requiredstring
RequiredThe hook triggers for which the hook script should be run
array<string>
The updated hook script.
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/hook-scripts/{scriptId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"triggerIds": [
"<string>"
]
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"script": {
"name": "<string>",
"id": 2154,
"type": "POST",
"version": 2154,
"createdDate": "<string>",
"pluginKey": "<string>",
"description": "<string>",
"updatedDate": "<string>"
},
"scope": {
"type": "GLOBAL",
"resourceId": 2
},
"triggerIds": [
"<string>"
]
}
Removes the hook script from the set of hook scripts configured to run in all repositories under the project.
This endpoint requires PROJECT_ADMIN permission.
string
Requiredstring
RequiredThe hook script was successfully deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/hook-scripts/{scriptId}'
Revoke all permissions for the specified project for the given groups and users.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.
In addition, a user may not revoke a group's permission if their own permission would be revoked as a result, nor may they revoke their own permission unless they have a global permission that already implies that permission.
string
Requiredstring
string
All project permissions were revoked from the users and groups for the specified project.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions'
Retrieve a page of groups that have been granted at least one permission for the specified project.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.
string
Requiredstring
number
number
A page of groups and their highest permissions for the specified project.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/groups' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"values": [
{
"permission": "ADMIN",
"group": {
"name": "group_a"
}
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Promote or demote a group's permission level for the specified project.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource. In addition, a user may not demote a group's permission level if theirown permission level would be reduced as a result.
string
Requiredstring
string
The requested permission was granted.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/groups'
Revoke all permissions for the specified project for a group.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.
In addition, a user may not revoke a group's permissions if it will reduce their own permission level.
string
Requiredstring
All project permissions were revoked from the group for the specified project.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/groups'
Retrieve a page of groups that have no granted permissions for the specified project.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher
string
Requiredstring
number
number
A page of groups that have not been granted any permissions for the specifiedproject.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/groups/none' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"values": [
{
"name": "group-a",
"deletable": true
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Search direct and implied permissions of principals (users and groups). This endpoint returns a superset of the results returned by the /users and /groups endpoints because it allows filtering by global permissions too.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.
string
Requiredstring
string
string
default response
any
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/search'
Retrieve a page of users that have been granted at least one permission for the specified project.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.
string
Requiredstring
number
number
A page of users and their highest permissions for the specified project.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/users' \
--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
{
"values": [
{
"permission": "USER_ADMIN",
"user": {
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
}
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Promote or demote a user's permission level for the specified project.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource. In addition, a user may not reduce their own permission level unless they have a global permission that already implies that permission.
string
Requiredstring
string
The requested permission was granted.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/users'
Revoke all permissions for the specified project for a user.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.
In addition, a user may not revoke their own project permissions if they do not have a higher global permission.
string
Requiredstring
All project permissions were revoked from the user for the specified project.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/users'
Retrieve a page of licensed users that have no granted permissions for the specified project.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.
string
Requiredstring
number
number
A page of users that have not been granted any permissions for the specified project
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/users/none' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"values": [
{
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"displayName": "Jane Citizen",
"emailAddress": "jane@example.com",
"slug": "jcitizen",
"active": true
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Check whether the specified permission is the default permission (granted to all users) for a project.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.
string
Requiredstring
RequiredA simple entity indicating whether the specified permission is the defaultpermission for this project.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/{permission}/all' \
--header 'Accept: application/json'
1
2
3
{
"permitted": true
}
Grant or revoke a project permission to all users, i.e. set the default permission.
The authenticated user must have PROJECT_ADMIN permission for the specified project or a higher global permission to call this resource.
string
Requiredstring
Requiredstring
The requested permission was successfully granted or revoked.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/permissions/{permission}/all'
Retrieve repositories from the project corresponding to the supplied projectKey.
The authenticated user must have PROJECT_READ permission for the specified project to call this resource.
string
Requirednumber
number
The repositories matching the supplied projectKey.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos' \
--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
{
"values": [
{
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Create a new repository. Requires an existing project in which this repository will be created. The only parameters which will be used are name and scmId.
The authenticated user must have REPO_CREATE permission or higher, for the context project to call this resource.
string
RequiredThe repository
string
string
string
object
The newly created repository.
1
2
3
4
5
6
7
8
9
10
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "My repo",
"scmId": "git",
"slug": "my-repo",
"links": {}
}'
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
{
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
}
Retrieve the repository matching the supplied projectKey and repositorySlug.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
RequiredThe repository which matches the supplied projectKey and repositorySlug.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \
--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
{
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
}
Update the repository matching the repositorySlug supplied in the resource path.
The repository's slug is derived from its name. If the name changes the slug may also change.
This resource can be used to change the repository's default branch by specifying a new default branch in the request. For example: "defaultBranch":"main"
This resource can be used to move the repository to a different project by specifying a new project in the request. For example: "project":{"key":"NEW_KEY"}
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
RequiredThe updated repository.
string
string
string
object
The updated repository.
1
2
3
4
5
6
7
8
9
10
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "My repo",
"scmId": "git",
"slug": "my-repo",
"links": {}
}'
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
{
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
}
Create a new repository forked from an existing repository.
The JSON body for this POST
is not required to contain any properties. Even the name may be omitted. The following properties will be used, if provided:
"name":"Fork name"
- Specifies the forked repository's name
"defaultBranch":"main"
- Specifies the forked repository's default branch
"project":{"key":"TARGET_KEY"}
- Specifies the forked repository's target project by key
The authenticated user must have REPO_READ permission for the specified repository and PROJECT_ADMIN on the target project to call this resource. Note that users always have PROJECT_ADMIN permission on their personal projects.
string
Requiredstring
RequiredThe rest fork.
string
string
string
object
The newly created fork.
1
2
3
4
5
6
7
8
9
10
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "My repo",
"scmId": "git",
"slug": "my-repo",
"links": {}
}'
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
{
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
}
Schedule the repository matching the supplied projectKey and repositorySlug to be deleted.
The authenticated user must have sufficient permissions specified by the repository delete policy to call this resource. The default permission required is REPO_ADMIN permission.
string
Requiredstring
RequiredThe repository has been scheduled for deletion.
any
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json'
Retrieves the contributing guidelines for the repository, if they've been defined.
This checks the repository for a CONTRIBUTING file, optionally with an md or txt extension, and, if found, streams it. By default, the raw content of the file is streamed. Appending ?markup
to the URL will stream an HTML-rendered version instead.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
The contributing guidelines for the repository.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/contributing' \
--header 'Accept: application/json'
Retrieves the repository's configured default branch.
Every repository has a configured default branch, but that branch may not actually exist in the repository. For example, a newly-created repository will have a configured default branch even though no branches have been pushed yet.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
RequiredThe configured default branch for the repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/default-branch' \
--header 'Accept: application/json'
1
2
3
4
5
{
"id": "refs/heads/master",
"type": "BRANCH",
"displayId": "master"
}
Update the default branch of a repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
RequiredThe branch to set as default
RefType
string
The default branch was updated.
1
2
3
4
5
6
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/default-branch' \
--header 'Content-Type: application/json' \
--data '{
"id": "refs/heads/master"
}'
Retrieve repositories which have been forked from this one. Unlike #getRelatedRepositories(Repository, PageRequest) related repositories, this only looks at a given repository's direct forks. If those forks have themselves been the origin of more forks, such "grandchildren" repositories will not be retrieved.
Only repositories to which the authenticated user has REPO_READ permission will be included, even if other repositories have been forked from this one.
string
Requiredstring
Requirednumber
number
A page of repositories related to the request repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/forks' \
--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
{
"values": [
{
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Retrieves the license for the repository, if it's been defined.
This checks the repository for a
LICENSEfile, optionally with an
mdor
txtextension, and, if found, streams it. By default, the raw content of the file is streamed. Appending
?markupto the URL will stream an HTML-rendered version instead.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
The license for the repository.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/license' \
--header 'Accept: application/json'
Retrieves the README for the repository, if it's been defined.
This checks the repository for a
READMEfile, optionally with an
mdor
txtextension, and, if found, streams it. By default, the raw content of the file is streamed. Appending
?markupto the URL will stream an HTML-rendered version instead. Note that, when streaming HTML, relative URLs in the README will not work if applied relative to this URL.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
The README for the repository.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/readme' \
--header 'Accept: application/json'
If a create or fork operation fails, calling this method will clean up the broken repository and try again. The repository must be in an INITIALISATION_FAILED state.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredstring
RequiredThe newly created repository.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/recreate' \
--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
{
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
}
Retrieve repositories which are related to this one. Related repositories are from the same Repository#getHierarchyId() hierarchy as this repository.
Only repositories to which the authenticated user has REPO_READ permission will be included, even if more repositories are part of this repository's hierarchy.
string
Requiredstring
Requirednumber
number
A page of repositories related to the request repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/related' \
--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
{
"values": [
{
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"origin": {
"name": "My repo",
"id": 2154,
"state": "AVAILABLE",
"public": true,
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"partition": 2154,
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
},
"project": {
"name": "My Cool Project",
"key": "PRJ",
"id": 2154,
"type": "NORMAL",
"public": true,
"avatar": "<string>",
"namespace": "<string>",
"description": "The description for my cool project",
"scope": "PROJECT"
},
"description": "My repo description",
"scmId": "git",
"slug": "my-repo",
"scope": "REPOSITORY"
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Retrieves the auto decline settings for the supplied project. Default settings are returned if no explicit settings have been set for the project.
string
RequiredThe auto decline settings
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/auto-decline' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"enabled": true,
"scope": {
"type": "GLOBAL",
"resourceId": 2
},
"inactivityWeeks": 4
}
Creates or updates the auto decline settings for the supplied project.
The authenticated user must have PROJECT_ADMIN permission for this project to call the resource.
string
RequiredThe settings to create or update
boolean
integer
The auto decline settings
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/auto-decline' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"enabled": true,
"inactivityWeeks": 4
}'
1
2
3
4
5
6
7
8
{
"enabled": true,
"scope": {
"type": "GLOBAL",
"resourceId": 2
},
"inactivityWeeks": 4
}
Delete auto decline settings for the supplied project.
The authenticated user must have PROJECT_ADMIN permission for this project to call the resource.
string
RequiredThe auto decline settings have been deleted successfully.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/auto-decline'
Retrieve a page of repository hooks for this project.
The authenticated user must have PROJECT_READ permission for the specified project to call this resource.
string
Requiredstring
number
number
A page of repository hooks with their associated enabled state.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks' \
--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
{
"values": [
{
"enabled": true,
"details": {
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"version": "<string>",
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>"
},
"scope": {
"type": "GLOBAL",
"resourceId": 2
},
"configured": true
}
],
"size": 1,
"limit": 25,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154
}
Retrieve a repository hook for this project.
The authenticated user must have PROJECT_READ permission for the specified project to call this resource.
string
Requiredstring
RequiredReturns the repository hooks with their associated enabled state for the supplied hookKey.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks/{hookKey}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"enabled": true,
"details": {
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"version": "<string>",
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>"
},
"scope": {
"type": "GLOBAL",
"resourceId": 2
},
"configured": true
}
Enable a repository hook for this project and optionally apply new configuration.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
A JSON document may be provided to use as the settings for the hook. These structure and validity of the document is decided by the plugin providing the hook.
string
Requiredstring
Requiredinteger
The repository hooks with their associated enabled state for the supplied hookKey.
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/enabled' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"enabled": true,
"details": {
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"version": "<string>",
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>"
},
"scope": {
"type": "GLOBAL",
"resourceId": 2
},
"configured": true
}
Disable a repository hook for this project.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredstring
RequiredThe repository hooks with their associated enabled state for the supplied hookKey.
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/enabled' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
{
"enabled": true,
"details": {
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"version": "<string>",
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"description": "<string>"
},
"scope": {
"type": "GLOBAL",
"resourceId": 2
},
"configured": true
}
Retrieve the settings for a repository hook for this project.
The authenticated user must have PROJECT_READ permission for the specified project to call this resource.
string
Requiredstring
RequiredThe settings for the hook.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/settings' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
{
"stringValue": "This is an arbitrary string",
"booleanValue": true,
"doubleValue": 1.1,
"integerValue": 1,
"longValue": -2147483648
}
Modify the settings for a repository hook for this project.
The service will reject any settings which are too large, the current limit is 32KB once serialized.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
A JSON document can be provided to use as the settings for the hook. These structure and validity of the document is decided by the plugin providing the hook.
string
Requiredstring
RequiredThe raw settings.
string
boolean
number
integer
integer
The settings for the hook.
1
2
3
4
5
6
7
8
9
10
11
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/hooks/{hookKey}/settings' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"stringValue": "This is an arbitrary string",
"booleanValue": true,
"doubleValue": 1.1,
"integerValue": 1,
"longValue": -2147483648
}'
1
2
3
4
5
6
7
{
"stringValue": "This is an arbitrary string",
"booleanValue": true,
"doubleValue": 1.1,
"integerValue": 1,
"longValue": -2147483648
}
Retrieve the merge strategy configuration for this project and SCM.
The authenticated user must have PROJECT_READ permission for the context repository to call this resource.
string
Requiredstring
RequiredThe merge configuration of the request project.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/pull-requests/{scmId}' \
--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
{
"mergeConfig": {
"type": "repository",
"strategies": [
{
"enabled": true,
"name": "Merge commit",
"id": "no-ff",
"description": "Always create a merge commit",
"flag": "--no-ff"
}
],
"defaultStrategy": {
"enabled": true,
"name": "Merge commit",
"id": "no-ff",
"description": "Always create a merge commit",
"flag": "--no-ff"
},
"commitSummaries": 2154
}
}
Update the pull request merge strategy configuration for this project and SCM.
The authenticated user must have PROJECT_ADMIN permission for the context repository to call this resource.
Only the strategies provided will be enabled, the default must be set and included in the set of strategies.
An explicitly set pull request merge strategy configuration can be deleted by POSTing a document with an empty "mergeConfig" attribute. i.e:
{ "mergeConfig": {} }
Upon completion of this request, the effective configuration will be the configuration explicitly set for the SCM, or if no such explicit configuration is set then the default configuration will be used.
string
Requiredstring
RequiredThe settings.
object
The merge configuration of the request project.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/pull-requests/{scmId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"mergeConfig": {
"strategies": [
{
"id": "no-ff",
"links": {}
}
],
"defaultStrategy": {
"id": "no-ff",
"links": {}
},
"commitSummaries": 2154
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"mergeConfig": {
"type": "repository",
"strategies": [
{
"enabled": true,
"name": "Merge commit",
"id": "no-ff",
"description": "Always create a merge commit",
"flag": "--no-ff"
}
],
"defaultStrategy": {
"enabled": true,
"name": "Merge commit",
"id": "no-ff",
"description": "Always create a merge commit",
"flag": "--no-ff"
},
"commitSummaries": 2154
}
}
Rate this page: