Gets the announcement banner, if one exists and is available to the user
This request has no parameters.
The requested banner
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/banner' \
--header 'Accept: application/json'
1
2
3
4
5
{
"audience": "AUTHENTICATED",
"message": "<string>",
"enabled": true
}
Sets the announcement banner with the provided JSON. Only users authenticated as Admins may call this resource
string
Requiredboolean
string
The banner was set successfully
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/banner' \
--header 'Content-Type: application/json' \
--data '{
"audience": "AUTHENTICATED",
"enabled": true,
"message": "<string>"
}'
Deletes a banner, if one is present in the database.
This request has no parameters.
The query executed successfully, whether a banner was deleted or not
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/banner'
Gets information about the nodes that currently make up the stash cluster.
The authenticated user must have the SYS_ADMIN permission to call this resource.
This request has no parameters.
A response containing information about the cluster
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/cluster' \
--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
{
"localNode": {
"buildVersion": "7.0.0",
"name": "foo",
"id": "d4fde8b1-2504-4998-a0ba-14fbe98edd4d",
"address": {
"address": "node.example.com",
"port": 8230
},
"local": true
},
"running": true,
"nodes": [
{
"buildVersion": "7.0.0",
"name": "foo",
"id": "d4fde8b1-2504-4998-a0ba-14fbe98edd4d",
"address": {
"address": "node.example.com",
"port": 8230
},
"local": true
}
]
}
Retrieves the configured global default branch, which is used when creating new repositories if an explicit default branch is not specified. The user must be authenticated to call this resource.
This request has no parameters.
The configured global default branch.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/default-branch' \
--header 'Accept: application/json'
Configures the global default branch, which is used when creating new repositories if an explicit default branch is not specified.
The authenticated user must have ADMIN permission to call this resource.
string
The default branch has been set.
1
2
3
4
5
6
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/default-branch' \
--header 'Content-Type: application/json' \
--data '{
"id": "<string>"
}'
Clears the global default branch, which is used when creating new repositories if an explicit default branch is not specified, if one has been configured.
The authenticated user must have ADMIN permission to call this resource.
This request has no parameters.
The default branch has been cleared.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/default-branch'
Obtain the control plane PEM.
The authenticated user must have SYS_ADMIN permission.
This request has no parameters.
The control plane PEM.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/config/control-plane.pem' \
--header 'Accept: text/plain'
Generates a connectivity report between the Bitbucket node(s) and the Mesh node(s).
The authenticated user must have SYS_ADMIN permission.
This request has no parameters.
The connectivity report between the Bitbucket node(s) and Mesh node(s).
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/diagnostics/connectivity' \
--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
{
"reports": [
{
"summaries": [
{
"summary": {
"reachable": true,
"roundTripTime": 100,
"errorMessage": "Unable to connect to the node."
},
"node": {
"name": "My Node",
"id": "1",
"type": "BITBUCKET"
}
}
],
"node": {
"name": "My Node",
"id": "1",
"type": "BITBUCKET"
}
}
]
}
Get all the registered Mesh nodes.
The authenticated user must have SYS_ADMIN permission.
This request has no parameters.
The list of registered Mesh nodes.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"rpcUrl": "http://127.0.0.1:7999",
"lastSeenDate": 1630041546433,
"rpcId": "1",
"name": "My node",
"id": "1",
"offline": false
}
Register a new Mesh node.
The authenticated user must have SYS_ADMIN permission.
The request specifying the new Mesh node.
string
number
string
string
string
boolean
The newly registered Mesh node.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"rpcUrl": "http://127.0.0.1:7999",
"lastSeenDate": 1630041546433,
"rpcId": "1",
"name": "My node",
"id": "1",
"offline": false
}'
1
2
3
4
5
6
7
8
{
"rpcUrl": "http://127.0.0.1:7999",
"lastSeenDate": 1630041546433,
"rpcId": "1",
"name": "My node",
"id": "1",
"offline": false
}
Get the registered Mesh node that matches the supplied ID.
The authenticated user must have SYS_ADMIN permission.
string
RequiredThe Mesh node that matches the ID.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes/{id}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"rpcUrl": "http://127.0.0.1:7999",
"lastSeenDate": 1630041546433,
"rpcId": "1",
"name": "My node",
"id": "1",
"offline": false
}
Update a Mesh node.
The authenticated user must have SYS_ADMIN permission.
string
RequiredThe request specifying the updated Mesh node.
string
number
string
string
string
boolean
The updated Mesh node.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/nodes/{id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"rpcUrl": "http://127.0.0.1:7999",
"lastSeenDate": 1630041546433,
"rpcId": "1",
"name": "My node",
"id": "1",
"offline": false
}'
1
2
3
4
5
6
7
8
{
"rpcUrl": "http://127.0.0.1:7999",
"lastSeenDate": 1630041546433,
"rpcId": "1",
"name": "My node",
"id": "1",
"offline": false
}
Get the support zips for all the Mesh nodes.
The authenticated user must have SYS_ADMIN permission.
This request has no parameters.
The support zips for all the Mesh nodes.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/support-zips' \
--header 'Accept: application/octet-stream'
Get the support zip for the Mesh node that matches the specified ID.
The authenticated user must have SYS_ADMIN permission.
string
RequiredThe support zip for the Mesh node that matches the ID.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/git/mesh/support-zips/{id}' \
--header 'Accept: application/octet-stream'
Retrieve a page of groups.
The authenticated user must have LICENSED_USER permission or higher to call this resource.
string
number
number
A page of groups.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/groups' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"values": [
{
"deletable": true,
"name": "group-a"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Create a new group.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe newly created group.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/groups?name={name}' \
--header 'Accept: application/json'
1
2
3
4
{
"deletable": true,
"name": "group-a"
}
Deletes the specified group, removing them from the system. This also removes any permissions that may have been granted to the group.
A user may not delete the last group that is granting them administrative permissions, or a group with greater permissions than themselves.
The authenticated user must have the ADMIN permission to call this resource.
string
RequiredThe deleted group.
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/groups?name={name}' \
--header 'Accept: application/json'
1
2
3
4
{
"deletable": true,
"name": "group-a"
}
Deprecated since 2.10. Use /rest/users/add-groups instead.
Add a user to a group.
In the request entity, the context attribute is the group and the itemName is the user.
The authenticated user must have the ADMIN permission to call this resource.
string
string
The user was added to the group.
any
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/groups/add-user' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"context": "group_a",
"itemName": "user_a"
}'
Add multiple users to a group.
The authenticated user must have the ADMIN permission to call this resource.
string
array<string>
RequiredAll the users were added to the group
any
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/groups/add-users' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"group": "group",
"users": [
"user1",
"user2"
]
}'
Retrieves a list of users that are members of a specified group.
The authenticated user must have the LICENSED_USER permission to call this resource.
string
string
Requirednumber
number
A page of users.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/groups/more-members?context={context}' \
--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
{
"values": [
{
"directoryName": "Bitbucket Internal Directory",
"lastAuthenticationTimestamp": 1368145580548,
"mutableDetails": true,
"mutableGroups": true,
"deletable": true,
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieves a list of users that are not members of a specified group.
The authenticated user must have the LICENSED_USER permission to call this resource.
string
string
Requirednumber
number
A page of users.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/groups/more-non-members?context={context}' \
--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
{
"values": [
{
"directoryName": "Bitbucket Internal Directory",
"lastAuthenticationTimestamp": 1368145580548,
"mutableDetails": true,
"mutableGroups": true,
"deletable": true,
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Deprecated since 2.10. Use /rest/users/remove-groups instead.
Remove a user from a group.
The authenticated user must have the ADMIN permission to call this resource.
In the request entity, the context attribute is the group and the itemName is the user.
string
string
The user was removed from the group.
any
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/groups/remove-user' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"context": "group_a",
"itemName": "user_a"
}'
Retrieves details about the current license, as well as the current status of the system with regards to the installed license. The status includes the current number of users applied toward the license limit, as well as any status messages about the license (warnings about expiry or user counts exceeding license limits).
The authenticated user must have ADMIN permission. Unauthenticated users, and non-administrators, are not permitted to access license details.
This request has no parameters.
The currently-installed license.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/license' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"serverId": "<server ID embedded in license>",
"creationDate": 1331038800000,
"daysBeforeExpiry": 2154,
"expiryDate": 1372493732817,
"gracePeriodEndDate": 1372493732817,
"maintenanceExpiryDate": 1372493732817,
"maximumNumberOfUsers": 12,
"numberOfDaysBeforeExpiry": 2154,
"numberOfDaysBeforeGracePeriodExpiry": 2154,
"numberOfDaysBeforeMaintenanceExpiry": 2154,
"purchaseDate": 1331038800000,
"supportEntitlementNumber": "<support entitlement number embedded in license>",
"unlimitedNumberOfUsers": true,
"status": {
"serverId": "<actual server ID>",
"currentNumberOfUsers": 2
},
"license": "<encoded license text>"
}
Decodes the provided encoded license and sets it as the active license. If no license was provided, a 400 is returned. If the license cannot be decoded, or cannot be applied, a 409 is returned. Some possible reasons a license may not be applied include:
Otherwise, if the license is updated successfully, details for the new license are returned with a 200 response.
Warning: It is possible to downgrade the license during update, applying a license with a lower number of permitted users. If the number of currently-licensed users exceeds the limits of the new license, pushing will be disabled until the licensed user count is brought into compliance with the new license.
The authenticated user must have SYS_ADMIN permission. ADMIN users may view the current license details, but they may not update the license.
a JSON payload containing the encoded license to apply
string
The newly-installed license.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/license' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"license": "<encoded license text>"
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"serverId": "<server ID embedded in license>",
"creationDate": 1331038800000,
"daysBeforeExpiry": 2154,
"expiryDate": 1372493732817,
"gracePeriodEndDate": 1372493732817,
"maintenanceExpiryDate": 1372493732817,
"maximumNumberOfUsers": 12,
"numberOfDaysBeforeExpiry": 2154,
"numberOfDaysBeforeGracePeriodExpiry": 2154,
"numberOfDaysBeforeMaintenanceExpiry": 2154,
"purchaseDate": 1331038800000,
"supportEntitlementNumber": "<support entitlement number embedded in license>",
"unlimitedNumberOfUsers": true,
"status": {
"serverId": "<actual server ID>",
"currentNumberOfUsers": 2
},
"license": "<encoded license text>"
}
Retrieves the current mail configuration.
The authenticated user must have the SYS_ADMIN permission to call this resource.
This request has no parameters.
The mail configuration
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"senderAddress": "stash-no-reply@company.com",
"hostname": "smtp.example.com",
"requireStartTls": true,
"useStartTls": true,
"port": 465,
"protocol": "SMTP",
"password": "password",
"username": "user"
}
Updates the mail configuration.
The authenticated user must have the SYS_ADMIN permission to call this resource.
string
string
integer
string
boolean
string
boolean
string
The updated mail configuration.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"hostname": "smtp.example.com",
"password": "password",
"port": 465,
"protocol": "SMTP",
"requireStartTls": true,
"senderAddress": "stash-no-reply@company.com",
"useStartTls": true,
"username": "user"
}'
1
2
3
4
5
6
7
8
9
10
{
"senderAddress": "stash-no-reply@company.com",
"hostname": "smtp.example.com",
"requireStartTls": true,
"useStartTls": true,
"port": 465,
"protocol": "SMTP",
"password": "password",
"username": "user"
}
Deletes the current mail configuration.
The authenticated user must have the SYS_ADMIN permission to call this resource.
This request has no parameters.
The mail configuration was successfully deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server'
Retrieves the server email address
This request has no parameters.
The server email address
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server/sender-address' \
--header 'Accept: application/json'
Updates the server email address
The authenticated user must have the ADMIN permission to call this resource.
string
The from address used in notification emails
any
1
2
3
4
5
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server/sender-address' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '"<string>"'
Clears the server email address.
The authenticated user must have the ADMIN permission to call this resource.
This request has no parameters.
he server email address was successfully cleared.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/mail-server/sender-address'
Retrieve a page of groups that have been granted at least one global permission.
The authenticated user must have ADMIN permission or higher to call this resource.
string
number
number
A page of groups and their highest global permissions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/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,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Promote or demote a user's global permission level. Available global permissions are:
See the Bitbucket Server documentation for a detailed explanation of what each permission entails.
The authenticated user must have:
to call this resource. In addition, a user may not demote a group's permission level if their own permission level would be reduced as a result.
array<string>
Requiredstring
RequiredThe specified permission was granted to the specified user.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/groups?name={name}&permission={permission}'
Revoke all global permissions for a group.
The authenticated user must have:
to call this resource. In addition, a user may not revoke a group's permissions if their own permission level would be reduced as a result.
string
RequiredAll global permissions were revoked from the group.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/groups?name={name}'
Retrieve a page of groups that have no granted global permissions.
The authenticated user must have ADMIN permission or higher to call this resource.
string
number
number
A page of groups that have not been granted any global permissions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/groups/none' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"values": [
{
"deletable": true,
"name": "group-a"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of users that have been granted at least one global permission.
The authenticated user must have ADMIN permission or higher to call this resource.
string
number
number
A page of users and their highest global permissions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/users' \
--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,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Promote or demote the global permission level of a user. Available global permissions are:
See the Bitbucket Server documentation for a detailed explanation of what each permission entails.
The authenticated user must have:
to call this resource. In addition, a user may not demote their own permission level.
array<string>
Requiredstring
RequiredThe requested permission was granted.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/users?name={name}&permission={permission}'
Revoke all global permissions for a user.
The authenticated user must have:
to call this resource. In addition, a user may not demote their own permission level.
string
RequiredAll global permissions were revoked from the user.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/permissions/users?name={name}'
Retrieve a page of users that have no granted global permissions.
The authenticated user must have ADMIN permission or higher to call this resource.
string
number
number
A page of users that have not been granted any global permissions.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/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": [
{
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve the merge strategies available for this instance. The user must be authenticated to call this resource.
string
RequiredThe merge configuration of this instance.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/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
{
"strategies": [
{
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
}
],
"commitSummaries": 2154,
"defaultStrategy": {
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
},
"type": "repository"
}
Update the pull request merge strategies for the context repository.
The authenticated user must have ADMIN permission to call this resource.
Only the strategies provided will be enabled, only one may be set to default
An explicitly set pull request merge strategy configuration can be deleted by POSTing a document with an empty "mergeConfig" attribute. i.e:```{ "mergeConfig": { } }
1 2
Upon completion of this request, the effective configuration will be the default configuration.
string
Requiredthe settings
object
The repository pull request merge strategies for the context repository.
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/admin/pull-requests/{scmId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"mergeConfig": {
"strategies": [
{
"id": "no-ff",
"links": {}
}
],
"commitSummaries": 2154,
"defaultStrategy": {
"id": "no-ff",
"links": {}
}
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"strategies": [
{
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
}
],
"commitSummaries": 2154,
"defaultStrategy": {
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
},
"type": "repository"
}
Retrieves the recent rate limit history for the instance.
The authenticated user must have the ADMIN permission to call this resource.
string
number
number
A response containing a page of aggregated counters for users who have been recently rate limited.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/history' \
--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
{
"values": [
{
"lastRejectTime": 1630041546433,
"rejectCount": 5,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieves the rate limit settings for the instance. The user must be authenticated to call this resource.
This request has no parameters.
A response containing the rate limit plugin settings for the instance.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
{
"defaultSettings": {
"capacity": 60,
"fillRate": 5
},
"enabled": true
}
Sets the rate limit settings for the instance.
The authenticated user must have ADMIN permission to call this resource.
Sets the rate limit settings for the instance.
The authenticated user must have ADMIN permission to call this resource.
object
boolean
A response containing the updated rate limit plugin settings for the instance.
1
2
3
4
5
6
7
8
9
10
11
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"defaultSettings": {
"capacity": 60,
"fillRate": 5
},
"enabled": true
}'
1
2
3
4
5
6
7
{
"defaultSettings": {
"capacity": 60,
"fillRate": 5
},
"enabled": true
}
Retrieves the user-specific rate limit settings for the given user.
The authenticated user must have ADMIN permission to call this resource.
string
number
number
A response containing all the user-specific rate limit settings filtered by the optional filter.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/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
22
23
24
25
{
"values": [
{
"whitelisted": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"settings": {
"capacity": 60,
"fillRate": 5
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Sets the given rate limit settings for the given users.
The authenticated user must have ADMIN permission to call this resource.
object
array<string>
boolean
A response containing the updated user settings.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"settings": {
"capacity": 60,
"fillRate": 5
},
"usernames": [
"<string>"
],
"whitelisted": true
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"whitelisted": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"settings": {
"capacity": 60,
"fillRate": 5
}
}
Retrieves the user-specific rate limit settings for the given user.
To call this resource, the user must be authenticated and either have ADMIN permission or be the same user as the one whose settings are requested. A user with ADMIN permission cannot get the settings of a user with SYS_ADMIN permission.
string
RequiredA response containing the user-specific rate limit settings for the given user.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users/{userSlug}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"whitelisted": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"settings": {
"capacity": 60,
"fillRate": 5
}
}
Sets the given rate limit settings for the given user.
The authenticated user must have ADMIN permission to call this resource.
string
Requiredobject
boolean
A response containing the updated user settings
1
2
3
4
5
6
7
8
9
10
11
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users/{userSlug}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"settings": {
"capacity": 60,
"fillRate": 5
},
"whitelisted": true
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"whitelisted": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"settings": {
"capacity": 60,
"fillRate": 5
}
}
Deletes the user-specific rate limit settings for the given user.
The authenticated user must have ADMIN permission to call this resource.
string
RequiredAn empty response indicating that the user settings have been deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/rate-limit/settings/users/{userSlug}'
Retrieve a page of users.
The authenticated user must have the LICENSED_USER permission to call this resource.
string
number
number
A page of users.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/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
22
23
{
"values": [
{
"directoryName": "Bitbucket Internal Directory",
"lastAuthenticationTimestamp": 1368145580548,
"mutableDetails": true,
"mutableGroups": true,
"deletable": true,
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Update a user's details.
The authenticated user must have the ADMIN permission to call this resource.
string
string
string
The updated user.
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/users' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "Jane Citizen",
"email": "jane@example.com",
"name": "jcitizen"
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"directoryName": "Bitbucket Internal Directory",
"lastAuthenticationTimestamp": 1368145580548,
"mutableDetails": true,
"mutableGroups": true,
"deletable": true,
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
Creates a new user from the assembled query parameters.
The default group can be used to control initial permissions for new users, such as granting users the ability to login or providing read access to certain projects or repositories. If the user is not added to the default group, they may not be able to login after their account is created until explicit permissions are configured.
The authenticated user must have the ADMIN permission to call this resource.
string
Requiredstring
boolean
string
Requiredstring
Requiredboolean
The user was successfully created.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/users?emailAddress={emailAddress}&displayName={displayName}&name={name}'
Deletes the specified user, removing them from the system. This also removes any permissions that may have been granted to the user.
A user may not delete themselves, and a user with ADMIN permissions may not delete a user with SYS_ADMINpermissions.
The authenticated user must have the ADMIN permission to call this resource.
string
RequiredThe deleted user.
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/users?name={name}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"directoryName": "Bitbucket Internal Directory",
"lastAuthenticationTimestamp": 1368145580548,
"mutableDetails": true,
"mutableGroups": true,
"deletable": true,
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
Deprecated since 2.10. Use /rest/users/add-groups instead.
Add a user to a group. This is very similar to groups/add-user
, but with the context and itemName attributes of the supplied request entity reversed. On the face of it this may appear redundant, but it facilitates a specific UI component in Stash.
In the request entity, the context attribute is the user and the itemName is the group.
The authenticated user must have the ADMIN permission to call this resource.
string
string
The user was added to the group
any
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/users/add-group' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"context": "group_a",
"itemName": "user_a"
}'
Add a user to one or more groups.
The authenticated user must have the ADMIN permission to call this resource.
array<string>
Requiredstring
The user was added to all the groups
any
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/users/add-groups' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"groups": [
"group_a",
"group_b"
],
"user": "user"
}'
Clears any CAPTCHA challenge that may constrain the user with the supplied username when they authenticate. Additionally any counter or metric that contributed towards the user being issued the CAPTCHA challenge (for instance too many consecutive failed logins) will also be reset.
The authenticated user must have the ADMIN permission to call this resource, and may not clear the CAPTCHA of a user with greater permissions than themselves.
string
RequiredThe CAPTCHA was successfully cleared.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/admin/users/captcha?name={name}'
Update a user's password.
The authenticated user must have the ADMIN permission to call this resource, and may not update the password of a user with greater permissions than themselves.
string
string
string
The user's password was successfully updated.
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/admin/users/credentials' \
--header 'Content-Type: application/json' \
--data '{
"name": "jcitizen",
"password": "my-secret-password",
"passwordConfirm": "my-secret-password"
}'
Validate if a user can be erased.
A username is only valid for erasure if it exists as the username of a deleted user. This endpoint will return an appropriate error response if the supplied username is invalid for erasure.
This endpoint does not perform the actual user erasure, and will not modify the application in any way.
The authenticated user must have the ADMIN permission to call this resource.
string
Requiredthe user is erasable
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/users/erasure?name={name}'
Erases personally identifying user data for a deleted user.
References in the application to the original username will be either removed or updated to a new non-identifying username. Refer to the support guide for details about what data is and isn't erased.
User erasure can only be performed on a deleted user. If the user has not been deleted first then this endpoint will return a bad request and no erasure will be performed.
Erasing user data is irreversible and may lead to a degraded user experience. This method should not be used as part of a standard user deletion and cleanup process.
Plugins can participate in user erasure by defining a <user-erasure-handler>
module. If one or more plugin modules fail, an error summary of the failing modules is returned.
The authenticated user must have the ADMIN permission to call this resource.
string
RequiredThe identifier of the erased user.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/users/erasure?name={name}' \
--header 'Accept: application/json'
1
2
3
{
"newIdentifier": "user-123ab"
}
Retrieves a list of users that are not members of a specified group.
The authenticated user must have the LICENSED_USER permission to call this resource.
string
string
Requirednumber
number
A page of users.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/users/more-members?context={context}' \
--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
{
"values": [
{
"directoryName": "Bitbucket Internal Directory",
"lastAuthenticationTimestamp": 1368145580548,
"mutableDetails": true,
"mutableGroups": true,
"deletable": true,
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieves a list of groups the specified user is not a member of.
The authenticated user must have the LICENSED_USER permission to call this resource.
string
string
Requirednumber
number
A page of groups.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/admin/users/more-non-members?context={context}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"values": [
{
"deletable": true,
"name": "group-a"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Remove a user from a group. This is very similar to groups/remove-user
, but with the context and itemName attributes of the supplied request entity reversed. On the face of it this may appear redundant, but it facilitates a specific UI component in Stash.
In the request entity, the context attribute is the user and the itemName is the group.
The authenticated user must have the ADMIN permission to call this resource.
string
string
The user was removed from the group.
any
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/users/remove-group' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"context": "group_a",
"itemName": "user_a"
}'
Rename a user.
The authenticated user must have the ADMIN permission to call this resource.
string
string
The renamed user.
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/admin/users/rename' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "jcitizen",
"newName": "jcitizen-new"
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"directoryName": "Bitbucket Internal Directory",
"lastAuthenticationTimestamp": 1368145580548,
"mutableDetails": true,
"mutableGroups": true,
"deletable": true,
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
Retrieve version information and other application properties. No authentication is required to call this resource.
This request has no parameters.
The application properties
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/application-properties' \
--header 'Accept: application/json'
1
2
3
4
5
6
{
"buildDate": "1358897885952000",
"displayName": "Example.com Bitbucket",
"version": "2.1.0",
"buildNumber": "20220123103656677"
}
Returns the build capabilities of this instance
This request has no parameters.
capabilities
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/build/capabilities' \
--header 'Accept: application/json'
1
2
3
4
5
{
"buildStatus": [
"richBuildStatus"
]
}
Retrieves a page of suggestions for pull requests that the currently authenticated user may wish to raise. Such suggestions are based on ref changes occurring and so contain the ref change that prompted the suggestion plus the time the change event occurred. Changes will be returned in descending order based on the time the change that prompted the suggestion occurred. Note that although the response is a page object, the interface does not support paging, however a limit can be applied to the size of the returned page.
string
string
A page of pull requests that match the search criteria.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/dashboard/pull-request-suggestions' \
--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
{
"values": [
{
"fromRef": {
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"toRef": {
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
},
"changeTme": 1359075920,
"refChange": {
"fromHash": "6053a1eaa1c009dd11092d09a72f3c41af1b59ad",
"toHash": "d6edcbf924697ab811a867421dab60d954ccad99",
"refId": "refs/heads/master",
"type": "ADD",
"ref": {
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
},
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of pull requests where the current authenticated user is involved as either a reviewer, author or a participant. The request may be filtered by pull request state, role or participant status.
string
string
string
string
string
number
number
A page of pull requests that match the search criteria.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/dashboard/pull-requests' \
--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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{
"values": [
{
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Returns the Deployment capabilities of this instance
This request has no parameters.
capabilities
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/deployment/capabilities' \
--header 'Accept: application/json'
Retrieve a page of group names.
The authenticated user must have LICENSED_USER permission or higher to call this resource.
string
number
number
A page of group names.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/groups' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"values": [
"<string>"
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Create a new hook script.
This endpoint requires SYS_ADMIN permission.
The multipart form data containing the hook script
string
string
string
string
The newly created hook script.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/hook-scripts' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"createdDate": "<string>",
"updatedDate": "<string>",
"version": 2154,
"name": "<string>",
"id": 2154,
"type": "POST",
"description": "<string>",
"pluginKey": "<string>"
}
Retrieves a hook script by ID.
string
RequiredThe hook script.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"createdDate": "<string>",
"updatedDate": "<string>",
"version": 2154,
"name": "<string>",
"id": 2154,
"type": "POST",
"description": "<string>",
"pluginKey": "<string>"
}
Updates a hook script.
This endpoint requires SYS_ADMIN permission.
string
RequiredThe multipart form data containing the hook script
string
string
string
The updated hook script.
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"createdDate": "<string>",
"updatedDate": "<string>",
"version": 2154,
"name": "<string>",
"id": 2154,
"type": "POST",
"description": "<string>",
"pluginKey": "<string>"
}
Deletes a registered hook script.
This endpoint requires SYS_ADMIN permission.
string
RequiredThe hook script was deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}'
Retrieves the hook script content.
This endpoint requires SYS_ADMIN permission.
string
RequiredThe hook script content.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/hook-scripts/{scriptId}/content' \
--header 'Accept: application/json'
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'
string
integer
integer
default response
any
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/inbox/pull-requests'
This request has no parameters.
default response
any
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/inbox/pull-requests/count'
Returns a paged response of all the labels in the system. The user needs to be authenticated to use this resource.
string
number
number
Page of returned labels.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/labels' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
{
"values": [
{
"name": "labelName"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Returns a label. The user needs to be authenticated to use this resource.
string
RequiredThe label.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/labels/{labelName}' \
--header 'Accept: application/json'
1
2
3
{
"name": "labelName"
}
Returns a page of labelables for a given label. Only labelables that the authenticated user has view access to will be returned.
string
Requiredstring
number
number
The page of labelables.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/labels/{labelName}/labeled' \
--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
{
"values": [
{
"labelableType": "REPOSITORY",
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve the current log level for a given logger.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe log level of the logger.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/logs/logger/{loggerName}' \
--header 'Accept: application/json'
1
2
3
{
"logLevel": "DEBUG"
}
Set the current log level for a given logger.
The authenticated user must have ADMIN permission or higher to call this resource.
string
Requiredstring
RequiredThe log level was successfully changed.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/logs/logger/{loggerName}/{levelName}'
Retrieve the current log level for the root logger.
The authenticated user must have ADMIN permission or higher to call this resource.
This request has no parameters.
The log level of the logger.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/logs/rootLogger' \
--header 'Accept: application/json'
1
2
3
{
"logLevel": "DEBUG"
}
Set the current log level for the root logger.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe log level was successfully changed.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/logs/rootLogger/{levelName}'
Preview generated HTML for the given markdown content. Only authenticated users may call this resource.
string
string
string
string
string
The rendered markdown.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/markup/preview' \
--header 'Accept: application/json'
1
2
3
{
"html": "<h1>Hello World!</h1>"
}
Starts a background job that exports the selected repositories.
Only 2 concurrent exports are supported per cluster node. If a request ends up on a node that is already running that many export jobs, the request will be rejected and an error returned.
The response includes a description of the job that has been started, and its ID can be used to query these details again, including the current progress, warnings and errors that occurred while processing the job, and to interrupt and cancel the execution of this job.
The request to start an export is similar to the one for previewing an export. Additionally, it accepts an optional parameter, exportLocation
, which can be used to specify a relative path within data/migration/export
in the shared home directory. No locations outside of that directory will be accepted for exports.
There are essentially three ways to select repositories for export. Regardless of which you use, a few general rules apply:
Now, a single repository can be selected like this:
1 2 3 4 5 6 7 8
{ "projectKey": "PRJ", "slug": "my-repo" }
Second, all repositories in a specific project can be selected like this:
1 2 3 4 5 6 7 8
{ "projectKey": "PRJ", "slug": *" }
And third, all projects and repositories in the system would be selected like this:
1 2 3 4 5 6 7 8
{ "projectKey": "*", "slug": *" }
The authenticated user must have ADMIN permission or higher to call this resource.
The request
string
object
RequiredDetails about the export job.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/exports' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"exportLocation": "example/sub/directory",
"repositoriesRequest": {
"includes": [
{
"projectKey": "PRJ",
"slug": "my-repo"
}
]
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"endDate": 1497657603000,
"startDate": 1497657601000,
"nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4",
"initiator": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1497657603000,
"progress": {
"percentage": 42,
"message": "Working on it..."
},
"id": 1,
"state": "INITIALISING",
"type": "com.atlassian.bitbucket.migration.export"
}
Enumerates the projects and repositories that would be exported for a given export request.
All affected repositories will be enumerated explicitly, and while projects are listed as individual items in responses from this endpoint, their presence does not imply that all their repositories are included.
While this endpoint can be used to verify that all selectors in the request apply as intended, it should be noted that a subsequent, actual export might contain a different set of repositories, as they might have been added or deleted in the meantime.
Note that the overall response from this endpoint can become very large when a lot of repositories end up in the selection. This is why the server is streaming the response while it is being generated (as opposed to creating it in memory and then sending it all at once) and it can be consumed in a streaming way, too.
Also, due to the potential size of the response, projects and repositories are listed with fewer details than in other REST responses.
For a more detailed description of selectors, see the endpoint documentation for starting an export.
The authenticated user must have ADMIN permission or higher to call this resource.
the export request
string
object
RequiredThe effectively selected projects and repositories.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/exports/preview' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"exportLocation": "example/sub/directory",
"repositoriesRequest": {
"includes": [
{
"projectKey": "PRJ",
"slug": "my-repo"
}
]
}
}'
1
2
3
4
5
{
"scopes": [
{}
]
}
Gets the details, including the current status and progress, of the export job identified by the given ID.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe job, including status and progress information.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/exports/{jobId}' \
--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
{
"endDate": 1497657603000,
"startDate": 1497657601000,
"nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4",
"initiator": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1497657603000,
"progress": {
"percentage": 42,
"message": "Working on it..."
},
"id": 1,
"state": "INITIALISING",
"type": "com.atlassian.bitbucket.migration.export"
}
Requests the cancellation of an export job.
The request to cancel a job will be processed successfully if the job is actually still running. If it has already finished (successfully or with errors) or if it has already been canceled before, then an error will be returned.
There might be a small delay between accepting the request and actually cancelling the job. In most cases, the delay will be close to instantaneously. In the unlikely case of communication issues across a cluster, it can however take a few seconds to cancel a job.
A client should always actively query the job status to confirm that a job has been successfully canceled.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe job has successfully been marked for cancellation
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/exports/{jobId}/cancel'
Gets the messages generated by the job.
Without any filter, all messages will be returned, but the response can optionally be filtered for the following severities. The severity parameter can be repeated to include multiple severities in one response.
The authenticated user must have ADMIN permission or higher to call this resource.
string
Requiredstring
string
number
number
The messages generated by this job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/exports/{jobId}/messages' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"values": [
{
"createdDate": "<string>",
"severity": "INFO",
"subject": "job",
"id": "617",
"text": "Something of interest happened"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Starts a background job that imports the specified archive.
Only 1 import at a time is supported per cluster. If another request is made while an import is already running, the request will be rejected and an error returned.
The path in the request must point to a valid archive file. The file must be located within the data/migration/import
directory in the shared home directory.
The authenticated user must have ADMIN permission or higher to call this resource.
The request
string
Details about the export job.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/imports' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"archivePath": "Bitbucket_export_1.tar"
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"endDate": 1497657603000,
"startDate": 1497657601000,
"nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4",
"initiator": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1497657603000,
"progress": {
"percentage": 42,
"message": "Working on it..."
},
"id": 1,
"state": "INITIALISING",
"type": "com.atlassian.bitbucket.migration.export"
}
Gets the details, including the current status and progress, of the import job identified by the given ID.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe job, including status and progress information.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/imports/{jobId}' \
--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
{
"endDate": 1497657603000,
"startDate": 1497657601000,
"nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4",
"initiator": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1497657603000,
"progress": {
"percentage": 42,
"message": "Working on it..."
},
"id": 1,
"state": "INITIALISING",
"type": "com.atlassian.bitbucket.migration.export"
}
Requests the cancellation of an import job.
The request to cancel a job will be processed successfully if the job is actually still running. If it has already finished (successfully or with errors) or if it has already been canceled before, then an error will be returned.
Note that import jobs are not canceled as instantaneously as export jobs. Rather, once the request has been accepted, there are a number of checkpoints at which the job will actually apply it and stop. This is to keep the system in a reasonably consistent state:
A client should always actively query the job status to confirm that a job has been successfully canceled.
The authenticated user must have ADMIN permission or higher to call this resource.
string
RequiredThe job has successfully been marked for cancellation.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/imports/{jobId}/cancel'
Gets the messages generated by the job.
Without any filter, all messages will be returned, but the response can optionally be filtered for the following severities. The severity parameter can be repeated to include multiple severities in one response.
The authenticated user must have ADMIN permission or higher to call this resource.
string
Requiredstring
string
number
number
The messages generated by this job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/imports/{jobId}/messages' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"values": [
{
"createdDate": "<string>",
"severity": "INFO",
"subject": "job",
"id": "617",
"text": "Something of interest happened"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Starts a background job that migrates selected projects/repositories to Mesh.
Only 1 job is supported per cluster.
The response includes a description of the job that has been started, and its ID can be used to query these details again, including the current progress, and to interrupt and cancel the execution of this job.
The request to start a migration is similar to the one for previewing a migration.
There are essentially three ways to select repositories for migration. Regardless of which you use, a few general rules apply:
1
- You can supply a list of repository IDs and project IDs. The selection will be additive. All repositories in the system are migrated if both lists are empty. - Repositories that are selected more than once due to overlapping IDs will be de-duplicated and effectively migrated only once. - For every selected repository, its full fork hierarchy will be considered selected, even if parts of that hierarchy would otherwise not be matched by the provided IDs. For example, when you explicitly select a single repository only, but that repository is a fork, then its origin will be migrated too.
Now, a single repository can be selected like this:
1 2 3 4
{ "repositoryIds": [1] }
Multiple repositories can be selected like this:
1 2 3 4
{ "repositoryIds": [1, 2] }
Second, all repositories in a specific project can be selected like this:
1 2 3 4
{ "projectIds": [1] }
And third, all projects and repositories in the system would be selected like this:
1 2 3 4 5
{ "projectIds": [], "repositoryIds": [] }
The authenticated user must have SYS_ADMIN permission to call this resource.
boolean
object
array<integer>
array<integer>
The started job
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/migration/mesh' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"all": true,
"maxBytesPerSecond": {
"asLong": 2154,
"present": true
},
"projectIds": [
2154
],
"repositoryIds": [
2154
]
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"endDate": 1497657603000,
"startDate": 1497657601000,
"nodeId": "1bec7499-077a-4b58-b27c-996a9c2187a4",
"initiator": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1497657603000,
"progress": {
"percentage": 42,
"message": "Working on it..."
},
"id": 1,
"state": "INITIALISING",
"type": "com.atlassian.bitbucket.migration.export"
}
Enumerates the projects and repositories that would be migrated for a given request.
All affected repositories will be enumerated explicitly, and while projects are listed as individual items in responses from this endpoint, their presence does not imply that all their repositories are included.
While this endpoint can be used to verify that all selectors in the request apply as intended, it should be noted that a subsequent, actual export might contain a different set of repositories, as they might have been added or deleted in the meantime.
Note that the overall response from this endpoint can become very large when a lot of repositories end up in the selection. This is why the server is streaming the response while it is being generated (as opposed to creating it in memory and then sending it all at once) and it can be consumed in a streaming way, too.
Also, due to the potential size of the response, projects and repositories are listed with fewer details than in other REST responses.
The authenticated user must have SYS_ADMIN permission to call this resource.
The export request
boolean
object
array<integer>
array<integer>
Enumeration of projects and repositories that would be migrated for a given request.
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/migration/mesh/preview' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"all": true,
"maxBytesPerSecond": {
"asLong": 2154,
"present": true
},
"projectIds": [
2154
],
"repositoryIds": [
2154
]
}'
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
{
"repositories": [
{
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
]
}
Searches for repositories in the system matching the specified criteria and enriches their MeshMigrationQueueState migration state if a migration is currently in progress.
The currently active migration can optionally be specified by passing a migrationId, if known. If this isn't passed, an attempt is made to locate the active migration and its ID is used.
If a migration is currently active, only repositories that are a part of the migration are filtered and returned. Otherwise, all repositories in the systems are filtered and returned.
Filtering by state is ignored when no migration is currently in progress. In such a case, results are not enriched with their MeshMigrationQueueState migration state.
The authenticated user must have SYS_ADMIN permission to call this resource.
string
string
string
string
string
number
number
A page of repositories matching the specified criteria.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/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
{
"values": [
{
"migrationState": "QUEUED",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of Mesh migration job summaries. Jobs are ordered by when they were started, newest first.
The authenticated user must have SYS_ADMIN permission to call this resource.
number
number
The summary of the migration job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/summaries' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"values": [
{
"jobId": 2154,
"endTime": 1331038800000,
"maxBandwidth": 2154,
"progress": 53,
"queue": {},
"state": "RUNNING",
"startTime": 1331038800000
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Gets the summary, including the queue status and progress, of the currently active Mesh migration job.
The authenticated user must have SYS_ADMIN permission to call this resource.
This request has no parameters.
The summary of the currently active migration job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/summary' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"jobId": 2154,
"endTime": 1331038800000,
"maxBandwidth": 2154,
"progress": 53,
"queue": {},
"state": "RUNNING",
"startTime": 1331038800000
}
Gets the details, including the current status and progress, of the job identified by the given ID.
The authenticated user must have SYS_ADMIN permission to call this resource.
string
RequiredThe details of the migration job.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}' \
--header 'Accept: application/json'
Requests the cancellation of a migration job.
The request to cancel a job will be processed successfully if the job is actually still running. If it has already finished (successfully or with errors) or if it has already been canceled before, then an error will be returned.
There might be a small delay between accepting the request and actually cancelling the job. In most cases, the delay will be close to instantaneously. In the unlikely case of communication issues across a cluster, it can however take a few seconds to cancel a job.
A client should always actively query the job status to confirm that a job has been successfully canceled.
The authenticated user must have SYS_ADMIN permission to call this resource.
string
RequiredThe migration job was successfully marked for cancellation.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}/cancel'
Gets the messages generated by the job.
Without any filter, all messages will be returned, but the response can optionally be filtered for the following severities. The severity parameter can be repeated to include multiple severities in one response.
1 2 3
- INFO - WARN - ERROR
The authenticated user must have SYS_ADMIN permission to call this resource.
string
Requiredstring
string
number
number
The details of the migration job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}/messages' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"values": [
{
"createdDate": "<string>",
"severity": "INFO",
"subject": "job",
"id": "617",
"text": "Something of interest happened"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Gets the summary, including the queue status and progress, of a Mesh migration job.
The authenticated user must have SYS_ADMIN permission to call this resource.
string
RequiredThe summary of the migration job.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/migration/mesh/{jobId}/summary' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"jobId": 2154,
"endTime": 1331038800000,
"maxBandwidth": 2154,
"progress": 53,
"queue": {},
"state": "RUNNING",
"startTime": 1331038800000
}
Retrieve a page of recently accessed repositories for the currently authenticated user.
Repositories are ordered from most recently to least recently accessed.
Only authenticated users may call this resource.
string
number
number
A page of recently accessed repositories.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/profile/recent/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
{
"values": [
{
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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": [
{
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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 '{
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
}'
1
2
3
4
5
6
7
8
9
10
11
{
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
}
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
{
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
}
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 '{
"avatar": "<string>",
"avatarUrl": "<string>",
"key": "PRJ",
"links": {}
}'
1
2
3
4
5
6
7
8
9
10
11
{
"avatar": "<string>",
"name": "My Cool Project",
"key": "PRJ",
"public": true,
"id": 2154,
"type": "NORMAL",
"description": "The description for my cool project",
"namespace": "<string>",
"scope": "PROJECT"
}
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": {
"createdDate": "<string>",
"updatedDate": "<string>",
"version": 2154,
"name": "<string>",
"id": 2154,
"type": "POST",
"description": "<string>",
"pluginKey": "<string>"
},
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"triggerIds": [
"<string>"
]
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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": {
"createdDate": "<string>",
"updatedDate": "<string>",
"version": 2154,
"name": "<string>",
"id": 2154,
"type": "POST",
"description": "<string>",
"pluginKey": "<string>"
},
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"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,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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": [
{
"deletable": true,
"name": "group-a"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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": [
{
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"permission": "USER_ADMIN"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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": [
{
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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
{
"values": [
{
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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
string
object
The newly created repository.
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"project": "PROJ",
"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
{
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
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
{
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
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
string
object
The updated repository.
1
2
3
4
5
6
7
8
9
10
11
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"project": "PROJ",
"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
{
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
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
string
object
The newly created fork.
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"project": "PROJ",
"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
{
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
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'
Streams an archive of the repository's contents at the requested commit. If no at=
commit is requested, an archive of the default branch is streamed.
The filename=
query parameter may be used to specify the exact filename to include in the "Content-Disposition" header. If an explicit filename is not provided, one will be automatically generated based on what is being archived. Its format depends on the at= value:
No at=
commit: <slug>-<default-branch-name>@<commit>.<format>; e.g. example-master@43c2f8a0fe8.zip
at=
sha: <slug>-<at>.<format>; e.g. example-09bcbb00100cfbb5310fb6834a1d5ce6cac253e9.tar.gz
at=
branchOrTag: <slug>-<branchOrTag>@<commit>.<format>; e.g. example-feature@bbb225f16e1.tar
Archives may be requested in the following formats by adding the format=
query parameter:
The contents of the archive may be filtered by using the path=
query parameter to specify paths to include. path=
may be specified multiple times to include multiple paths.
The prefix=
query parameter may be used to define a directory (or multiple directories) where the archive's contents should be placed. If the prefix does not end with /, one will be added automatically. The prefix is always treated as a directory; it is not possible to use it to prepend characters to the entries in the archive.
Archives of public repositories may be streamed by any authenticated or anonymous user. Streaming archives for non-public repositories requires an authenticated user with at least REPO_READ permission.
string
Requiredstring
Requiredstring
string
string
string
string
An archive or the requested commit, in zip, tar or gzipped-tar format.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/archive' \
--header 'Accept: application/json'
Retrieve the attachment.
The authenticated user must have REPO_READ permission for the specified repository that is associated to the attachment.
string
Requiredstring
Requiredstring
Requiredstring
the attachment
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}' \
--header 'Accept: application/json'
Delete an attachment.
The user must be authenticated and have REPO_ADMIN permission for the specified repository.
string
Requiredstring
Requiredstring
RequiredThis status code has no content.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}'
Retrieve the attachment metadata.
The authenticated user must have REPO_READ permission for the specified repository that is associated to the attachment that has the attachment metadata.
string
Requiredstring
Requiredstring
RequiredThe attachment metadata
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata' \
--header 'Accept: application/json'
1
2
3
4
5
{
"id": 1,
"url": "test.com/test",
"metadata": "{\\\"A\\\":\\\"B\\\"}"
}
Save attachment metadata.
The authenticated user must have REPO_READ permission for the specified repository that is associated to the attachment that has the attachment metadata.
string
Requiredstring
Requiredstring
RequiredThe attachment metadata can be any valid JSON content
string
The attachment metadata
any
1
2
3
4
5
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '"<string>"'
Delete attachment metadata.
The user must be authenticated and have REPO_ADMIN permission for the specified repository.
string
Requiredstring
Requiredstring
RequiredThis status code has no content.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/attachments/{attachmentId}/metadata'
Retrieve the branches matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredboolean
string
boolean
string
string
number
number
The branches matching the supplied filterText.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
{
"values": [
{
"displayId": "<string>",
"default": true,
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"id": "refs/heads/master"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Creates a branch using the information provided in the RestCreateBranchRequest request
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
string
Requiredstring
RequiredThe request to create a branch containing a name, startPoint, and optionally a message
string
string
string
The created branch.
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"message": "This is my branch or tag",
"name": "my-branch-or-tag",
"startPoint": "8d351a10fb428c0c1239530256e21cf24f136e73"
}'
1
2
3
4
5
6
7
{
"displayId": "<string>",
"default": true,
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"id": "refs/heads/master"
}
Retrieves the repository's default branch, if it has been created. If the repository is empty, 204 No Content will be returned. For non-empty repositories, if the configured default branch has not yet been created a 404 Not Found will be returned.
This URL is deprecated. Callers should use GET /projects/{key}/repos/{slug}/default-branch
instead, which allows retrieving the configured default branch even if the ref has not been created 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}/branches/default' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
{
"displayId": "<string>",
"default": true,
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"id": "refs/heads/master"
}
Update the default branch of a repository.
This URL is deprecated. Callers should use PUT /projects/{key}/repos/{slug}/default-branch
instead.
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 operation was successful.
1
2
3
4
5
6
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/branches/default' \
--header 'Content-Type: application/json' \
--data '{
"id": "refs/heads/master"
}'
Retrieve a page of content for a file path at a specified revision.
Responses from this endpoint vary widely depending on the query parameters. The example JSON is for a request that does not use size, type, blame or noContent.
The various parameters are "processed" in the above order. That means ?size=true&type=truewill return a size response, not a type one; the type parameter will be ignored.
The blame and noContent query parameters are handled differently from size and type. For blame and noContent, the presence of the parameter implies "true" if no value is specified; size and and type both require an explicit=true or they're treated as "false".
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
A page of contents from a file.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse' \
--header 'Accept: application/json'
Retrieve a page of content for a file path at a specified revision.
Responses from this endpoint vary widely depending on the query parameters. The example JSON is for a request that does not use size, type, blame or noContent.
The various parameters are "processed" in the above order. That means ?size=true&type=truewill return a size response, not a type one; the type parameter will be ignored.
The blame and noContent query parameters are handled differently from size and type. For blame and noContent, the presence of the parameter implies "true" if no value is specified; size and and type both require an explicit=true or they're treated as "false".
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
A page of contents from a file.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}' \
--header 'Accept: application/json'
Update the content of path, on the given repository and branch.
This resource accepts PUT multipart form data, containing the file in a form-field named content.
An example curl request to update 'README.md' would be:
curl -X PUT -u username:password -F content=@README.md -F 'message=Updated using file-edit REST API' -F branch=master -F sourceCommitId=5636641a50b http://example.com/rest/api/latest/projects/PROJECT_1/repos/repo_1/browse/README.md
The file can be updated or created on a new branch. In this case, the sourceBranch parameter should be provided to identify the starting point for the new branch and the branch parameter identifies the branch to create the new commit on.
string
Requiredstring
Requiredstring
RequiredThe multipart form data containing the file
string
string
string
string
string
The newly created commit.
1
2
3
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/browse/{path}' \
--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
{
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"committerTimestamp": 1449075830,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"message": "More work on feature 1",
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
Retrieve a page of changes made in a specified commit.
Note: The implementation will apply a hard cap ({@code page.max.changes}) and it is not possible to request subsequent content when that cap is exceeded.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
number
number
A page of changes
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/changes' \
--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
{
"values": [
{
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"conflict": {
"ourChange": {
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
}
},
"theirChange": {
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
}
}
},
"contentId": "abcdef0123abcdef4567abcdef8987abcdef6543",
"fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a",
"percentUnchanged": 98,
"srcExecutable": true,
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"nodeType": "DIRECTORY",
"executable": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of commits from a given starting commit or "between" two commits. If no explicit commit is specified, the tip of the repository's default branch is assumed. commits may be identified by branch or tag name or by ID. A path may be supplied to restrict the returned commits to only those which affect that path.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
string
string
string
string
number
A page of commits
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits' \
--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
{
"values": [
{
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"committerTimestamp": 1449075830,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"message": "More work on feature 1",
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a single commit identified by its ID. In general, that ID is a SHA1. From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A commit
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}' \
--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
{
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"committerTimestamp": 1449075830,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"message": "More work on feature 1",
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
Get a specific build status.
The authenticated user must have REPO_READ permission for the provided repository.The request can also be made with anonymous 2-legged OAuth.
Since 7.14
string
Requiredstring
Requiredstring
Requiredstring
The build status associated with the provided commit and key
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"testResults": {
"failed": 1,
"successful": 134,
"skipped": 5
},
"createdDate": 1587533099278,
"updatedDate": 1587533699278,
"name": "Database Matrix Tests",
"key": "TEST-REP3",
"parent": "TEST-REP",
"state": "CANCELLED",
"ref": "refs/heads/master",
"description": "A description of the build goes here",
"duration": 2154,
"url": "https://bamboo.example.com/browse/TEST-REP3",
"buildNumber": "3"
}
Store a build status.
The authenticated user must have REPO_READ permission for the repository that this build status is for. The request can also be made with anonymous 2-legged OAuth.
string
Requiredstring
Requiredstring
RequiredThe contents of the build status request are: These fields are required:
These fields are optional:
string
string
integer
string
Requiredinteger
string
string
string
string
Requiredobject
The build status was posted
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds'
Delete a specific build status.
The authenticated user must have REPO_ADMIN permission for the provided repository.
string
Requiredstring
Requiredstring
Requiredstring
The build status associated with the provided commit and key has been deleted
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/builds'
Retrieve a page of changes made in a specified commit.
Note: The implementation will apply a hard cap (page.max.changes
) and it is not possible to request subsequent content when that cap is exceeded.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
number
number
A page of changes
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/changes' \
--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
{
"values": [
{
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"conflict": {
"ourChange": {
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
}
},
"theirChange": {
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
}
}
},
"contentId": "abcdef0123abcdef4567abcdef8987abcdef6543",
"fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a",
"percentUnchanged": 98,
"srcExecutable": true,
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"nodeType": "DIRECTORY",
"executable": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieves the commit discussion comments that match the specified search criteria.
It is possible to retrieve commit discussion comments that are anchored to a range of commits by providing the sinceId that the comments anchored from.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
number
number
A page of comments that match the search criteria
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments' \
--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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
{
"values": [
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Add a new comment.
Comments can be added in a few places by setting different attributes:
General commit comment:
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
"text": "An insightful general comment on a commit." } </pre> Reply to a comment: <pre>{ "text": "A measured reply.", "parent": { "id": 1 } } </pre> General file comment: <pre>{ "text": "An insightful general comment on a file.", "anchor": { "diffType": "COMMIT", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } } </pre> File line comment: <pre>{ "text": "A pithy comment on a particular line within a file.", "anchor": { "diffType": "COMMIT", "line": 1, "lineType": "CONTEXT", "fileType": "FROM", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }
Note: general file comments are an experimental feature and may change in the near future!
For file and line comments, 'path' refers to the path of the file to which the comment should be applied and 'srcPath' refers to the path the that file used to have (only required for copies and moves). Also, fromHash and toHash refer to the sinceId / untilId (respectively) used to produce the diff on which the comment was added. Finally diffType refers to the type of diff the comment was added on.
For line comments, 'line' refers to the line in the diff that the comment should apply to. 'lineType' refers to the type of diff hunk, which can be:- 'ADDED' - for an added line;- 'REMOVED' - for a removed line; or- 'CONTEXT' - for a line that was unmodified but is in the vicinity of the diff.'fileType' refers to the file of the diff to which the anchor should be attached - which is of relevance when displaying the diff in a side-by-side way. Currently the supported values are:- 'FROM' - the source file of the diff- 'TO' - the destination file of the diffIf the current user is not a participant the user is added as one and updated to watch the commit.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
the comment
integer
string
integer
string
string
object
The newly created comment.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"properties": {}
}'
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
Retrieves a commit discussion comment.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe requested comment.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}' \
--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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
Update a comment, with the following restrictions:
Note: the supplied supplied JSON object must contain a version
that must match the server's version of the comment or the update will fail. To determine the current version of the comment, the comment should be fetched from the server prior to the update. Look for the 'version' attribute in the returned JSON structure.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe comment to update
integer
string
integer
string
string
object
The newly updated comment.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"properties": {}
}'
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
Delete a commit comment. Anyone can delete their own comment. Only users with REPO_ADMIN and above may delete comments created by other users. Comments which have replies may not be deleted, regardless of the user's granted permissions.
The authenticated user must have REPO_READ permission for the repository that the commit is in to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
The operation was successful
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/comments/{commentId}'
Get the deployment matching the specified Repository, key, environmentKey and deploymentSequenceNumber.
The user must have REPO_READ.
string
Requiredstring
Requiredstring
Requiredstring
string
string
The deployment
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deployments' \
--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
{
"environment": {
"displayName": "US East Mirror",
"key": "us-east-mirror",
"type": "production",
"url": "https://foo-bar.production/us-east"
},
"deploymentSequenceNumber": 5,
"fromCommit": {
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"toCommit": {
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"displayName": "US East Mirror",
"key": "PROD-MIR",
"state": "PENDING",
"description": "Production and mirror environments",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"url": "http://example.ci.org/projects/PROJ/deploy/mirror-deploy/100",
"lastUpdated": 1449075920
}
Create or update a deployment.
The authenticated user must have REPO_READ permission for the repository.
string
Requiredstring
Requiredstring
Requiredthe details of the deployment to create, as detailed by the request body
integer
Requiredstring
Requiredstring
RequiredRestDeploymentEnvironment
Requiredstring
Requiredinteger
string
Requiredstring
RequiredThe deployment was created
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deployments' \
--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
{
"environment": {
"displayName": "US East Mirror",
"key": "us-east-mirror",
"type": "production",
"url": "https://foo-bar.production/us-east"
},
"deploymentSequenceNumber": 5,
"fromCommit": {
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"toCommit": {
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"displayName": "US East Mirror",
"key": "PROD-MIR",
"state": "PENDING",
"description": "Production and mirror environments",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"url": "http://example.ci.org/projects/PROJ/deploy/mirror-deploy/100",
"lastUpdated": 1449075920
}
Delete the deployment matching the specified Repository, key, environmentKey and deploymentSequenceNumber.
The user must have REPO_ADMIN.
string
Requiredstring
Requiredstring
Requiredstring
string
string
the request has been processed
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/deployments'
string
Requiredstring
Requiredstring
Requiredinteger
string
boolean
string
string
default response
any
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff'
Stream the diff between two provided revisions.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
A raw diff between two revisions
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/diff/{path}' \
--header 'Accept: application/json'
Retrieve a page of pull requests in the current repository that contain the given commit. The user must be authenticated and have access to the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requirednumber
number
Return a page of pull requests in the current repository containing the given commit.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/pull-requests' \
--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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{
"values": [
{
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Add the authenticated user as a watcher for the specified commit.
The authenticated user must have REPO_READ permission for the repository containing the commit to call this resource.
string
Requiredstring
Requiredstring
RequiredThe user is now watching the commit.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch'
Remove the authenticated user as a watcher for the specified commit.
The authenticated user must have REPO_READ permission for the repository containing the commit to call this resource.
string
Requiredstring
Requiredstring
RequiredThe user is no longer watching the commit.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/commits/{commitId}/watch'
Gets the file changes available in the from
commit but not in the to
commit.
If either the from
or to
commit are not specified, they will be replaced by the default branch of their containing repository.
string
Requiredstring
Requiredstring
string
string
number
number
A page of changes.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/changes' \
--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
{
"values": [
{
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"conflict": {
"ourChange": {
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
}
},
"theirChange": {
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
}
}
},
"contentId": "abcdef0123abcdef4567abcdef8987abcdef6543",
"fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a",
"percentUnchanged": 98,
"srcExecutable": true,
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"nodeType": "DIRECTORY",
"executable": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Gets the commits accessible from the from
commit but not in the to
commit.
If either the from
or to
commit are not specified, they will be replaced by the default branch of their containing repository.
string
Requiredstring
Requiredstring
string
string
number
number
A page of commits.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/commits' \
--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
{
"values": [
{
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"committerTimestamp": 1449075830,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"message": "More work on feature 1",
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Gets a diff of the changes available in the from
commit but not in the to
commit.
If either the from
or to
commit are not specified, they will be replaced by the default branch of their containing repository.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
string
number
number
The diff of the changes.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/compare/diff{path}' \
--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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
{
"values": [
{
"hunks": [
{
"truncated": true,
"sourceLine": 2154,
"sourceSpan": 2154,
"destinationLine": 2154,
"destinationSpan": 2154,
"segments": [
{}
],
"context": "<string>"
}
],
"truncated": true,
"lineComments": [
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{}
],
"reviewers": [
{}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{}
],
"reviewers": [
{}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
],
"source": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"binary": true,
"destination": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"properties": {}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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'
string
Requiredstring
Requireddefault response
any
1
2
curl --request HEAD \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/contributing'
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
{
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
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"
}'
Stream the raw diff between two provided revisions.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
string
string
A raw diff between two revisions.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/diff' \
--header 'Accept: application/json'
Stream the raw diff between two provided revisions.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
A raw diff between two revisions.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/diff/{path}' \
--header 'Accept: application/json'
Retrieve a page of files from particular directory of a repository. The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of files.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/files' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"values": [],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of files from particular directory of a repository. The search is done recursively, so all files from any sub-directory of the specified directory will be returned.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
number
number
A page of files.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/files/{path}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"values": [],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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
{
"values": [
{
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Return a page of hook scripts configured for the specified repository.
This endpoint requires REPO_ADMIN permission.
string
Requiredstring
Requirednumber
number
A page of hook scripts.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/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": {
"createdDate": "<string>",
"updatedDate": "<string>",
"version": 2154,
"name": "<string>",
"id": 2154,
"type": "POST",
"description": "<string>",
"pluginKey": "<string>"
},
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"triggerIds": [
"<string>"
]
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Creates/updates the hook script configuration for the provided hook script and repository.
This endpoint requires REPO_ADMIN permission.
string
Requiredstring
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}/repos/{repositorySlug}/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": {
"createdDate": "<string>",
"updatedDate": "<string>",
"version": 2154,
"name": "<string>",
"id": 2154,
"type": "POST",
"description": "<string>",
"pluginKey": "<string>"
},
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"triggerIds": [
"<string>"
]
}
Removes the hook script from the set of hook scripts configured to run in the repository.
This endpoint requires REPO_ADMIN permission.
string
Requiredstring
Requiredstring
RequiredThe hook script was successfully deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/hook-scripts/{scriptId}'
Get all labels applied to the given repository.
The authenticated user must have REPO_READ permission for the specified repository.
string
Requiredstring
RequiredThe applied label.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels' \
--header 'Accept: application/json'
1
2
3
{
"name": "labelName"
}
Applies a label to the repository.
The authenticated user must have REPO_ADMIN permission for the specified repository.
string
Requiredstring
RequiredThe label to apply
string
The applied label.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"name": "labelName"
}'
1
2
3
{
"name": "labelName"
}
Remove label that is applied to the given repository.
The authenticated user must have REPO_ADMIN permission for the specified repository.
string
Requiredstring
Requiredstring
RequiredAn empty response indicating that the label is no longer associated to the repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/labels/{labelName}'
Streams files from the repository's root with the last commit to modify each file. Commit modifications are traversed starting from the at
commit or, if not specified, from the tip of the default branch.
Unless the repository is public, the authenticated user must have REPO_READ access to call this resource.
string
Requiredstring
Requiredstring
A map of files to the last commit that modified them, and the latest commit to the repository (by nature, any commit to a repository modifies its root).
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modified' \
--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
{
"files": {
"latestCommit": {
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"committerTimestamp": 1449075830,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"message": "More work on feature 1",
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"pomXml": {
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"committerTimestamp": 1449075830,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"message": "More work on feature 1",
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"readmeMd": {
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"committerTimestamp": 1449075830,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"message": "More work on feature 1",
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
}
}
Streams files in the requested path
with the last commit to modify each file. Commit modifications are traversed starting from the at
commit or, if not specified, from the tip of the default branch.
Unless the repository is public, the authenticated user must have REPO_READ access to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A map of files to the last commit that modified them, and the latest commit to update the requested path.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/last-modified/{path}' \
--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
{
"files": {
"latestCommit": {
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"committerTimestamp": 1449075830,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"message": "More work on feature 1",
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"pomXml": {
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"committerTimestamp": 1449075830,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"message": "More work on feature 1",
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
},
"readmeMd": {
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"committerTimestamp": 1449075830,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"message": "More work on feature 1",
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
}
}
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'
string
Requiredstring
Requireddefault response
any
1
2
curl --request HEAD \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/license'
Retrieve a page of participant users for all the pull requests to or from the specified repository. Optionally clients can specify following filters.
string
Requiredstring
Requiredstring
string
string
number
number
A page of users that match the search criteria.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/participants' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
{
"values": [
{
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve the patch content for a repository at a specified revision.
Cache headers are added to the response (only if full commit hashes are used, not in the case of short hashes).
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
string
string
The patch contents from a repository.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/patch' \
--header 'Accept: application/json'
Revoke all permissions for the specified repository for the given groups and users.
The authenticated user must have PROJECT_ADMIN permission for the specified repository 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
Requiredstring
string
All repository permissions were revoked from the users and groups for the specified repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions'
Retrieve a page of groups that have been granted at least one permission for the specified repository.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of groups and their highest permissions for the specified repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/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,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Promote or demote a group's permission level for the specified repository. Available repository permissions are:
See the Bitbucket Server documentation for a detailed explanation of what each permission entails.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource. In addition, a user may not demote a group's permission level if their own permission level would be reduced as a result.
string
Requiredstring
Requiredarray<string>
Requiredstring
RequiredThe requested permission was granted.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups?name={name}&permission={permission}'
Revoke all permissions for the specified repository for a group.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or 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
Requiredstring
RequiredAll repository permissions were revoked from the group for the specified repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups?name={name}'
Retrieve a page of groups that have no granted permissions for the specified repository.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of groups that have not been granted any permissions for the specified repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/groups/none' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
{
"values": [
{
"deletable": true,
"name": "group-a"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of users that have been granted at least one permission for the specified repository.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of users and their highest permissions for the specified repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/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": [
{
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"permission": "USER_ADMIN"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Promote or demote a user's permission level for the specified repository. Available repository permissions are:
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource. In addition, a user may not reduce their own permission level unless they have a project or global permission that already implies that permission.
string
Requiredstring
Requiredarray<string>
Requiredstring
RequiredThe requested permission was granted.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users?name={name}&permission={permission}'
Revoke all permissions for the specified repository for a user.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.
In addition, a user may not revoke their own repository permissions if they do not have a higher project or global permission.
string
Requiredstring
Requiredstring
RequiredAll repository permissions were revoked from the user for the specified repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/permissions/users?name={name}'
Retrieve a page of licensed users that have no granted permissions for the specified repository.
The authenticated user must have REPO_ADMIN permission for the specified repository or a higher project or global permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of users that have not been granted any permissions for the specified repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/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": [
{
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of pull requests to or from the specified repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource. Optionally clients can specify PR participant filters. Each filter has a mandatory username.N parameter, and the optional role.N and approved.N parameters.
string
Requiredstring
Requiredstring
string
string
string
string
string
string
number
number
A page of pull requests that match the search criteria.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests' \
--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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
{
"values": [
{
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Create a new pull request from a source branch or tag to a target branch. The source and target may be in the same repository, or different ones. (Note that different repositories must belong to the same Repository#getHierarchyId()
hierarchy.)
The fromRef
may be a branch or a tag. The toRef
is required to be a branch. Tags are not allowed as targets because tags are intended to be immutable and should not be changed after they are created.
The authenticated user must have REPO_READ permission for the fromRef
and toRef
repositories to call this resource.
string
Requiredstring
RequiredThe pull request data
object
object
array<RestPullRequestParticipant>
array<RestPullRequestParticipant>
string
integer
integer
integer
integer
boolean
The newly created pull request.
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
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"project": "PROJ",
"links": {}
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"project": "PROJ",
"links": {}
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"type": "NORMAL",
"active": true,
"links": {},
"avatarUrl": "<string>"
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"type": "NORMAL",
"active": true,
"links": {},
"avatarUrl": "<string>"
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"htmlDescription": "<string>",
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy",
"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
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
120
121
122
123
124
125
126
127
{
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
}
Retrieve a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe specified pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
Update the title, description, reviewers or destination branch of an existing pull request.
Note: the reviewers list may be updated using this resource. However the author and participants list may not.
The authenticated user must either:
to call this resource.
string
Requiredstring
Requiredstring
RequiredThe updated pull request
object
object
array<RestPullRequestParticipant>
array<RestPullRequestParticipant>
string
integer
integer
integer
integer
boolean
The updated pull request.
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
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"project": "PROJ",
"links": {}
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"project": "PROJ",
"links": {}
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"type": "NORMAL",
"active": true,
"links": {},
"avatarUrl": "<string>"
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"type": "NORMAL",
"active": true,
"links": {},
"avatarUrl": "<string>"
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"htmlDescription": "<string>",
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy",
"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
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
120
121
122
123
124
125
126
127
{
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
}
Deletes a pull request.
To call this resource, users must be authenticated and have permission to view the pull request. Additionally, they must:
A body containing the version of the pull request must be provided with this request.
{ "version": 1 }
string
Requiredstring
Requiredstring
RequiredA body containing the version of the pull request
integer
The pull request was deleted.
1
2
3
4
5
6
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}' \
--header 'Content-Type: application/json' \
--data '{
"version": 2154
}'
Streams the raw diff for a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
A raw diff for the specified pull request.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.diff' \
--header 'Accept: application/json'
Streams a patch representing a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredA patch representing the specified pull request.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}.patch' \
--header 'Accept: application/json'
Retrieve a page of activity associated with a pull request.
Activity items include comments, approvals, rescopes (i.e. adding and removing of commits), merges and more.
Different types of activity items may be introduced in newer versions of Stash or by user installed plugins, so clients should be flexible enough to handle unexpected entity shapes in the returned page.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
number
number
A page of activity relating to the specified pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/activities' \
--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
{
"values": [
{
"action": "APPROVED",
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"createdDate": 19990759200,
"id": 1
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Approve a pull request as the current user. Implicitly adds the user as a participant if they are not already.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
Deprecated since 4.2. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug} instead
string
Requiredstring
Requiredstring
RequiredDetails of the new participant.
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
Remove approval from a pull request as the current user. This does not remove the user as a participant.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
Deprecated since 4.2. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug} instead
string
Requiredstring
Requiredstring
RequiredDetails of the updated participant.
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/approve' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
Gets comments matching the given set of field values for the specified pull request. (Note this does not perform any kind of searching for comments by their text).
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
array<string>
string
number
number
A page of Comments from the supplied pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments' \
--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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
{
"values": [
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Add a new blocker comment.
Comments can be added in a few places by setting different attributes:
General pull request blocker comment:
1 2 3 4
{ "text": "A task on a pull request." }
Blocker reply to a comment:
1 2 3 4 5 6 7
{ "text": "This reply is a task.", "parent": { "id": 1 } }
General blocker file comment:
1 2 3 4 5 6 7 8 9 10 11
{ "text": "A blocker comment on a file.", "anchor": { "diffType": "RANGE", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }
Blocker file line comment:
1 2 3 4 5 6 7 8 9 10 11 12 13 14
{ "text": "A task on a particular line within a file.", "anchor": { "diffType": "COMMIT", "line": 1, "lineType": "CONTEXT", "fileType": "FROM", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }
For file and line comments, 'path' refers to the path of the file to which the comment should be applied and 'srcPath' refers to the path the that file used to have (only required for copies and moves). Also, fromHash and toHash refer to the sinceId / untilId (respectively) used to produce the diff on which the comment was added. Finally diffType refers to the type of diff the comment was added on. For backwards compatibility purposes if no diffType is provided and no fromHash/toHash pair is provided the diffType will be resolved to 'EFFECTIVE'. In any other cases the diffType is REQUIRED.
For line comments, 'line' refers to the line in the diff that the comment should apply to. 'lineType' refers to the type of diff hunk, which can be:
'fileType' refers to the file of the diff to which the anchor should be attached - which is of relevance when displaying the diff in a side-by-side way. Currently the supported values are:
If the current user is not a participant the user is added as a watcher of the pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe comment to add.
integer
string
integer
string
string
object
The newly created comment.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"properties": {}
}'
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
Retrieves a pull request comment.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe requested comment.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}' \
--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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
Update a comment, with the following restrictions:
Convert a comment to a task or vice versa.
Comments can be converted to tasks by setting the 'severity' attribute to 'BLOCKER':
1 2 3 4 5
{ "severity": "BLOCKER" }
Tasks can be converted to comments by setting the 'severity' attribute to 'NORMAL': ```
{ "severity": "NORMAL" }
1 2 3 4 5 6 7 8
Resolve a blocker comment. Blocker comments can be resolved by setting the 'state' attribute to 'RESOLVED': ``` { "state": "RESOLVED" }
Note: the supplied JSON object must contain a version
that must match the server's version of the comment or the update will fail. To determine the current version of the comment, the comment should be fetched from the server prior to the update. Look for the 'version' attribute in the returned JSON structure.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe comment to add.
integer
string
integer
string
string
object
The newly updated comment.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"properties": {}
}'
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
Delete a pull request comment. Anyone can delete their own comment. Only users with REPO_ADMIN and above may delete comments created by other users.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
The operation was successful.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments/{commentId}'
Gets changes for the specified PullRequest.
If the changeScope query parameter is set to 'UNREVIEWED', the application will attempt to stream unreviewed changes based on the lastReviewedCommit of the current user, which are the changes between the lastReviewedCommit and the latest commit of the source branch. The current user is considered to not have any unreviewed changes for the pull request when the lastReviewedCommit is either null (everything is unreviewed, so all changes are streamed), equal to the latest commit of the source branch (everything is reviewed), or no longer on the source branch (the source branch has been rebased). In these cases, the application will fall back to streaming all changes (the default), which is the effective diff for the pull request. The type of changes streamed can be determined by the changeScope parameter included in the properties map of the response.
Note: This resource is currently not paged. The server will return at most one page. The server will truncate the number of changes to either the request's page limit or an internal maximum, whichever is smaller. The start parameter of the page request is also ignored.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
number
number
A page of unreviewed Changes for the current user from the supplied pull request, including the unreviewedCommits in the properties map.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/changes' \
--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
{
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"conflict": {
"ourChange": {
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
}
},
"theirChange": {
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
}
}
},
"contentId": "abcdef0123abcdef4567abcdef8987abcdef6543",
"fromContentId": "bcdef0123abcdef4567abcdef8987abcdef6543a",
"percentUnchanged": 98,
"srcExecutable": true,
"type": "ADD",
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"nodeType": "DIRECTORY",
"executable": true
}
Gets comments for the specified pull request and path.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
array<string>
string
array<string>
string
string
number
number
A page of Comments from the supplied pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments' \
--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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
{
"values": [
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Add a new comment.
Comments can be added in a few places by setting different attributes:
General pull request comment:{ "text": "An insightful general comment on a pull request." }Reply to a comment:
{General file comment:"text": "A measured reply.", "parent": { "id": 1 } }
{ "text": "An insightful general comment on a file.", "anchor": { "diffType": "RANGE", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }File line comment:
{ "text": "A pithy comment on a particular line within a file.", "anchor": { "diffType": "COMMIT", "line": 1, "lineType": "CONTEXT", "fileType": "FROM", "fromHash": "6df3858eeb9a53a911cd17e66a9174d44ffb02cd", "path": "path/to/file", "srcPath": "path/to/file", "toHash": "04c7c5c931b9418ca7b66f51fe934d0bd9b2ba4b" } }
Add a new task.
Tasks are just comments with the attribute 'severity' set to 'BLOCKER':
General pull request task:
{ "text": "A task on a pull request.", "severity": "BLOCKER" }
Add a pending comment.
Pending comments are just comments with the attribute 'state' set to 'PENDING':
Pending comment:
{ "text": "This is a pending comment", "state": "PENDING" }
For file and line comments, 'path' refers to the path of the file to which the comment should be applied and 'srcPath' refers to the path the that file used to have (only required for copies and moves). Also, fromHash and toHash refer to the sinceId / untilId (respectively) used to produce the diff on which the comment was added. Finally diffType refers to the type of diff the comment was added on. For backwards compatibility purposes if no diffType is provided and no fromHash/toHash pair is provided the diffType will be resolved to 'EFFECTIVE'. In any other cases the diffType is REQUIRED.
For line comments, 'line' refers to the line in the diff that the comment should apply to. 'lineType' refers to the type of diff hunk, which can be:
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe comment to add
integer
string
integer
string
string
object
The newly created comment.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"properties": {}
}'
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
Retrieves a pull request comment.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe requested comment.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}' \
--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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
Update a comment, with the following restrictions:
Convert a comment to a task or vice versa.
Comments can be converted to tasks by setting the 'severity' attribute to 'BLOCKER':
{ "severity": "BLOCKER" }
Tasks can be converted to comments by setting the 'severity' attribute to 'NORMAL':
{ "severity": "NORMAL" }
Resolve a task.
Tasks can be resolved by setting the 'state' attribute to 'RESOLVED':
{ "state": "RESOLVED" }
Note: the supplied JSON object must contain a version
that must match the server's version of the comment or the update will fail. To determine the current version of the comment, the comment should be fetched from the server prior to the update. Look for the 'version' attribute in the returned JSON structure.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe updated comment
integer
string
integer
string
string
object
The newly updated comment.
1
2
3
4
5
6
7
8
9
10
11
12
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"properties": {}
}'
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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
Delete a pull request comment. Anyone can delete their own comment. Only users with REPO_ADMIN and above may delete comments created by other users.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
The operation was successful.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}'
Apply a suggestion contained within a comment.
string
Requiredstring
Requiredstring
Requiredstring
RequiredA request containing other parameters required to apply a suggestion - The given versions/hashes must match the server's version/hashes or the suggestion application will fail (in order to avoid applying the suggestion to the wrong place
object
string
object
object
An empty response indicating the suggestion has been applied.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}/apply-suggestion' \
--header 'Content-Type: application/json' \
--data '{
"commentVersion": {
"asInt": 2154,
"present": true
},
"commitMessage": "A commit message",
"pullRequestVersion": {
"asInt": 2154,
"present": true
},
"suggestionIndex": {
"asInt": 2154,
"present": true
}
}'
Retrieve commits for the specified pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
number
number
A page of commits from the supplied pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/commits' \
--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
{
"values": [
{
"committer": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"authorTimestamp": 1359075920,
"committerTimestamp": 1449075830,
"author": {
"emailAddress": "charlie@example.com",
"name": "Charlie"
},
"message": "More work on feature 1",
"parents": [
{
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"displayId": "abcdef0",
"id": "abcdef0123abcdef4567abcdef8987abcdef6543"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Decline a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
The body holder
string
integer
The pull request was declined.
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/decline' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"comment": "An optional comment explaining why the pull request is being declined",
"version": 2154
}'
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
120
121
122
123
124
125
126
127
{
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
}
Streams the raw diff for a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
A raw diff for the specified pull request.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff' \
--header 'Accept: application/json'
Streams the raw diff for a pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
number
number
A raw diff for the specified pull request.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/diff/{path}' \
--header 'Accept: application/json'
Test whether a pull request can be merged.
A pull request may not be merged if:
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe mergeability status of the pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
{
"outcome": "CLEAN",
"vetoes": [
{
"detailedMessage": "You have insufficient permissions to rebase 'refs/heads/feature-branch'.",
"summaryMessage": "Insufficient branch permissions"
}
],
"conflicted": true
}
Merge the specified pull request.
The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
The body holder
string
object
string
string
integer
The merged pull request.
1
2
3
4
5
6
7
8
9
10
11
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/merge' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"autoSubject": "(Optional, 5.7+) true to prepend an auto-generated subject to the message (default), or false to use the message as-is",
"context": {},
"message": "(Optional) A descriptive message for the merge commit",
"strategyId": "(Optional) squash",
"version": 2154
}'
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
120
121
122
123
124
125
126
127
{
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
}
Retrieves a page of the participants for a given pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requirednumber
number
Details of the participants in this pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants' \
--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
{
"values": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Assigns a participant to an explicit role in pull request. Currently only the REVIEWER role may be assigned.
If the user is not yet a participant in the pull request, they are made one and assigned the supplied role.
If the user is already a participant in the pull request, their previous role is replaced with the supplied role unless they are already assigned the AUTHOR role which cannot be changed and will result in a Bad Request (400) response code.
The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
boolean
object
string
string
Details of the participants in this pull request.
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}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"type": "NORMAL",
"active": true,
"links": {},
"avatarUrl": "<string>"
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
Unassigns a participant from the REVIEWER role they may have been given in a pull request.
If the participant has no explicit role this method has no effect.
Afterwards, the user will still remain a participant in the pull request but their role will be reduced to PARTICIPANT. This is because once made a participant of a pull request, a user will forever remain a participant. Only their role may be altered.
The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.
Deprecated since 4.2. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug} instead.
string
Requiredstring
Requiredstring
Requiredstring
The update completed.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants'
Change the current user's status for a pull request. Implicitly adds the user as a participant if they are not already. If the current user is the author, this method will fail.
The possible values for {@code status} are UNAPPROVED, NEEDS_WORK, or APPROVED.
If the new {@code status} is NEEDS_WORK or APPROVED then the {@code lastReviewedCommit} for the participant will be updated to the latest commit of the source branch of the pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe participant representing the status to set, all fields except status are ignored
string
boolean
object
string
string
Details of the new participant.
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}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"type": "NORMAL",
"active": true,
"links": {},
"avatarUrl": "<string>"
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
Unassigns a participant from the REVIEWER role they may have been given in a pull request.
If the participant has no explicit role this method has no effect.
Afterwards, the user will still remain a participant in the pull request but their role will be reduced to PARTICIPANT. This is because once made a participant of a pull request, a user will forever remain a participant. Only their role may be altered.
The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
RequiredThe update completed.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/participants/{userSlug}'
Re-open a declined pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
The body holder
integer
The merged pull request.
1
2
3
4
5
6
7
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/reopen' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"version": 2154
}'
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
120
121
122
123
124
125
126
127
{
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
}
Get the CommentThread
threads which have Comment
comments that have a CommentState#PENDING
pending state and are part of the pull request review for the authenticated user.
string
Requiredstring
Requiredstring
Requirednumber
number
A page of Comments from the supplied pull request.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review' \
--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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
{
"values": [
{
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"parent": {
"reply": true,
"pending": true,
"anchored": true,
"html": "<string>",
"anchor": {
"diffType": "COMMIT",
"lineComment": true,
"fileType": "FROM",
"lineType": "ADDED",
"fromHash": "62a0505e8204115b8b9c8a95bfa264a8c0896a93",
"srcPath": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"toHash": "3cdd5d19178a54d2e51b5098d43b57571241d0ab",
"pullRequest": {
"fromRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"toRef": {
"displayId": "feature-ABC-1233",
"latestCommit": "babecafebabecafebabecafebabecafebabecafe",
"id": "refs/heads/feature-ABC-123",
"type": "BRANCH",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
},
"participants": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"reviewers": [
{
"lastReviewedCommit": "7549846524f8aed2bd1c0249993ae1bf9d3c9998",
"approved": true,
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"status": "UNAPPROVED",
"role": "AUTHOR"
}
],
"closedDate": 19990759200,
"createdDate": 13590759200,
"updatedDate": 14490759200,
"version": 2154,
"open": true,
"id": 1,
"state": "DECLINED",
"locked": true,
"description": "It is a kludge, but put the tuple from the database in the cache.",
"closed": true,
"title": "Talking Nerdy"
},
"path": {
"extension": "txt",
"name": "file.txt",
"parent": "path/to",
"components": [
"path",
"to",
"file.txt"
]
},
"line": 98
},
"createdDate": 1359075920,
"author": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"updatedDate": 1449075920,
"version": 1,
"severity": "NORMAL",
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
},
"id": 1,
"state": "OPEN",
"text": "An insightful comment.",
"comments": [],
"properties": {}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Complete a review on a pull request.
string
Requiredstring
Requiredstring
RequiredThe REST request which contains comment text and participant status
string
string
Getting back the number of published comments and completing the review on a pull request.
any
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"commentText": "General comment text",
"participantStatus": "approved"
}'
Discard a pull request review for the authenticated user.
The authenticated user must have REPO_READ permission for the repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe pull request review has been discarded.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/review'
Retrieve the tasks associated with a pull request.
Removed in 8.0. Tasks are now managed using Comments with BLOCKER severity. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments instead
Deprecated since 7.2, changed to 404 in 8.0, remove in 9.0. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments instead
string
Requiredstring
Requiredstring
RequiredThis endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks'
1
2
3
4
5
6
7
8
9
{
"errors": [
{
"exceptionName": "<string>",
"message": "<string>",
"context": "<string>"
}
]
}
Retrieve the total number of OPEN and RESOLVED tasks associated with a pull request.
Deprecated since 7.2. Tasks are now managed using Comments with BLOCKER severity. Use /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/blocker-comments?count=true instead.
string
Requiredstring
Requiredstring
RequiredThis endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/tasks/count'
1
2
3
4
5
6
7
8
9
{
"errors": [
{
"exceptionName": "<string>",
"message": "<string>",
"context": "<string>"
}
]
}
Add the authenticated user as a watcher for the specified pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe user is now watching the pull request.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch'
Remove the authenticated user as a watcher for the specified pull request.
The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource.
string
Requiredstring
Requiredstring
RequiredThe user is no longer watching the pull request.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/watch'
Retrieve the raw content for a file path at a specified revision.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
RequiredThe raw contents from a file.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/raw' \
--header 'Accept: application/json'
Retrieve the raw content for a file path at a specified revision.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
string
string
string
The raw contents from a file.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/raw/{path}' \
--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'
string
Requiredstring
Requireddefault response
any
1
2
curl --request HEAD \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/readme'
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
{
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
Retrieve a page of repository ref change activity.
The authenticated user must have REPO_ADMIN permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of ref change activity.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activities' \
--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
{
"values": [
{
"refChange": {
"updatedType": "UNKNOWN",
"fromHash": "6053a1eaa1c009dd11092d09a72f3c41af1b59ad",
"toHash": "d6edcbf924697ab811a867421dab60d954ccad99",
"refId": "refs/heads/master",
"type": "ADD",
"ref": {
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
},
"trigger": "push",
"repository": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"user": {
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
},
"createdDate": 19990759200,
"id": 1
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a page of branches with ref change activities for a specific repository.
The authenticated user must have REPO_ADMIN permission to call this resource.
string
Requiredstring
Requiredstring
number
number
A page of branches with ref change activities.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/ref-change-activities/branches' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
{
"values": [
{
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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
{
"values": [
{
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieves the auto decline settings for the supplied repository. Project settings will be returned if no explicit settings have been set for the repository. In the case that there are no project settings, the default settings will be returned.
The authenticated user must have REPO_READ permission for this repository to call the resource.
string
Requiredstring
RequiredThe auto decline settings
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"inactivityWeeks": 4,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"enabled": true
}
Creates or updates the auto decline settings for the supplied repository.
The authenticated user must have REPO_ADMIN permission for this repository to call the resource
string
Requiredstring
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}/repos/{repositorySlug}/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
{
"inactivityWeeks": 4,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"enabled": true
}
Delete auto decline settings for the supplied repository.
The authenticated user must have REPO_ADMIN permission for this repository to call the resource.
string
Requiredstring
RequiredThe auto decline settings have been deleted successfully.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/auto-decline'
Retrieve a page of repository hooks for this repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
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}/repos/{repositorySlug}/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": [
{
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"description": "<string>"
},
"configured": true,
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Retrieve a repository hook for this repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe 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}/repos/{repositorySlug}/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
{
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"description": "<string>"
},
"configured": true,
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
Delete repository hook configuration for the supplied hookKey and repositorySlug
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe hook configuration matching the supplied hookKey and repositorySlug was deleted
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/hooks/{hookKey}'
Enable a repository hook for this repository and optionally apply new configuration.
The authenticated user must have REPO_ADMIN permission for the specified repository 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
Requiredstring
Requiredstring
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}/repos/{repositorySlug}/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
{
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"description": "<string>"
},
"configured": true,
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
Disable a repository hook for this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
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}/repos/{repositorySlug}/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
{
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"description": "<string>"
},
"configured": true,
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
Retrieve the settings for a repository hook for this repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe settings for the hook.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/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 repository.
The service will reject any settings which are too large, the current limit is 32KB once serialized.
The authenticated user must have REPO_ADMIN permission for the specified repository 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
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}/repos/{repositorySlug}/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 pull request settings for the context repository.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
This resource will call all RestFragments that are registered with the key bitbucket.repository.settings.pullRequests. If any fragment fails validations by returning a non-empty Map of errors, then no fragments will execute.
The property keys for the settings that are bundled with the application are
string
Requiredstring
RequiredThe repository pull request settings for the context repository.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests' \
--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
{
"mergeConfig": {
"strategies": [
{
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
}
],
"commitSummaries": 2154,
"defaultStrategy": {
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
},
"type": "repository"
},
"requiredAllApprovers": true,
"requiredApproversDeprecated": 2154,
"requiredSuccessfulBuilds": {
"count": "3",
"enabled": true
},
"requiredSuccessfulBuildsDeprecated": 2154,
"requiredAllTasksComplete": true,
"requiredApprovers": {
"count": "3",
"enabled": true
}
}
Update the pull request settings for the context repository.
The authenticated user must have REPO_ADMIN permission for the context repository to call this resource.
This resource will call all RestFragments that are registered with the key bitbucket.repository.settings.pullRequests. If any fragment fails validations by returning a non-empty Map of errors, then no fragments will execute.
Only the settings that should be updated need to be included in the request.
The property keys for the settings that are bundled with the application are
Merge strategy configuration deletion:
An explicitly set pull request merge strategy configuration can be deleted by POSTing a document with an empty "mergeConfig" attribute. i.e:
1 2 3
"mergeConfig": { } }
Upon completion of this request, the effective configuration will be:
string
Requiredstring
RequiredThe updated settings.
object
boolean
integer
object
integer
boolean
object
The repository pull request settings for the context repository.
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
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/pull-requests' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"mergeConfig": {
"strategies": [
{
"id": "no-ff",
"links": {}
}
],
"commitSummaries": 2154,
"defaultStrategy": {
"id": "no-ff",
"links": {}
}
},
"requiredAllApprovers": true,
"requiredApproversDeprecated": 2154,
"requiredSuccessfulBuilds": {
"count": "3",
"enabled": true
},
"requiredSuccessfulBuildsDeprecated": 2154,
"requiredAllTasksComplete": true,
"requiredApprovers": {
"count": "3",
"enabled": true
}
}'
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
{
"mergeConfig": {
"strategies": [
{
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
}
],
"commitSummaries": 2154,
"defaultStrategy": {
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
},
"type": "repository"
},
"requiredAllApprovers": true,
"requiredApproversDeprecated": 2154,
"requiredSuccessfulBuilds": {
"count": "3",
"enabled": true
},
"requiredSuccessfulBuildsDeprecated": 2154,
"requiredAllTasksComplete": true,
"requiredApprovers": {
"count": "3",
"enabled": true
}
}
Retrieve a page of reviewer groups of a given scope.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requirednumber
number
A page
of reviewer group(s) of the provided scope and its inherited scope.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups' \
--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
{
"values": [
{
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Create a reviewer group.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
RequiredThe request containing the details of the reviewer group.
string
array<ApplicationUser>
string
integer
string
object
The newly created reviewer group.
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
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"avatarUrl": "<string>",
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
Retrieve a reviewer group.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe reviewer group.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{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
{
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
Update the attributes of a reviewer group.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe request containing the attributes of the reviewer group to be updated. Only the attributes to be updated need to be present in this object.
string
array<ApplicationUser>
string
integer
string
object
The updated reviewer group.
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
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"avatarUrl": "<string>",
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
Deletes a reviewer group.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe operation was successful
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}'
Retrieve a list of the users of a reviewer group.
This does not return all the users of the group, only the users who have REPO_READ permission for the specified repository.
The authenticated user must have REPO_READ permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe list of users of a reviewer group.
array<RestApplicationUser>
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/settings/reviewer-groups/{id}/users' \
--header 'Accept: application/json;charset=UTF-8'
Retrieve the tags matching the supplied filterText param.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
string
Requiredstring
Requiredstring
string
number
number
The tags matching the supplied filterText.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
{
"values": [
{
"hash": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Creates a tag using the information provided in the RestCreateTagRequest request
The authenticated user must have REPO_WRITE permission for the context repository to call this resource.
string
Requiredstring
RequiredThe request to create a tag containing a name, startPoint, and optionally a message
string
string
string
The created tag.
1
2
3
4
5
6
7
8
9
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"message": "This is my branch or tag",
"name": "my-branch-or-tag",
"startPoint": "8d351a10fb428c0c1239530256e21cf24f136e73"
}'
1
2
3
4
5
6
7
8
{
"hash": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
Retrieve a tag in the specified repository.
The authenticated user must have REPO_READ permission for the context repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe tag which matches the supplied name.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/tags/{name}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
{
"hash": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestCommit": "8d51122def5632836d1cb1026e879069e10a1e13",
"latestChangeset": "8d51122def5632836d1cb1026e879069e10a1e13",
"displayId": "master",
"id": "refs/heads/master",
"type": "BRANCH"
}
Add the authenticated user as a watcher for the specified repository.
The authenticated user must have REPO_READ permission for the repository to call this resource.
string
Requiredstring
RequiredThe repository to watch.
string
string
string
string
object
The user is now watching the repository.
1
2
3
4
5
6
7
8
9
10
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/watch' \
--header 'Content-Type: application/json' \
--data '{
"scmId": "git",
"slug": "my-repo",
"name": "My repo",
"project": "PROJ",
"links": {}
}'
Remove the authenticated user as a watcher for the specified repository.
The authenticated user must have REPO_READ permission for the repository to call this resource.
string
Requiredstring
RequiredThe user is no longer watching the repository.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/watch'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
boolean
A page of webhooks.
any
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks' \
--header 'Accept: application/json'
Create a webhook for the repository specified via the URL.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
RequiredThe webhook to be created for this repository.
array<string>
boolean
object
string
object
string
A created webhook.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"events": [
"<string>"
],
"active": true,
"statistics": {},
"name": "<string>",
"configuration": {},
"url": "<string>"
}'
1
2
3
4
5
6
7
8
9
{
"events": [
"<string>"
],
"active": true,
"name": "<string>",
"configuration": {},
"url": "<string>"
}
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
A webhook.
RestWebhookRequestResponse
1
2
3
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/test' \
--header 'Accept: application/json'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A webhook.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"events": [
"<string>"
],
"active": true,
"name": "<string>",
"configuration": {},
"url": "<string>"
}
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe representation of the updated values for the webhook
array<string>
boolean
object
string
object
string
A webhook.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"events": [
"<string>"
],
"active": true,
"statistics": {},
"name": "<string>",
"configuration": {},
"url": "<string>"
}'
1
2
3
4
5
6
7
8
9
{
"events": [
"<string>"
],
"active": true,
"name": "<string>",
"configuration": {},
"url": "<string>"
}
Delete a webhook for the repository specified via the URL.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredThe webhook for the repository has been deleted.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
string
A webhook invocation dataset.
RestDetailedInvocation
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/latest' \
--header 'Accept: application/json'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
Requiredstring
A webhook invocation dataset.
RestInvocationHistory
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics' \
--header 'Accept: application/json'
Find webhooks in this repository.
The authenticated user must have REPO_ADMIN permission for the specified repository to call this resource.
string
Requiredstring
Requiredstring
RequiredA webhook invocation dataset.
RestInvocationHistory
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/repos/{repositorySlug}/webhooks/{webhookId}/statistics/summary' \
--header 'Accept: application/json'
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
{
"inactivityWeeks": 4,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"enabled": true
}
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
{
"inactivityWeeks": 4,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
},
"enabled": true
}
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": [
{
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"description": "<string>"
},
"configured": true,
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
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
{
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"description": "<string>"
},
"configured": true,
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
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
{
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"description": "<string>"
},
"configured": true,
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
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
{
"details": {
"configFormKey": "<string>",
"supportedScopes": [
"GLOBAL"
],
"version": "<string>",
"name": "<string>",
"key": "<string>",
"type": "PRE_RECEIVE",
"description": "<string>"
},
"configured": true,
"enabled": true,
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
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": {
"strategies": [
{
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
}
],
"commitSummaries": 2154,
"defaultStrategy": {
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
},
"type": "repository"
}
}
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": {}
}
],
"commitSummaries": 2154,
"defaultStrategy": {
"id": "no-ff",
"links": {}
}
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
{
"mergeConfig": {
"strategies": [
{
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
}
],
"commitSummaries": 2154,
"defaultStrategy": {
"flag": "--no-ff",
"name": "Merge commit",
"id": "no-ff",
"enabled": true,
"description": "Always create a merge commit"
},
"type": "repository"
}
}
Retrieve a page of reviewer groups of a given scope.
The authenticated user must have PROJECT_READ permission for the specified project to call this resource.
string
Requirednumber
number
A page of reviewer group(s) of the provided scope.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups' \
--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
{
"values": [
{
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Create a reviewer group.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
RequiredThe reviewer group to be create
string
array<ApplicationUser>
string
integer
string
object
The newly created reviewer group.
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
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"avatarUrl": "<string>",
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
Retrieve a reviewer group.
The authenticated user must have PROJECT_READ permission for the specified project to call this resource.
string
Requiredstring
RequiredThe reviewer group.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups/{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
{
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
Update the attributes of a reviewer group.
The authenticated user must have PROJECT_READ permission for the specified project to call this resource.
string
Requiredstring
RequiredThe request containing the attributes of the reviewer group to be updated. Only the attributes to be updated need to be present in this object.
string
array<ApplicationUser>
string
integer
string
object
A page of changes.
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
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"avatarUrl": "<string>",
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}'
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
{
"users": [
{
"slug": "<string>",
"displayName": "<string>",
"id": 2154,
"type": "NORMAL",
"active": true,
"emailAddress": "<string>",
"name": "<string>"
}
],
"name": "name",
"id": 2154,
"description": "null",
"scope": {
"resourceId": 2,
"type": "GLOBAL"
}
}
Deletes a reviewer group.
The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource.
string
Requiredstring
RequiredThe operation was successful.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/projects/{projectKey}/settings/reviewer-groups/{id}'
Retrieve a page of repositories based on query parameters that control the search. See the documentation of the parameters for more details.
This resource is anonymously accessible.
Note on permissions. In absence of the permission
query parameter the implicit 'read' permission is assumed. Please note that this permission is lower than the REPO_READ permission rather than being equal to it. The implicit 'read' permission for a given repository is assigned to any user that has any of the higher permissions, such as REPO_READ, as well as to anonymous users if the repository is marked as public. The important implication of the above is that an anonymous request to this resource with a permission level REPO_READ is guaranteed to receive an empty list of repositories as a result. For anonymous requests it is therefore recommended to not specify the permission parameter at all.
string
string
string
string
string
string
string
number
number
A page of repositories.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/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
{
"values": [
{
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"origin": {
"scmId": "git",
"hierarchyId": "e3c939f9ef4a7fae272e",
"statusMessage": "Available",
"partition": 2154,
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
},
"archived": true,
"forkable": true,
"defaultBranch": "main",
"relatedLinks": {},
"slug": "my-repo",
"name": "My repo",
"public": true,
"id": 2154,
"state": "AVAILABLE",
"description": "My repo description",
"scope": "REPOSITORY"
}
],
"size": 1,
"isLastPage": true,
"nextPageStart": 2154,
"start": 2154,
"limit": 25
}
Create a new task.
Removed in 8.0. Tasks are now managed using Comments with severity BLOCKER. Call POST /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments
instead,passing the attribute 'severity' set to 'BLOCKER'.
This request has no parameters.
This endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/tasks'
1
2
3
4
5
6
7
8
9
{
"errors": [
{
"exceptionName": "<string>",
"message": "<string>",
"context": "<string>"
}
]
}
Retrieve an existing task.
Removed in 8.0. Tasks are now managed using Comments with BLOCKER severity. Call GET /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}
instead. @deprecated since 7.2, changed to 404 in 8.0, remove in 9.0. Call GET /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId} instead.
string
RequiredThis endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.
1
2
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/tasks/{taskId}'
1
2
3
4
5
6
7
8
9
{
"errors": [
{
"exceptionName": "<string>",
"message": "<string>",
"context": "<string>"
}
]
}
Update an existing task.
Removed in 8.0. Tasks are now managed using Comments with BLOCKER severity. Call PUT /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}
instead. To resolve a task, pass the attribute 'state' set to 'RESOLVED'. @deprecated since 7.2, changed to 404 in 8.0, remove in 9.0. Call PUT /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}
instead.
As of Stash 3.3, only the state and text of a task can be updated.
Updating the state of a task is allowed for any user having READ access to the repository. However only the task's creator, the context's author or an admin of the context's repository can update the task's text. (For a pull request task, those are the task's creator, the pull request's author or an admin on the repository containing the pull request). Additionally the task's text cannot be updated if it has been resolved.
string
RequiredThis endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.
1
2
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/tasks/{taskId}'
1
2
3
4
5
6
7
8
9
{
"errors": [
{
"exceptionName": "<string>",
"message": "<string>",
"context": "<string>"
}
]
}
Delete a task.
Removed in 8.0. Tasks are now managed using Comments with BLOCKER severity. Call DELETE /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId}
instead. @deprecated since 7.2, changed to 404 in 8.0, remove in 9.0. Call DELETE /rest/api/1.0/projects/{projectKey}/repos/{repositorySlug}/pull-requests/{pullRequestId}/comments/{commentId} instead.
Note that only the task's creator, the context's author or an admin of the context's repository can delete a task. (For a pull request task, those are the task's creator, the pull request's author or an admin on the repository containing the pull request). Additionally a task cannot be deleted if it has already been resolved.
string
RequiredThis endpoint has been removed as tasks are now managed using Comments with severity BLOCKER.
1
2
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/tasks/{taskId}'
1
2
3
4
5
6
7
8
9
{
"errors": [
{
"exceptionName": "<string>",
"message": "<string>",
"context": "<string>"
}
]
}
Retrieve a page of users, optionally run through provided filters.
Only authenticated users may call this resource.
The following three sub-sections list parameters supported for permission filters (where [root]
is
the root permission filter name, e.g. permission
, permission.1
etc.) depending on the
permission resource. The system determines which filter to apply (Global, Project or Repository permission)
based on the [root]
permission value. E.g. ADMIN
is a global permission,
PROJECT_ADMIN
is a project permission and REPO_ADMIN
is a repository permission. Note
that the parameters for a given resource will be looked up in the order as they are listed below, that is e.g.
for a project resource, if both projectId
and projectKey
are provided, the system will
use projectId
for the lookup.
The permission value under [root]
is the only required and recognized parameter, as global
permissions do not apply to a specific resource.
Example valid filter: permission=ADMIN
.
[root]
- specifies the project permission[root].projectId
- specifies the project ID to lookup the project by[root].projectKey
- specifies the project key to lookup the project byExample valid filter: permission.1=PROJECT_ADMIN&permission.1.projectKey=TEST_PROJECT
.
[root]
- specifies the repository permission[root].projectId
- specifies the repository ID to lookup the repository by[root].projectKey
and [root].repositorySlug
- specifies the project key and repository slug to lookup the repository by; both values need to be provided for this look up to be triggeredExample valid filter: permission.2=REPO_ADMIN&permission.2.projectKey=TEST_PROJECT&permission.2.repositorySlug=test_repo
.
string
string
string
string
A page of users.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/users' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
Update the currently authenticated user's details. The update will always be applied to the currently authenticated user.
The user update details
string
string
string
The updated user.
1
2
3
4
5
6
7
8
9
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/users' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"displayName": "Jane Citizen",
"email": "jane@example.com",
"name": "jcitizen"
}'
1
2
3
4
5
6
7
8
9
{
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
Update the currently authenticated user's password.
The password update details
string
string
string
The user's password was successfully updated.
1
2
3
4
5
6
7
8
curl --request PUT \
--url 'http://{baseurl}/rest/api/latest/users/credentials' \
--header 'Content-Type: application/json' \
--data '{
"oldPassword": "my-old-secret-password",
"password": "my-secret-password",
"passwordConfirm": "my-secret-password"
}'
Retrieve the user matching the supplied userSlug.
string
RequiredThe user matching the supplied userSlug. Note, this may not be the user's username, always use the user.slug property.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/users/{userSlug}' \
--header 'Accept: application/json'
1
2
3
4
5
6
7
8
9
{
"slug": "jcitizen",
"emailAddress": "jane@example.com",
"displayName": "Jane Citizen",
"name": "jcitizen",
"id": 101,
"type": "NORMAL",
"active": true
}
Update the avatar for the user with the supplied slug.
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:
1
curl -X POST -u username:password -H "X-Atlassian-Token: no-check" http://example.com/rest/api/latest/users/jdoe/avatar.png -F avatar=@avatar.png
Users are always allowed to update their own avatar. To update someone else's avatar the authenticated user must have global ADMIN permission, or global SYS_ADMIN permission to update a SYS_ADMIN user's avatar.
string
Requiredstring
Multipart form data containing a single image in a form-field named 'avatar'.
string
The avatar was uploaded successfully.
string
1
2
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/users/{userSlug}/avatar.png'
Delete the avatar associated to a user.
Users are always allowed to delete their own avatar. To delete someone else's avatar the authenticated user must have global ADMIN permission, or global SYS_ADMIN permission to update a SYS_ADMIN user's avatar.
string
RequiredThe new avatar URL if the local avatar was successfully deleted or did not exist
1
2
3
curl --request DELETE \
--url 'http://{baseurl}/rest/api/latest/users/{userSlug}/avatar.png' \
--header 'Accept: application/json'
1
2
3
4
{
"name": "http",
"href": "https://bitbucket.example.com/scm/awesomeproject/awesomerepo.git"
}
Retrieve a map of user setting key values for a specific user identified by the user slug.
string
RequiredThe user settings for the specified user slug.
1
2
3
curl --request GET \
--url 'http://{baseurl}/rest/api/latest/users/{userSlug}/settings' \
--header 'Accept: application/json'
1
2
3
4
5
{
"string key": "string value",
"boolean key": true,
"long key": 10
}
Update the entries of a map of user setting key/values for a specific user identified by the user slug.
string
RequiredA map with the UserSettings entries which must be updated.
string
boolean
number
The UserSettings were updated successfully
1
2
3
4
5
6
7
8
curl --request POST \
--url 'http://{baseurl}/rest/api/latest/users/{userSlug}/settings' \
--header 'Content-Type: application/json' \
--data '{
"string key": "string value",
"boolean key": true,
"long key": 10
}'
Rate this page: