Retrieves the default tasks for the supplied project.
The authenticated user must have PROJECT_VIEW permission for this project to call the resource.
string
Requiredstring
number
number
A page of default tasks
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/default-tasks/latest/projects/{projectKey}/tasks' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"isLastPage": true,
"limit": 25,
"nextPageStart": 2154,
"size": 1,
"start": 2154,
"values": [
{
"description": "Default task description",
"id": 1
}
]
}
Creates a default task for the project.
The authenticated user must have PROJECT_ADMIN permission for this project to call the resource.
string
RequiredThe task to be added
string
object
object
The default task
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
curl --request POST \
--url 'http://{baseurl}/rest/default-tasks/latest/projects/{projectKey}/tasks' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"description": "Default task description",
"sourceMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}'
1
2
3
4
{
"description": "Default task description",
"id": 1
}
Delete all the default tasks for the supplied project
The authenticated user must have PROJECT_ADMIN permission for this project to call the resource.
string
RequiredThe default tasks have been deleted successfully.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/default-tasks/latest/projects/{projectKey}/tasks'
Updates a default task for the supplied project.
The authenticated user must have PROJECT_ADMIN permission for this project to call the resource.
string
Requiredstring
RequiredThe task to be updated
string
object
object
The default task
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
curl --request PUT \
--url 'http://{baseurl}/rest/default-tasks/latest/projects/{projectKey}/tasks/{taskId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"description": "Default task description",
"sourceMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
},
"targetMatcher": {
"displayId": "main",
"id": "refs/heads/main",
"type": {
"id": "ANY_REF",
"name": "Branch"
}
}
}'
1
2
3
4
{
"description": "Default task description",
"id": 1
}
Delete a specific default task for a project.
The authenticated user must have PROJECT_ADMIN permission for this project to call the resource.
string
Requiredstring
RequiredThe default task has been deleted successfully.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/default-tasks/latest/projects/{projectKey}/tasks/{taskId}'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
}'
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;charset=UTF-8'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
}'
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: image/png'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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
object
string
object
string
string
The newly created repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"defaultBranch": "main",
"links": {},
"name": "My repo",
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"scmId": "git",
"slug": "my-repo"
}'
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;charset=UTF-8'
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
object
string
object
string
string
The updated repository.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"defaultBranch": "main",
"links": {},
"name": "My repo",
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"scmId": "git",
"slug": "my-repo"
}'
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
object
string
object
string
string
The newly created fork.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"defaultBranch": "main",
"links": {},
"name": "My repo",
"project": {
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
},
"scmId": "git",
"slug": "my-repo"
}'
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;charset=UTF-8'
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: */*'
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;charset=UTF-8'
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
string
RefType
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;charset=UTF-8'
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: */*'
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: */*'
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;charset=UTF-8'
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;charset=UTF-8'
Get a specified project settings restriction for the given namespace, feature key and component key. Note that not providing the component key will not return restrictions for the namespace and feature key with a component key set.
The authenticated user must have PROJECT_VIEW permission for the target project to retrieve a settings restriction.
string
Requiredstring
Requiredstring
string
RequiredThe settings restriction associated with the provided namespace and feature key
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings-restriction?namespace={namespace}&featureKey={featureKey}' \
--header 'Accept: application/json;charset=UTF-8'
Create a new project settings restriction for the given project.
The authenticated user must have PROJECT_ADMIN permission for the target project to create a settings restriction.
string
RequiredThe project settings restriction to create
string
string
Requiredstring
RequiredThe settings restriction was successfully created
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings-restriction' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"componentKey": "my-admin-component",
"featureKey": "my-admin-feature",
"namespace": "org.featuredeveloper"
}'
Delete a specified project settings restriction.
If a restriction does not exist for the specified project, namespace, featureKey, and componentKey, the request will be ignored and a 204 response will be returned.
The authenticated user must have PROJECT_ADMIN permission for the target project to delete a settings restriction.
string
Requiredstring
Requiredstring
string
RequiredThe specified settings restriction was successfully deleted or there were no existing restrictions that match the specified criteria.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings-restriction?namespace={namespace}&featureKey={featureKey}'
Get all project settings restrictions for the given namespace and feature key, including those with a component key set.
The authenticated user must have PROJECT_VIEW permission for the target project to retrieve a settings restrictions.
string
Requiredstring
Requiredstring
Requirednumber
number
A page of settings restrictions associated with the provided namespace and feature key
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings-restriction/all?namespace={namespace}&featureKey={featureKey}' \
--header 'Accept: application/json;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"enabled": true,
"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'
Retrieves the pull request auto-merge settings for the supplied project. Default settings will be returned if no explicit settings have been set for the project
The authenticated user must have PROJECT_VIEW permission for this project to call the resource.
string
RequiredThe pull request auto-merge settings
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/auto-merge' \
--header 'Accept: application/json;charset=UTF-8'
Creates or updates the pull request auto-merge settings for the supplied project, and applies the restriction action specified in the request.
The authenticated user must have PROJECT_ADMIN permission for this project to call the resource.
string
RequiredThe settings to create or update
boolean
string
The pull request auto-merge settings
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/auto-merge' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"enabled": false,
"restrictionAction": "CREATE"
}'
Deletes pull request auto-merge settings for the supplied project.
The authenticated user must have PROJECT_ADMIN permission for this project to call the resource.
string
RequiredThe pull request auto-merge settings
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/auto-merge'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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;charset=UTF-8'
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.
boolean
number
integer
integer
string
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;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"booleanValue": true,
"doubleValue": 1.1,
"integerValue": 1,
"longValue": -2147483648,
"stringValue": "This is an arbitrary string"
}'
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;charset=UTF-8'
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
20
21
22
23
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/pull-requests/{scmId}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"mergeConfig": {
"commitMessageTemplate": {
"body": "Merge in ${toProjectKey}/${toRepoSlug} from ${crossRepoProjectRepo}${fromRefName} to ${toRefName}",
"title": "Pull request #${id}: ${title}"
},
"commitSummaries": 2154,
"defaultStrategy": {
"id": "no-ff",
"links": {}
},
"strategies": [
{
"id": "no-ff",
"links": {}
}
]
}
}'
Find webhooks in this project.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredstring
boolean
A page of webhooks.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/webhooks' \
--header 'Accept: application/json;charset=UTF-8'
Create a webhook for the project specified via the URL.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
RequiredThe webhook to be created for this project.
boolean
object
RestWebhookCredentials
array<string>
string
string
boolean
object
string
A created webhook.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/webhooks' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"active": true,
"configuration": {},
"credentials": {
"password": "<string>",
"username": "<string>"
},
"events": [
"<string>"
],
"name": "<string>",
"scopeType": "<string>",
"sslVerificationRequired": true,
"statistics": {},
"url": "<string>"
}'
Test connectivity to a specific endpoint.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredinteger
boolean
string
Basic authentication credentials, if required.
string
string
A webhook.
RestWebhookRequestResponse
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/webhooks/test' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"password": "<string>",
"username": "<string>"
}'
Get a webhook by ID.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredstring
Requiredstring
A webhook.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/webhooks/{webhookId}' \
--header 'Accept: application/json;charset=UTF-8'
Update an existing webhook.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredstring
RequiredThe representation of the updated values for the webhook
boolean
object
RestWebhookCredentials
array<string>
string
string
boolean
object
string
A webhook.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/webhooks/{webhookId}' \
--header 'Accept: application/json;charset=UTF-8' \
--header 'Content-Type: application/json' \
--data '{
"active": true,
"configuration": {},
"credentials": {
"password": "<string>",
"username": "<string>"
},
"events": [
"<string>"
],
"name": "<string>",
"scopeType": "<string>",
"sslVerificationRequired": true,
"statistics": {},
"url": "<string>"
}'
Delete a webhook for the project specified via the URL.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredstring
RequiredThe webhook for the project has been deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/webhooks/{webhookId}'
Get the latest invocations for a specific webhook.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredstring
Requiredstring
string
A webhook invocation dataset.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/webhooks/{webhookId}/latest' \
--header 'Accept: application/json;charset=UTF-8'
Get the statistics for a specific webhook.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredstring
Requiredstring
A webhook invocation dataset.
RestInvocationHistory
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/webhooks/{webhookId}/statistics' \
--header 'Accept: application/json;charset=UTF-8'
Get the statistics summary for a specific webhook.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredstring
RequiredA webhook invocation dataset.
RestInvocationHistory
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/webhooks/{webhookId}/statistics/summary' \
--header 'Accept: application/json;charset=UTF-8'
Rate this page: